summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-04-29 20:58:42 +0000
committerMike Frysinger <vapier@gentoo.org>2014-04-29 20:58:42 +0000
commit1bb7fa7878515867fe0efae9768becac2db22678 (patch)
tree31925ebc2f878d176255357a2548b9f4963ad88c /net-misc/miniupnpd
parentCreate ${CHOST}-prefixed tool symlinks for multilib portage, to gain better c... (diff)
downloadgentoo-2-1bb7fa7878515867fe0efae9768becac2db22678.tar.gz
gentoo-2-1bb7fa7878515867fe0efae9768becac2db22678.tar.bz2
gentoo-2-1bb7fa7878515867fe0efae9768becac2db22678.zip
Clean up build and ebuild so it cross-compiles cleanly, and drop old code no longer needed.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'net-misc/miniupnpd')
-rw-r--r--net-misc/miniupnpd/ChangeLog9
-rw-r--r--net-misc/miniupnpd/files/miniupnpd-1.8-build.patch108
-rw-r--r--net-misc/miniupnpd/miniupnpd-1.8-r1.ebuild59
3 files changed, 175 insertions, 1 deletions
diff --git a/net-misc/miniupnpd/ChangeLog b/net-misc/miniupnpd/ChangeLog
index 68f71b74bfef..0ef756c77784 100644
--- a/net-misc/miniupnpd/ChangeLog
+++ b/net-misc/miniupnpd/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/miniupnpd
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/miniupnpd/ChangeLog,v 1.32 2014/04/29 19:47:34 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/miniupnpd/ChangeLog,v 1.33 2014/04/29 20:58:42 vapier Exp $
+
+*miniupnpd-1.8-r1 (29 Apr 2014)
+
+ 29 Apr 2014; Mike Frysinger <vapier@gentoo.org>
+ +files/miniupnpd-1.8-build.patch, +miniupnpd-1.8-r1.ebuild:
+ Clean up build and ebuild so it cross-compiles cleanly, and drop old code no
+ longer needed.
29 Apr 2014; Mike Frysinger <vapier@gentoo.org> miniupnpd-1.8.ebuild:
Add arm love.
diff --git a/net-misc/miniupnpd/files/miniupnpd-1.8-build.patch b/net-misc/miniupnpd/files/miniupnpd-1.8-build.patch
new file mode 100644
index 000000000000..007c6a030644
--- /dev/null
+++ b/net-misc/miniupnpd/files/miniupnpd-1.8-build.patch
@@ -0,0 +1,108 @@
+https://github.com/miniupnp/miniupnp/pull/70
+
+--- a/Makefile.linux
++++ b/Makefile.linux
+@@ -21,10 +21,9 @@
+ # $ IPTABLESPATH=/path/to/iptables-1.4.1 make -f Makefile.linux
+ #
+ #CFLAGS = -O -g -DDEBUG
+-CFLAGS ?= -Os
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -fno-common
+-CFLAGS += -D_GNU_SOURCE
++CPPFLAGS += -D_GNU_SOURCE
+ CFLAGS += -Wall
+ CFLAGS += -Wextra -Wstrict-prototypes -Wdeclaration-after-statement
+ #CFLAGS += -Wno-missing-field-initializers
+@@ -53,69 +52,8 @@ NETFILTEROBJS = netfilter/iptcrdr.o netfilter/iptpinhole.o
+
+ ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
+
+-ifeq "$(wildcard /etc/gentoo-release )" ""
+-LIBS ?= -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
+-LIBS ?= -lip4tc
+-CFLAGS := -DIPTABLES_143 $(CFLAGS)
+-endif
+-
+-ARCH ?= $(shell uname -m | grep -q "x86_64" && echo 64)
+-ifdef IPTABLESPATH
+-CFLAGS := $(CFLAGS) -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)
+-CFLAGS := $(CFLAGS) -DIPTABLES_143
+-# the following sucks, but works
+-LIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
+-#LIBS = $(IPTABLESPATH)/libiptc/.libs/libiptc.a
+-else # ifeq ($(TEST), 1)
+-LIBS = $(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)
+-CFLAGS := $(CFLAGS) -DIPTABLES_143
+-LIBS = -liptc
+-endif # ($(TEST), 1)
+-TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1)
+-ifeq ($(TEST_LIB), 1)
+-LIBS = -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)
+-CFLAGS := $(CFLAGS) -DIPTABLES_143
+-LIBS = -liptc
+-TESTIP4TC := $(shell test -f /lib/libip4tc.so && echo 1)
+-ifeq ($(TESTIP4TC), 1)
+-LIBS := $(LIBS) -lip4tc
+-endif # ($(TESTIP4TC), 1)
+-TESTIP6TC := $(shell test -f /lib/libip6tc.so && echo 1)
+-ifeq ($(TESTIP6TC), 1)
+-LIBS := $(LIBS) -lip6tc
+-endif # ($(TESTIP6TC), 1)
+-endif # ($(TEST), 1)
+-endif # ifdef IPTABLESPATH
+-
+-LIBS += -lnfnetlink
++LDLIBS = -lip4tc -lnfnetlink
++CPPFLAGS += -DIPTABLES_143
+
+ TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
+
+@@ -150,8 +88,8 @@ install: miniupnpd miniupnpd.8 miniupnpd.conf genuuid \
+ $(INSTALL) --mode=0644 -b miniupnpd.conf $(ETCINSTALLDIR)
+ $(INSTALL) -d $(PREFIX)/etc/init.d
+ $(INSTALL) linux/miniupnpd.init.d.script $(PREFIX)/etc/init.d/miniupnpd
++ $(INSTALL) -d $(MANINSTALLDIR)
++ $(INSTALL) --mode=0644 miniupnpd.8 $(MANINSTALLDIR)
+- $(INSTALL) miniupnpd.8 $(MANINSTALLDIR)
+- gzip $(MANINSTALLDIR)/miniupnpd.8
+
+ # genuuid is using the uuidgen CLI tool which is part of libuuid
+ # from the e2fsprogs
+@@ -162,7 +100,7 @@ else
+ sed -i -e "s/^uuid=[-0-9a-f]*/uuid=`($(STAGING_DIR_HOST)/bin/genuuid||$(STAGING_DIR_HOST)/bin/uuidgen||$(STAGING_DIR_HOST)/bin/uuid) 2>/dev/null`/" miniupnpd.conf
+ endif
+
+-miniupnpd: $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS) $(LIBS)
++miniupnpd: $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
+
+ testupnpdescgen: $(TESTUPNPDESCGENOBJS)
+
diff --git a/net-misc/miniupnpd/miniupnpd-1.8-r1.ebuild b/net-misc/miniupnpd/miniupnpd-1.8-r1.ebuild
new file mode 100644
index 000000000000..1ba6c4ec32d7
--- /dev/null
+++ b/net-misc/miniupnpd/miniupnpd-1.8-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/miniupnpd/miniupnpd-1.8-r1.ebuild,v 1.1 2014/04/29 20:58:42 vapier Exp $
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+MY_PV=1.8
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="MiniUPnP IGD Daemon"
+HOMEPAGE="http://miniupnp.free.fr/"
+SRC_URI="http://miniupnp.free.fr/files/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE=""
+
+RDEPEND=">=net-firewall/iptables-1.4.6
+ net-libs/libnfnetlink"
+DEPEND="${RDEPEND}
+ sys-apps/util-linux
+ sys-apps/lsb-release"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.8-build.patch
+ mv Makefile.linux Makefile || die
+}
+
+src_configure() {
+ tc-export CC
+ export STRIP=true
+
+ emake config.h
+ sed -i -r \
+ -e '/#define ENABLE_LEASEFILE/s:(/[*]|[*]/)::g' \
+ config.h || die
+}
+
+src_compile() {
+ # By default, it builds a bunch of unittests we don't run.
+ emake CC="$(tc-getCC)" miniupnpd
+}
+
+src_install() {
+ emake install PREFIX="${ED}"
+
+ newinitd "${FILESDIR}"/${PN}-init.d ${PN}
+ newconfd "${FILESDIR}"/${PN}-conf.d ${PN}
+}
+
+pkg_postinst() {
+ elog "Please correct the external interface in the top of the two"
+ elog "scripts in /etc/miniupnpd and edit the config file in there too"
+}