Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/ipguard/files/, net-analyzer/ipguard/
Date: Fri, 31 Jan 2020 16:01:41
Message-Id: 1580486489.b18a0369b3d30d999feb001214862fee90d6bbf9.jer@gentoo
1 commit: b18a0369b3d30d999feb001214862fee90d6bbf9
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 31 16:01:04 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 31 16:01:29 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b18a0369
7
8 net-analyzer/ipguard: Fix CFLAGS=-fno-common
9
10 Package-Manager: Portage-2.3.86, Repoman-2.3.20
11 Closes: https://bugs.gentoo.org/show_bug.cgi?id=707396
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 .../ipguard/files/ipguard-1.04-fno-common.patch | 98 ++++++++++++++++++++++
15 .../ipguard/files/ipguard-1.04-gentoo.patch | 50 +++++++++++
16 .../ipguard/files/ipguard-1.04-init.d.patch | 36 ++++++++
17 .../ipguard/files/ipguard-1.04-runpath.patch | 11 +++
18 net-analyzer/ipguard/ipguard-1.04-r1.ebuild | 27 ++----
19 5 files changed, 201 insertions(+), 21 deletions(-)
20
21 diff --git a/net-analyzer/ipguard/files/ipguard-1.04-fno-common.patch b/net-analyzer/ipguard/files/ipguard-1.04-fno-common.patch
22 new file mode 100644
23 index 00000000000..414a91ec09a
24 --- /dev/null
25 +++ b/net-analyzer/ipguard/files/ipguard-1.04-fno-common.patch
26 @@ -0,0 +1,98 @@
27 +--- a/ipguard.c
28 ++++ b/ipguard.c
29 +@@ -29,6 +29,34 @@
30 +
31 + #include "ipguard.h"
32 +
33 ++char iface[IFNAMSIZ];
34 ++char ethers_name[PATH_MAX];
35 ++char log_name[PATH_MAX];
36 ++char pid_name[PATH_MAX];
37 ++char fmac[18];
38 ++char pcapf[PCAPFSIZ];
39 ++char suser[MAXLOGNAME];
40 ++int ethers_update;
41 ++int fake_regen;
42 ++int fake_num;
43 ++int fake_time;
44 ++int buffer_num;
45 ++int addr_nosubst;
46 ++int nofirst;
47 ++int grant;
48 ++int read_only;
49 ++int duplex;
50 ++int fixbc;
51 ++int hidden;
52 ++int promisc;
53 ++int debug;
54 ++int verbose;
55 ++
56 ++unsigned int all, good, grat, wgrat, zmac, zip, bad, bmac, bsip, btip,
57 ++ bnew, bgrat, mymac, fake, pfake, nzh, nbe, mis;
58 ++char pfmac[18];
59 ++char s[128+1];
60 ++
61 + void usage(char *name) {
62 + fprintf(stdout, "%s v%s (c) %s <%s>\n\n", NAME, VERSION, AUTHOR, MAIL);
63 + fprintf(stdout, "usage: %s [-h] [-ajgrxziovd]\n", name);
64 +--- a/ipguard.h
65 ++++ b/ipguard.h
66 +@@ -68,33 +68,33 @@
67 + #define NOTICE 3
68 + #define INFO 4
69 +
70 +-char iface[IFNAMSIZ];
71 +-char ethers_name[PATH_MAX];
72 +-char log_name[PATH_MAX];
73 +-char pid_name[PATH_MAX];
74 +-char fmac[18];
75 +-char pcapf[PCAPFSIZ];
76 +-char suser[MAXLOGNAME];
77 +-int ethers_update;
78 +-int fake_regen;
79 +-int fake_num;
80 +-int fake_time;
81 +-int buffer_num;
82 +-int addr_nosubst;
83 +-int nofirst;
84 +-int grant;
85 +-int read_only;
86 +-int duplex;
87 +-int fixbc;
88 +-int hidden;
89 +-int promisc;
90 +-int debug;
91 +-int verbose;
92 ++extern char iface[IFNAMSIZ];
93 ++extern char ethers_name[PATH_MAX];
94 ++extern char log_name[PATH_MAX];
95 ++extern char pid_name[PATH_MAX];
96 ++extern char fmac[18];
97 ++extern char pcapf[PCAPFSIZ];
98 ++extern char suser[MAXLOGNAME];
99 ++extern int ethers_update;
100 ++extern int fake_regen;
101 ++extern int fake_num;
102 ++extern int fake_time;
103 ++extern int buffer_num;
104 ++extern int addr_nosubst;
105 ++extern int nofirst;
106 ++extern int grant;
107 ++extern int read_only;
108 ++extern int duplex;
109 ++extern int fixbc;
110 ++extern int hidden;
111 ++extern int promisc;
112 ++extern int debug;
113 ++extern int verbose;
114 +
115 +-unsigned int all, good, grat, wgrat, zmac, zip, bad, bmac, bsip, btip,
116 ++extern unsigned int all, good, grat, wgrat, zmac, zip, bad, bmac, bsip, btip,
117 + bnew, bgrat, mymac, fake, pfake, nzh, nbe, mis;
118 +-char pfmac[18];
119 +-char s[128+1];
120 ++extern char pfmac[18];
121 ++extern char s[128+1];
122 +
123 + /* ethers.c
124 + */
125
126 diff --git a/net-analyzer/ipguard/files/ipguard-1.04-gentoo.patch b/net-analyzer/ipguard/files/ipguard-1.04-gentoo.patch
127 new file mode 100644
128 index 00000000000..7d66038581b
129 --- /dev/null
130 +++ b/net-analyzer/ipguard/files/ipguard-1.04-gentoo.patch
131 @@ -0,0 +1,50 @@
132 +--- a/Makefile
133 ++++ b/Makefile
134 +@@ -28,13 +28,13 @@
135 + STATIC=
136 + CC=gcc
137 +
138 +-CFLAGS+=-g -Wall -DETHERS='"$(ETHERS)"'
139 ++CFLAGS+=-Wall -DETHERS='"$(ETHERS)"'
140 +
141 + OBJS=ethers.o ipguard.o packet.o system.o
142 +
143 + .c.o:
144 + @echo Compiling $*.c
145 +- @$(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $<
146 ++ $(CC) -c $(CFLAGS) $(INCLUDES) $(DEFINES) $<
147 +
148 + all: start $(NAME)
149 +
150 +@@ -47,7 +47,7 @@
151 +
152 + $(NAME): $(OBJS)
153 + @echo Linking $@
154 +- @$(CC) -o $@ $(OBJS) $(LIBS) $(STATIC)
155 ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(STATIC)
156 +
157 + clean:
158 + @echo Cleaning OBJS
159 +@@ -58,16 +58,16 @@
160 + @rm -f $(NAME)
161 +
162 + install: all
163 +- mkdir -p -m 755 $(PREFIX)/sbin
164 +- install -s -m 755 $(NAME) $(PREFIX)/sbin/$(NAME)
165 +- mkdir -p -m 755 $(PREFIX)/man/man8
166 +- install -m 644 doc/$(NAME).8 $(PREFIX)/man/man8/$(NAME).8
167 ++ mkdir -p -m 755 ${D}$(PREFIX)/sbin
168 ++ install -m 755 $(NAME) ${D}$(PREFIX)/sbin/$(NAME)
169 ++ mkdir -p -m 755 ${D}$(PREFIX)/share/man/man8
170 ++ install -m 644 doc/$(NAME).8 ${D}$(PREFIX)/share/man/man8/$(NAME).8
171 +
172 + uninstall: deinstall
173 +
174 + deinstall:
175 +- rm -f $(PREFIX)/man/man8/$(NAME).8
176 +- rm -f $(PREFIX)/sbin/$(NAME)
177 ++ rm -f ${D}$(PREFIX)/share/man/man8/$(NAME).8
178 ++ rm -f ${D}$(PREFIX)/sbin/$(NAME)
179 +
180 + ethers.o: ipguard.h
181 + ipguard.o: ipguard.h
182
183 diff --git a/net-analyzer/ipguard/files/ipguard-1.04-init.d.patch b/net-analyzer/ipguard/files/ipguard-1.04-init.d.patch
184 new file mode 100644
185 index 00000000000..447d818bf96
186 --- /dev/null
187 +++ b/net-analyzer/ipguard/files/ipguard-1.04-init.d.patch
188 @@ -0,0 +1,36 @@
189 +--- a/doc/ipguard.gentoo
190 ++++ b/doc/ipguard.gentoo
191 +@@ -1,7 +1,7 @@
192 + #! /sbin/runscript
193 + ## $Id: ipguard.gentoo,v 1.5 2010/07/12 03:46:52 sead Exp $
194 +
195 +-opts="reload"
196 ++extra_commands="reload"
197 +
198 + depend() {
199 + use net
200 +@@ -9,20 +9,20 @@
201 +
202 + start() {
203 + ebegin "Starting ipguard"
204 +- start-stop-daemon --start --quiet --pidfile /var/run/ipguard.pid \
205 +- --exec /usr/sbin/ipguard -- -u 300 -xz
206 ++ start-stop-daemon --start --quiet --pidfile /run/ipguard.pid \
207 ++ --exec /usr/sbin/ipguard -- ${OPTS} ${IFACE}
208 + eend $?
209 + }
210 +
211 + stop() {
212 + ebegin "Stopping ipguard"
213 +- start-stop-daemon --stop --quiet --pidfile /var/run/ipguard.pid
214 ++ start-stop-daemon --stop --quiet --pidfile /run/ipguard.pid
215 + eend $?
216 + }
217 +
218 + reload() {
219 + ebegin "Reloading ipguard"
220 +- start-stop-daemon --stop --quiet --pidfile /var/run/ipguard.pid \
221 ++ start-stop-daemon --stop --quiet --pidfile /run/ipguard.pid \
222 + --signal HUP
223 + eend $?
224 + }
225
226 diff --git a/net-analyzer/ipguard/files/ipguard-1.04-runpath.patch b/net-analyzer/ipguard/files/ipguard-1.04-runpath.patch
227 new file mode 100644
228 index 00000000000..930f2cc84fd
229 --- /dev/null
230 +++ b/net-analyzer/ipguard/files/ipguard-1.04-runpath.patch
231 @@ -0,0 +1,11 @@
232 +--- a/ipguard.h
233 ++++ b/ipguard.h
234 +@@ -53,7 +53,7 @@
235 +
236 + #define ETHERSFILE ETHERS
237 + #define LOGNAME "/var/log/ipguard"
238 +-#define PIDNAME "/var/run/ipguard"
239 ++#define PIDNAME "/run/ipguard"
240 + #define FAKEMAC "de:ad:xx:xx:xx:xx"
241 + #define PCAPFSIZ 128
242 +
243
244 diff --git a/net-analyzer/ipguard/ipguard-1.04-r1.ebuild b/net-analyzer/ipguard/ipguard-1.04-r1.ebuild
245 index a30baf79b5e..73efd0b6872 100644
246 --- a/net-analyzer/ipguard/ipguard-1.04-r1.ebuild
247 +++ b/net-analyzer/ipguard/ipguard-1.04-r1.ebuild
248 @@ -19,27 +19,12 @@ DEPEND="
249 RDEPEND="
250 ${DEPEND}
251 "
252 -
253 -src_prepare() {
254 - default
255 -
256 - sed -i \
257 - -e 's|-g ||g' \
258 - -e 's| @$(CC)| $(CC)|g' \
259 - -e 's| -s | |g' \
260 - -e 's| -o | $(CFLAGS) $(LDFLAGS)&|g' \
261 - -e 's|$(PREFIX)|${D}&|g' \
262 - -e 's|/man/|/share&|g' \
263 - Makefile || die
264 - sed -i \
265 - -e 's|opts=|extra_commands=|g' \
266 - -e 's|/var/run/|/run/|g' \
267 - -e 's|-u 300 -xz|${OPTS} ${IFACE}|g' \
268 - doc/${PN}.gentoo || die
269 - sed -i \
270 - -e 's|/var/run/|/run/|g' \
271 - doc/${PN}.8 ${PN}.h || die
272 -}
273 +PATCHES=(
274 + "${FILESDIR}"/${P}-gentoo.patch
275 + "${FILESDIR}"/${P}-init.d.patch
276 + "${FILESDIR}"/${P}-runpath.patch
277 + "${FILESDIR}"/${P}-fno-common.patch
278 +)
279
280 src_compile() {
281 emake \