diff options
author | Patrick McLean <chutzpah@gentoo.org> | 2016-04-12 18:11:47 -0700 |
---|---|---|
committer | Patrick McLean <chutzpah@gentoo.org> | 2016-04-12 18:12:10 -0700 |
commit | 128b74fe25d08b3f8d17e3ee793d87131eba9c37 (patch) | |
tree | 809f2974e3a4801d9968279b7b7eb4f39d5dde5a /net-misc/miniupnpd/files | |
parent | net-misc/miniupnpd: Add myself as co-maintainer (diff) | |
download | gentoo-128b74fe25d08b3f8d17e3ee793d87131eba9c37.tar.gz gentoo-128b74fe25d08b3f8d17e3ee793d87131eba9c37.tar.bz2 gentoo-128b74fe25d08b3f8d17e3ee793d87131eba9c37.zip |
net-misc/miniupnpd: Version bump, expose several options through USE flags
This also reworks the init script to be more modern and allows skipping of the
iptables manipulation scripts.
Package-Manager: portage-2.2.28
Diffstat (limited to 'net-misc/miniupnpd/files')
-rw-r--r-- | net-misc/miniupnpd/files/miniupnpd-1.10_pre20160222-build.patch | 125 | ||||
-rw-r--r-- | net-misc/miniupnpd/files/miniupnpd-conf.d-r1 | 10 | ||||
-rw-r--r-- | net-misc/miniupnpd/files/miniupnpd-init.d-r1 | 33 |
3 files changed, 168 insertions, 0 deletions
diff --git a/net-misc/miniupnpd/files/miniupnpd-1.10_pre20160222-build.patch b/net-misc/miniupnpd/files/miniupnpd-1.10_pre20160222-build.patch new file mode 100644 index 000000000000..3323b1cfd86f --- /dev/null +++ b/net-misc/miniupnpd/files/miniupnpd-1.10_pre20160222-build.patch @@ -0,0 +1,125 @@ +diff --git a/Makefile.linux b/Makefile.linux +index ce6b994..e535c38 100644 +--- a/Makefile.linux ++++ b/Makefile.linux +@@ -36,6 +36,7 @@ INSTALL = install + STRIP ?= strip + PKG_CONFIG ?= pkg-config + CP = cp ++LDLIBS_IPV6 := + + + INSTALLPREFIX ?= $(PREFIX)/usr +@@ -55,90 +56,8 @@ NETFILTEROBJS = netfilter/iptcrdr.o netfilter/iptpinhole.o netfilter/nfct_get.o + + ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS) + +-PCFILE_FOUND := $(shell $(PKG_CONFIG) --exists libiptc; echo $$?) +- +-ifeq (${PCFILE_FOUND},0) +- +-IPTABLESVERSION := $(shell $(PKG_CONFIG) --modversion libiptc) +-IPTABLESVERSION1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 ) +-IPTABLESVERSION2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 ) +-IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 ) +-# test if iptables version >= 1.4.3 +-TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 ) +-ifeq ($(TEST), 1) ++LDLIBS += -lip4tc $(LDLIBS_IPV6) + CPPFLAGS += -DIPTABLES_143 +-endif +- +-CFLAGS += $(shell $(PKG_CONFIG) --cflags libiptc) +-LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libiptc) +-LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L libiptc) +-LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-other libiptc) +-else +- +-ifeq "$(wildcard /etc/gentoo-release )" "" +-LDLIBS ?= -liptc +-else # gentoo +-# the following is better, at least on gentoo with iptables 1.4.6 +-# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=1618 +-# and http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=2183 +-LDLIBS ?= -lip4tc +-CPPFLAGS := -DIPTABLES_143 $(CPPFLAGS) +-endif +- +-ARCH ?= $(shell uname -m | grep -q "x86_64" && echo 64) +-ifdef IPTABLESPATH +-CPPFLAGS := $(CPPFLAGS) -I$(IPTABLESPATH)/include/ +-LDFLAGS := $(LDFLAFGS) -L$(IPTABLESPATH)/libiptc/ +-# get iptables version and set IPTABLES_143 macro if needed +-ifeq ($(TARGET_OPENWRT),) +-IPTABLESVERSION := $(shell grep "\#define VERSION" $(IPTABLESPATH)/config.h | tr -d \" |cut -d" " -f3 ) +-IPTABLESVERSION1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 ) +-IPTABLESVERSION2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 ) +-IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 ) +-# test if iptables version >= 1.4.3 +-TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 ) +-ifeq ($(TEST), 1) +-CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143 +-# the following sucks, but works +-LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o +-#LDLIBS = $(IPTABLESPATH)/libiptc/.libs/libiptc.a +-else # ifeq ($(TEST), 1) +-LDLIBS = $(IPTABLESPATH)/libiptc/libiptc.a +-endif # ifeq ($(TEST), 1) +-else # ($(TARGET_OPENWRT),) +-# openWRT : +-# check for system-wide iptables files. Test if iptables version >= 1.4.3 +-# the following test has to be verified : +-TEST := $(shell test -f /usr/include/iptables/internal.h && grep -q "\#define IPTABLES_VERSION" /usr/include/iptables/internal.h && echo 1) +-ifeq ($(TEST), 1) +-CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143 +-LDLIBS = -liptc +-endif # ($(TEST), 1) +-TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1) +-ifeq ($(TEST_LIB), 1) +-LDLIBS = -liptc /usr/lib$(ARCH)/libiptc.a +-endif # ($(TEST_LIB), 1) +-endif # ($(TARGET_OPENWRT),) +-else # ifdef IPTABLESPATH +-# IPTABLESPATH not defined +-# the following test has to be verified : +-TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1) +-ifeq ($(TEST), 1) +-CPPFLAGS := $(CPPFLAGS) -DIPTABLES_143 +-LDLIBS = -liptc +-TESTIP4TC := $(shell test -f /lib/libip4tc.so && echo 1) +-ifeq ($(TESTIP4TC), 1) +-LDLIBS := $(LDLIBS) -lip4tc +-endif # ($(TESTIP4TC), 1) +-TESTIP6TC := $(shell test -f /lib/libip6tc.so && echo 1) +-ifeq ($(TESTIP6TC), 1) +-LDLIBS := $(LDLIBS) -lip6tc +-endif # ($(TESTIP6TC), 1) +-endif # ($(TEST), 1) +-endif # ifdef IPTABLESPATH +-endif # ifdef PCFILE_FOUND +- +-#LDLIBS += -lnfnetlink + + TEST := $(shell $(PKG_CONFIG) --atleast-version=1.0.2 libnetfilter_conntrack && $(PKG_CONFIG) --atleast-version=1.0.3 libmnl && echo 1) + ifeq ($(TEST),1) +@@ -194,7 +113,6 @@ install: miniupnpd miniupnpd.8 miniupnpd.conf genuuid \ + $(INSTALL) linux/miniupnpd.init.d.script $(DESTDIR)$(PREFIX)/etc/init.d/miniupnpd + $(INSTALL) -d $(DESTDIR)$(MANINSTALLDIR) + $(INSTALL) --mode=0644 miniupnpd.8 $(DESTDIR)$(MANINSTALLDIR) +- gzip -f $(DESTDIR)$(MANINSTALLDIR)/miniupnpd.8 + + # genuuid is using the uuidgen CLI tool which is part of libuuid + # from the e2fsprogs +diff --git a/genconfig.sh b/genconfig.sh +index 976e963..faef028 100755 +--- a/genconfig.sh ++++ b/genconfig.sh +@@ -299,7 +299,7 @@ case $OS_NAME in + fi + echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE} + FW=netfilter +- V6SOCKETS_ARE_V6ONLY=`/sbin/sysctl -n net.ipv6.bindv6only` ++ V6SOCKETS_ARE_V6ONLY=`/usr/sbin/sysctl -n net.ipv6.bindv6only` + ;; + OpenWRT) + OS_URL=http://www.openwrt.org/ diff --git a/net-misc/miniupnpd/files/miniupnpd-conf.d-r1 b/net-misc/miniupnpd/files/miniupnpd-conf.d-r1 new file mode 100644 index 000000000000..1464bf04bd18 --- /dev/null +++ b/net-misc/miniupnpd/files/miniupnpd-conf.d-r1 @@ -0,0 +1,10 @@ +# /etc/conf.d/miniupnpd: Configuration for miniupnpd init script + +# extra arguments to be passed to the command +#extra_args="" + +# the location of the configuration file +#config_file="/etc/miniupnpd/miniupnpd.conf" + +# uncomment to not use included scripts to manipulate iptables +#no_iptables_scripts=1 diff --git a/net-misc/miniupnpd/files/miniupnpd-init.d-r1 b/net-misc/miniupnpd/files/miniupnpd-init.d-r1 new file mode 100644 index 000000000000..99406106a86d --- /dev/null +++ b/net-misc/miniupnpd/files/miniupnpd-init.d-r1 @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/sbin/miniupnpd" +: "${config_file:=/etc/miniupnpd/miniupnpd.conf}" +command_args="-f ${config_file:-/etc/miniupnpd/miniupnpd.conf} ${extra_args}" +: "${pidfile:=/var/run/miniupnpd.pid}" + +depend() { + need net iptables + use minissdpd +} + +start_pre() { + local retval=0 + + if [[ -z ${no_iptables_scripts} ]]; then + /etc/miniupnpd/iptables_init.sh || retval=${?} + fi + + return ${retval} +} + +stop_post() { + local retval=0 + + if [[ -z ${no_iptables_scripts} ]]; then + /etc/miniupnpd/iptables_removeall.sh + fi + + return ${retval} +} |