Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dialup/rp-pppoe/files/, net-dialup/rp-pppoe/
Date: Wed, 28 Nov 2018 12:16:12
Message-Id: 1543407355.6941c29b3715e56592141a6d59dbe355a529f8e5.polynomial-c@gentoo
1 commit: 6941c29b3715e56592141a6d59dbe355a529f8e5
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 28 12:13:58 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 28 12:15:55 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6941c29b
7
8 net-dialup/rp-pppoe: Bump to version 3.13
9
10 Added pppoe-server init script.
11 Thanks to Oleg Gawriloff <barzog <AT> telecom.by> for providing the script
12 and the config file.
13
14 Closes: https://bugs.gentoo.org/258515
15 Package-Manager: Portage-2.3.52, Repoman-2.3.12
16 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
17
18 net-dialup/rp-pppoe/Manifest | 1 +
19 net-dialup/rp-pppoe/files/pppoe-server.confd | 10 ++
20 net-dialup/rp-pppoe/files/pppoe-server.initd | 9 ++
21 .../rp-pppoe/files/rp-pppoe-3.13-autotools.patch | 110 ++++++++++++++++++++
22 .../files/rp-pppoe-3.13-linux-headers.patch | 25 +++++
23 net-dialup/rp-pppoe/rp-pppoe-3.13.ebuild | 111 +++++++++++++++++++++
24 6 files changed, 266 insertions(+)
25
26 diff --git a/net-dialup/rp-pppoe/Manifest b/net-dialup/rp-pppoe/Manifest
27 index ffdf948661e..1644caa4947 100644
28 --- a/net-dialup/rp-pppoe/Manifest
29 +++ b/net-dialup/rp-pppoe/Manifest
30 @@ -1,3 +1,4 @@
31 DIST ppp-2.4.7.tar.gz 688117 BLAKE2B e1c94ce31d98674536929d19e956e4013eb2b02c20c34e6184c0b99b50262ad1cd7fb6f4a1ed302872527a0c164af340e15ad1e2eaf191392c3f6ae2de21f5dd SHA512 e34ce24020af6a73e7a26c83c4f73a9c83fa455b7b363794dba27bf01f70368be06bff779777843949bd77f4bc9385d6ad455ea48bf8fff4e0d73cc8fef16ae2
32 DIST rp-pppoe-3.11.tar.gz 223234 BLAKE2B 48a733f2b454284934a123383c32484e5715f131dd45e78a1dd8844dc7e9da74a62f2d4e144b8d57e30652be6eefef480d88a7b61fade7312a47ea750ddcbcda SHA512 cb9579ad94f6b6cfd709e8061aacac0a007f1f58ffd50bd0603f5a2b612c0cf4831febdbfeee290b97932fd30f8ae7f707d532a291124c4aeae2333131d53905
33 DIST rp-pppoe-3.12.tar.gz 224125 BLAKE2B 27fe75e794624acaeb81806d67a6f4e5601a6b6a466100898ae3cccc8acb5f72ad9275fecd28735df1b01162ff0e60b74ad0373a24a60c7a5731b0744b86e019 SHA512 1b9e4c806fcbad1bc21f7b74a780ae98682b10a69d91fb08df6dbd1fff86f6271995ebded43f926f8249a17cdddb541edccbbb3ee28e1a2dc89173ad61cd3de1
34 +DIST rp-pppoe-3.13.tar.gz 224204 BLAKE2B 8ac3cd59c809f7f2e10fea580dfbda20fc99ae443851513cdc6d0ba8e8df848d7bd6f10d2b0ac6592bc4b48ee1945c299d3cbd73eb9dd6ddc23d0c1c39cd1b77 SHA512 e29ddc39252a0e71d509096e275f6f195f86a5871052dd558e8fb174d13086b1c601e6652f45619279a1eb2fbda96ba0ec85dea9edb27459af56ded4a52b5f36
35
36 diff --git a/net-dialup/rp-pppoe/files/pppoe-server.confd b/net-dialup/rp-pppoe/files/pppoe-server.confd
37 new file mode 100644
38 index 00000000000..bb5b2e9088d
39 --- /dev/null
40 +++ b/net-dialup/rp-pppoe/files/pppoe-server.confd
41 @@ -0,0 +1,10 @@
42 +#Multiple interfaces allowed. Example: PPPOE_INTERFACE="vlan10 -I vlan11 -I vlan12" and so on.
43 +#Multiple interfaces allowed. Example: PPPOE_INTERFACE="vlan10 -I vlan11 -I vlan12" and so on.
44 +
45 +#PPPOE_INTERFACE=<interface name>
46 +#AC_NAME=<AC Name>
47 +#SERVICE_NAME=<Service Name>
48 +#MAX_SESSIONS=<Max PPPoE Sessions>
49 +#MAX_SESESSION_PER_MAC=<Max PPPoE Sessions per MAC>
50 +#LOCAL_IP=<PPP Local IP Addr>
51 +#OTHER_OPTIONS="-p /etc/ppp/ip-pools"
52
53 diff --git a/net-dialup/rp-pppoe/files/pppoe-server.initd b/net-dialup/rp-pppoe/files/pppoe-server.initd
54 new file mode 100644
55 index 00000000000..39caee9d761
56 --- /dev/null
57 +++ b/net-dialup/rp-pppoe/files/pppoe-server.initd
58 @@ -0,0 +1,9 @@
59 +#!/sbin/openrc-run
60 +# Copyright 1999-2018 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License, v2 or later
62 +
63 +description="rp-pppoe server"
64 +pidfile="/run/pppoe-server.pid"
65 +command="/usr/sbin/pppoe-server"
66 +command_args="-I ${PPPOE_INTERFACE:-eth0} -C ${AC_NAME:-$(hostname)} -S ${SERVICE_NAME:-default} -N ${MAX_SESSIONS:-64} -x ${MAX_SESESSION_PER_MAC:-1} -L ${LOCAL_IP:-10.0.0.1.} -k -F ${OTHER_OPTIONS}"
67 +command_background="true"
68
69 diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.13-autotools.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.13-autotools.patch
70 new file mode 100644
71 index 00000000000..d098de8cdbc
72 --- /dev/null
73 +++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.13-autotools.patch
74 @@ -0,0 +1,110 @@
75 +--- rp-pppoe-3.13/gui/Makefile.in
76 ++++ rp-pppoe-3.13/gui/Makefile.in
77 +@@ -46,7 +46,7 @@
78 + -mkdir -p $(DESTDIR)$(sbindir)
79 + -mkdir -p $(DESTDIR)$(bindir)
80 + -mkdir -p $(DESTDIR)/etc/ppp/rp-pppoe-gui
81 +- $(install) -m 4755 -s pppoe-wrapper $(DESTDIR)$(sbindir)
82 ++ $(install) -m 4755 pppoe-wrapper $(DESTDIR)$(sbindir)
83 + $(install) -m 755 tkpppoe $(DESTDIR)$(bindir)
84 + -mkdir -p $(DESTDIR)$(mandir)/man1
85 + $(install) -m 644 pppoe-wrapper.1 $(DESTDIR)$(mandir)/man1
86 +--- rp-pppoe-3.13/src/configure.in
87 ++++ rp-pppoe-3.13/src/configure.in
88 +@@ -45,7 +45,7 @@
89 + AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
90 +
91 + if test "$ac_cv_struct_sockaddr_ll" = yes ; then
92 +-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
93 ++AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL, 1, [Define if you have struct sockaddr_ll])
94 + fi
95 +
96 + dnl Check for N_HDLC line discipline
97 +@@ -58,7 +58,7 @@
98 + ac_cv_n_hdlc=no)
99 + AC_MSG_RESULT($ac_cv_n_hdlc)
100 + if test "$ac_cv_n_hdlc" = yes ; then
101 +-AC_DEFINE(HAVE_N_HDLC)
102 ++AC_DEFINE(HAVE_N_HDLC, 1, [Define if you have the N_HDLC line discipline in linux/termios.h])
103 + fi
104 +
105 + AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
106 +@@ -106,7 +106,7 @@
107 + if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
108 + if test "$ac_cv_pluginpath" != no ; then
109 + LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
110 +- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
111 ++ AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE, 1, [Define if you have kernel-mode PPPoE in Linux file])
112 + PPPD_INCDIR=$ac_cv_pluginpath
113 + fi
114 + fi
115 +@@ -116,7 +116,7 @@
116 + fi
117 +
118 + if test "$ac_cv_debugging" = "yes" ; then
119 +- AC_DEFINE(DEBUGGING_ENABLED)
120 ++ AC_DEFINE(DEBUGGING_ENABLED, 1, [Define to include debugging code])
121 + fi
122 +
123 + AC_SUBST(LINUX_KERNELMODE_PLUGIN)
124 +@@ -156,15 +156,15 @@
125 + AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support)
126 + AC_CACHE_VAL(ac_cv_linux_kernel_pppoe,[
127 + if test "`uname -s`" = "Linux" ; then
128 +-if test $cross_compiling = "no"; then
129 ++dnl if test $cross_compiling = "no"; then
130 +
131 + dnl Do a bunch of modprobes. Can't hurt; might help.
132 +-modprobe ppp_generic > /dev/null 2>&1
133 +-modprobe ppp_async > /dev/null 2>&1
134 +-modprobe n_hdlc > /dev/null 2>&1
135 +-modprobe ppp_synctty > /dev/null 2>&1
136 +-modprobe pppoe > /dev/null 2>&1
137 +-fi
138 ++dnl modprobe ppp_generic > /dev/null 2>&1
139 ++dnl modprobe ppp_async > /dev/null 2>&1
140 ++dnl modprobe n_hdlc > /dev/null 2>&1
141 ++dnl modprobe ppp_synctty > /dev/null 2>&1
142 ++dnl modprobe pppoe > /dev/null 2>&1
143 ++dnl fi
144 + AC_TRY_RUN([#include <sys/socket.h>
145 + #include <netinet/in.h>
146 + #include <linux/if_pppox.h>
147 +@@ -204,7 +204,7 @@
148 + dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than
149 + dnl 2.3.7 -- stop
150 +
151 +-PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'`
152 ++PPPD_VERSION=$PPPD_VER
153 +
154 + case "$PPPD_VERSION" in
155 + 1.*|2.0.*|2.1.*|2.2.*|2.3.0|2.3.1|2.3.2|2.3.3|2.3.4|2.3.5|2.3.6)
156 +@@ -260,7 +260,7 @@
157 +
158 + if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
159 + AC_MSG_RESULT(reversed)
160 +- AC_DEFINE(PACK_BITFIELDS_REVERSED)
161 ++ AC_DEFINE(PACK_BITFIELDS_REVERSED, 1, [Define if bitfields are packed in reverse order])
162 + else
163 + AC_MSG_RESULT(normal)
164 + fi
165 +--- rp-pppoe-3.13/src/plugin.c
166 ++++ rp-pppoe-3.13/src/plugin.c
167 +@@ -24,7 +24,6 @@
168 + *
169 + ***********************************************************************/
170 +
171 +-#define _GNU_SOURCE 1
172 + #include "pppoe.h"
173 +
174 + #include "pppd/pppd.h"
175 +--- rp-pppoe-3.13/src/relay.c
176 ++++ rp-pppoe-3.13/src/relay.c
177 +@@ -14,7 +14,6 @@
178 + * $Id$
179 + *
180 + ***********************************************************************/
181 +-#define _GNU_SOURCE 1 /* For SA_RESTART */
182 + #include "config.h"
183 +
184 + #include <sys/socket.h>
185
186 diff --git a/net-dialup/rp-pppoe/files/rp-pppoe-3.13-linux-headers.patch b/net-dialup/rp-pppoe/files/rp-pppoe-3.13-linux-headers.patch
187 new file mode 100644
188 index 00000000000..1ee989dce87
189 --- /dev/null
190 +++ b/net-dialup/rp-pppoe/files/rp-pppoe-3.13-linux-headers.patch
191 @@ -0,0 +1,25 @@
192 +the linux headers have started adding shims to not define types or structs
193 +when C lib headers are active, but in order to work, the C lib headers have
194 +to be included before the linux headers.
195 +
196 +move the netinet/in.h include up above the linux/ includes.
197 +
198 +Mike Frysinger <vapier@g.o>
199 +
200 +--- rp-pppoe-3.13/src/pppoe.h
201 ++++ rp-pppoe-3.13/src/pppoe.h
202 +@@ -120,12 +120,12 @@
203 + #error Could not find a 32-bit integer type
204 + #endif
205 +
206 ++#include <netinet/in.h>
207 ++
208 + #ifdef HAVE_LINUX_IF_ETHER_H
209 + #include <linux/if_ether.h>
210 + #endif
211 +
212 +-#include <netinet/in.h>
213 +-
214 + #ifdef HAVE_NETINET_IF_ETHER_H
215 + #include <sys/types.h>
216 +
217
218 diff --git a/net-dialup/rp-pppoe/rp-pppoe-3.13.ebuild b/net-dialup/rp-pppoe/rp-pppoe-3.13.ebuild
219 new file mode 100644
220 index 00000000000..5a62bbd8569
221 --- /dev/null
222 +++ b/net-dialup/rp-pppoe/rp-pppoe-3.13.ebuild
223 @@ -0,0 +1,111 @@
224 +# Copyright 1999-2018 Gentoo Authors
225 +# Distributed under the terms of the GNU General Public License v2
226 +
227 +EAPI=7
228 +
229 +inherit autotools flag-o-matic readme.gentoo-r1
230 +
231 +PPP_P="ppp-2.4.7"
232 +
233 +DESCRIPTION="A user-mode PPPoE client and server suite for Linux"
234 +HOMEPAGE="https://www.roaringpenguin.com/products/pppoe"
235 +SRC_URI="https://dianne.skoll.ca/projects/rp-pppoe/download/${P}.tar.gz
236 + https://www.samba.org/ftp/pub/ppp/${PPP_P}.tar.gz"
237 +
238 +LICENSE="GPL-2"
239 +SLOT="0"
240 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
241 +IUSE="tk"
242 +
243 +RDEPEND="
244 + net-dialup/ppp:=
245 + tk? ( dev-lang/tk:= )
246 +"
247 +DEPEND=">=sys-kernel/linux-headers-2.6.25
248 + ${RDEPEND}"
249 +
250 +DOC_CONTENTS="Use pppoe-setup to configure your dialup connection"
251 +
252 +pkg_setup() {
253 + # This is needed in multiple phases
254 + PPPD_VER=$(best_version net-dialup/ppp)
255 + PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
256 + PPPD_VER=${PPPD_VER%%-*} #reduce it to ${PV}
257 +}
258 +
259 +PATCHES=(
260 + # Patch to enable integration of pppoe-start and pppoe-stop with
261 + # baselayout-1.11.x so that the pidfile can be found reliably per interface
262 + "${FILESDIR}/${PN}-3.10-gentoo-netscripts.patch"
263 +
264 + "${FILESDIR}/${PN}-3.10-username-charset.patch" # bug 82410
265 + "${FILESDIR}/${PN}-3.10-plugin-options.patch"
266 + "${FILESDIR}/${PN}-3.13-autotools.patch"
267 + "${FILESDIR}/${PN}-3.10-posix-source-sigaction.patch"
268 + "${FILESDIR}/${PN}-3.11-gentoo.patch"
269 + "${FILESDIR}/${PN}-3.11-kmode.patch" #364941
270 + "${FILESDIR}/${PN}-3.13-linux-headers.patch"
271 + "${FILESDIR}/${PN}-3.12-ifconfig-path.patch" #602344
272 +)
273 +
274 +src_prepare() {
275 + if has_version '<sys-kernel/linux-headers-2.6.35' ; then
276 + PATCHES+=(
277 + "${FILESDIR}/${PN}-3.10-linux-headers.patch" #334197
278 + )
279 + fi
280 +
281 + default
282 +
283 + cd "${S}"/src || die
284 + eautoreconf
285 +}
286 +
287 +src_configure() {
288 + addpredict /dev/ppp
289 +
290 + cd "${S}/src" || die
291 + # PPPD_VER variable is required for correct pppd detection
292 + # This was added through the rp-pppoe-*-autotools.patch
293 + econf PPPD_VER="${PPPD_VER}" --enable-plugin=../../ppp-${PPPD_VER}
294 +}
295 +
296 +src_compile() {
297 + cd "${S}/src" || die
298 + emake
299 +
300 + if use tk; then
301 + emake -C "${S}/gui" || die "gui make failed"
302 + fi
303 +}
304 +
305 +src_install () {
306 + cd "${S}/src" || die
307 + emake DESTDIR="${D}" install #docdir=/usr/share/doc/${PF} install
308 +
309 + #Don't use compiled rp-pppoe plugin - see pkg_preinst below
310 + local pppoe_plugin="${ED%/}/etc/ppp/plugins/rp-pppoe.so"
311 + if [ -f "${pppoe_plugin}" ] ; then
312 + rm "${pppoe_plugin}" || die
313 + fi
314 +
315 + if use tk; then
316 + emake -C "${S}/gui" \
317 + DESTDIR="${D}" \
318 + datadir=/usr/share/doc/${PF}/ \
319 + install
320 + dosym doc/${PF}/tkpppoe /usr/share/tkpppoe
321 + fi
322 +
323 + newinitd "${FILESDIR}"/pppoe-server.initd pppoe-server
324 + newconfd "${FILESDIR}"/pppoe-server.confd pppoe-server
325 +
326 + readme.gentoo_create_doc
327 +}
328 +
329 +pkg_preinst() {
330 + # Use the rp-pppoe plugin that comes with net-dialup/pppd
331 + if [ -n "${PPPD_VER}" ] && [ -f "${EROOT%/}/usr/lib/pppd/${PPPD_VER}/rp-pppoe.so" ] ; then
332 + dosym ../../../usr/lib/pppd/${PPPD_VER}/rp-pppoe.so /etc/ppp/plugins/rp-pppoe.so
333 + fi
334 +}