Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/miniupnpd/files: miniupnpd-1.8-build.patch
Date: Tue, 29 Apr 2014 20:58:46
Message-Id: 20140429205842.83CE02004C@flycatcher.gentoo.org
1 vapier 14/04/29 20:58:42
2
3 Added: miniupnpd-1.8-build.patch
4 Log:
5 Clean up build and ebuild so it cross-compiles cleanly, and drop old code no longer needed.
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
8
9 Revision Changes Path
10 1.1 net-misc/miniupnpd/files/miniupnpd-1.8-build.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/miniupnpd/files/miniupnpd-1.8-build.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/miniupnpd/files/miniupnpd-1.8-build.patch?rev=1.1&content-type=text/plain
14
15 Index: miniupnpd-1.8-build.patch
16 ===================================================================
17 https://github.com/miniupnp/miniupnp/pull/70
18
19 --- a/Makefile.linux
20 +++ b/Makefile.linux
21 @@ -21,10 +21,9 @@
22 # $ IPTABLESPATH=/path/to/iptables-1.4.1 make -f Makefile.linux
23 #
24 #CFLAGS = -O -g -DDEBUG
25 -CFLAGS ?= -Os
26 CFLAGS += -fno-strict-aliasing
27 CFLAGS += -fno-common
28 -CFLAGS += -D_GNU_SOURCE
29 +CPPFLAGS += -D_GNU_SOURCE
30 CFLAGS += -Wall
31 CFLAGS += -Wextra -Wstrict-prototypes -Wdeclaration-after-statement
32 #CFLAGS += -Wno-missing-field-initializers
33 @@ -53,69 +52,8 @@ NETFILTEROBJS = netfilter/iptcrdr.o netfilter/iptpinhole.o
34
35 ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
36
37 -ifeq "$(wildcard /etc/gentoo-release )" ""
38 -LIBS ?= -liptc
39 -else # gentoo
40 -# the following is better, at least on gentoo with iptables 1.4.6
41 -# see http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=1618
42 -# and http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=2183
43 -LIBS ?= -lip4tc
44 -CFLAGS := -DIPTABLES_143 $(CFLAGS)
45 -endif
46 -
47 -ARCH ?= $(shell uname -m | grep -q "x86_64" && echo 64)
48 -ifdef IPTABLESPATH
49 -CFLAGS := $(CFLAGS) -I$(IPTABLESPATH)/include/
50 -LDFLAGS := $(LDFLAFGS) -L$(IPTABLESPATH)/libiptc/
51 -# get iptables version and set IPTABLES_143 macro if needed
52 -ifeq ($(TARGET_OPENWRT),)
53 -IPTABLESVERSION := $(shell grep "\#define VERSION" $(IPTABLESPATH)/config.h | tr -d \" |cut -d" " -f3 )
54 -IPTABLESVERSION1 := $(shell echo $(IPTABLESVERSION) | cut -d. -f1 )
55 -IPTABLESVERSION2 := $(shell echo $(IPTABLESVERSION) | cut -d. -f2 )
56 -IPTABLESVERSION3 := $(shell echo $(IPTABLESVERSION) | cut -d. -f3 )
57 -# test if iptables version >= 1.4.3
58 -TEST := $(shell [ \( \( $(IPTABLESVERSION1) -ge 1 \) -a \( $(IPTABLESVERSION2) -ge 4 \) \) -a \( $(IPTABLESVERSION3) -ge 3 \) ] && echo 1 )
59 -ifeq ($(TEST), 1)
60 -CFLAGS := $(CFLAGS) -DIPTABLES_143
61 -# the following sucks, but works
62 -LIBS = $(IPTABLESPATH)/libiptc/.libs/libip4tc.o
63 -#LIBS = $(IPTABLESPATH)/libiptc/.libs/libiptc.a
64 -else # ifeq ($(TEST), 1)
65 -LIBS = $(IPTABLESPATH)/libiptc/libiptc.a
66 -endif # ifeq ($(TEST), 1)
67 -else # ($(TARGET_OPENWRT),)
68 -# openWRT :
69 -# check for system-wide iptables files. Test if iptables version >= 1.4.3
70 -# the following test has to be verified :
71 -TEST := $(shell test -f /usr/include/iptables/internal.h && grep -q "\#define IPTABLES_VERSION" /usr/include/iptables/internal.h && echo 1)
72 -ifeq ($(TEST), 1)
73 -CFLAGS := $(CFLAGS) -DIPTABLES_143
74 -LIBS = -liptc
75 -endif # ($(TEST), 1)
76 -TEST_LIB := $(shell test -f /usr/lib$(ARCH)/libiptc.a && echo 1)
77 -ifeq ($(TEST_LIB), 1)
78 -LIBS = -liptc /usr/lib$(ARCH)/libiptc.a
79 -endif # ($(TEST_LIB), 1)
80 -endif # ($(TARGET_OPENWRT),)
81 -else # ifdef IPTABLESPATH
82 -# IPTABLESPATH not defined
83 -# the following test has to be verified :
84 -TEST := $(shell test -f /usr/include/xtables.h && grep -q "XTABLES_VERSION_CODE" /usr/include/xtables.h && echo 1)
85 -ifeq ($(TEST), 1)
86 -CFLAGS := $(CFLAGS) -DIPTABLES_143
87 -LIBS = -liptc
88 -TESTIP4TC := $(shell test -f /lib/libip4tc.so && echo 1)
89 -ifeq ($(TESTIP4TC), 1)
90 -LIBS := $(LIBS) -lip4tc
91 -endif # ($(TESTIP4TC), 1)
92 -TESTIP6TC := $(shell test -f /lib/libip6tc.so && echo 1)
93 -ifeq ($(TESTIP6TC), 1)
94 -LIBS := $(LIBS) -lip6tc
95 -endif # ($(TESTIP6TC), 1)
96 -endif # ($(TEST), 1)
97 -endif # ifdef IPTABLESPATH
98 -
99 -LIBS += -lnfnetlink
100 +LDLIBS = -lip4tc -lnfnetlink
101 +CPPFLAGS += -DIPTABLES_143
102
103 TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o
104
105 @@ -150,8 +88,8 @@ install: miniupnpd miniupnpd.8 miniupnpd.conf genuuid \
106 $(INSTALL) --mode=0644 -b miniupnpd.conf $(ETCINSTALLDIR)
107 $(INSTALL) -d $(PREFIX)/etc/init.d
108 $(INSTALL) linux/miniupnpd.init.d.script $(PREFIX)/etc/init.d/miniupnpd
109 + $(INSTALL) -d $(MANINSTALLDIR)
110 + $(INSTALL) --mode=0644 miniupnpd.8 $(MANINSTALLDIR)
111 - $(INSTALL) miniupnpd.8 $(MANINSTALLDIR)
112 - gzip $(MANINSTALLDIR)/miniupnpd.8
113
114 # genuuid is using the uuidgen CLI tool which is part of libuuid
115 # from the e2fsprogs
116 @@ -162,7 +100,7 @@ else
117 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
118 endif
119
120 -miniupnpd: $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS) $(LIBS)
121 +miniupnpd: $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS)
122
123 testupnpdescgen: $(TESTUPNPDESCGENOBJS)