Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dialup/ppp/files/, net-dialup/ppp/
Date: Wed, 18 May 2022 03:05:06
Message-Id: 1652843065.868a874d9e6cb7f604cf6400f75da559a971a339.sam@gentoo
1 commit: 868a874d9e6cb7f604cf6400f75da559a971a339
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 18 03:04:25 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed May 18 03:04:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=868a874d
7
8 net-dialup/ppp: fix build with clang
9
10 Revbump as the nested functions bit can/will affect codegen (trampolines...).
11
12 Closes: https://bugs.gentoo.org/831305
13 Thanks-to: Leonardo Neumann <leonardo <AT> neumann.dev.br>
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 .../ppp-2.4.9-fix-clang-nested-functions.patch | 65 ++++++
17 .../ppp-2.4.9-fix-openssl-sysroot-clang.patch | 14 ++
18 net-dialup/ppp/ppp-2.4.9-r8.ebuild | 256 +++++++++++++++++++++
19 3 files changed, 335 insertions(+)
20
21 diff --git a/net-dialup/ppp/files/ppp-2.4.9-fix-clang-nested-functions.patch b/net-dialup/ppp/files/ppp-2.4.9-fix-clang-nested-functions.patch
22 new file mode 100644
23 index 000000000000..0a089e95430d
24 --- /dev/null
25 +++ b/net-dialup/ppp/files/ppp-2.4.9-fix-clang-nested-functions.patch
26 @@ -0,0 +1,65 @@
27 +https://github.com/ppp-project/ppp/commit/6e6a48fe628b76ec368277fd52685428e3dc8766
28 +https://bugs.gentoo.org/831305
29 +
30 +From: =?UTF-8?q?Eivind=20N=C3=A6ss?= <eivnaes@×××××.com>
31 +Date: Sun, 11 Jul 2021 14:36:44 -0700
32 +Subject: [PATCH] Compiling with clang encounters an error in eap-tls.c
33 +MIME-Version: 1.0
34 +Content-Type: text/plain; charset=UTF-8
35 +Content-Transfer-Encoding: 8bit
36 +
37 +This moves the inline functions to outside the function and declares them static.
38 +
39 +Signed-off-by: Eivind Næss <eivnaes@×××××.com>
40 +--- a/pppd/eap-tls.c
41 ++++ b/pppd/eap-tls.c
42 +@@ -285,6 +285,23 @@ ENGINE *eaptls_ssl_load_engine( char *engine_name )
43 + #endif
44 +
45 +
46 ++#ifndef OPENSSL_NO_ENGINE
47 ++static int eaptls_UI_writer(UI *ui, UI_STRING *uis)
48 ++{
49 ++ PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui);
50 ++ UI_set_result(ui, uis, cb_data->password);
51 ++ return 1;
52 ++}
53 ++
54 ++static int eaptls_UI_stub(UI* ui) {
55 ++ return 1;
56 ++}
57 ++
58 ++static int eaptls_UI_reader(UI *ui, UI_STRING *uis) {
59 ++ return 1;
60 ++}
61 ++#endif
62 ++
63 + /*
64 + * Initialize the SSL stacks and tests if certificates, key and crl
65 + * for client or server use can be loaded.
66 +@@ -578,20 +595,11 @@ SSL_CTX *eaptls_init_ssl(int init_server, char *cacertfile, char *capath,
67 + {
68 + UI_METHOD* transfer_pin = UI_create_method("transfer_pin");
69 +
70 +- int writer (UI *ui, UI_STRING *uis)
71 +- {
72 +- PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui);
73 +- UI_set_result(ui, uis, cb_data->password);
74 +- return 1;
75 +- };
76 +- int stub (UI* ui) {return 1;};
77 +- int stub_reader (UI *ui, UI_STRING *uis) {return 1;};
78 +-
79 +- UI_method_set_writer(transfer_pin, writer);
80 +- UI_method_set_opener(transfer_pin, stub);
81 +- UI_method_set_closer(transfer_pin, stub);
82 +- UI_method_set_flusher(transfer_pin, stub);
83 +- UI_method_set_reader(transfer_pin, stub_reader);
84 ++ UI_method_set_writer(transfer_pin, eaptls_UI_writer);
85 ++ UI_method_set_opener(transfer_pin, eaptls_UI_stub);
86 ++ UI_method_set_closer(transfer_pin, eaptls_UI_stub);
87 ++ UI_method_set_flusher(transfer_pin, eaptls_UI_stub);
88 ++ UI_method_set_reader(transfer_pin, eaptls_UI_reader);
89 +
90 + dbglog( "Using our private key URI: '%s' in engine", privkeyfile );
91 + pkey = ENGINE_load_private_key(pkey_engine, privkeyfile, transfer_pin, &cb_data);
92
93 diff --git a/net-dialup/ppp/files/ppp-2.4.9-fix-openssl-sysroot-clang.patch b/net-dialup/ppp/files/ppp-2.4.9-fix-openssl-sysroot-clang.patch
94 new file mode 100644
95 index 000000000000..2bf8c45e9027
96 --- /dev/null
97 +++ b/net-dialup/ppp/files/ppp-2.4.9-fix-openssl-sysroot-clang.patch
98 @@ -0,0 +1,14 @@
99 +https://bugs.gentoo.org/831305
100 +
101 +Upstream git has merged autotoolsification PR so no need for this.
102 +--- a/pppd/Makefile.linux
103 ++++ b/pppd/Makefile.linux
104 +@@ -155,7 +155,7 @@ endif
105 +
106 + ifdef NEEDDES
107 + ifndef USE_CRYPT
108 +-CFLAGS += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
109 ++CFLAGS += -I$(INSTROOT)/usr/include/openssl
110 + NEEDCRYPTOLIB = y
111 + else
112 + CFLAGS += -DUSE_CRYPT=1
113
114 diff --git a/net-dialup/ppp/ppp-2.4.9-r8.ebuild b/net-dialup/ppp/ppp-2.4.9-r8.ebuild
115 new file mode 100644
116 index 000000000000..0c8abaf35c41
117 --- /dev/null
118 +++ b/net-dialup/ppp/ppp-2.4.9-r8.ebuild
119 @@ -0,0 +1,256 @@
120 +# Copyright 1999-2022 Gentoo Authors
121 +# Distributed under the terms of the GNU General Public License v2
122 +
123 +EAPI=7
124 +
125 +inherit linux-info pam toolchain-funcs
126 +
127 +PATCH_TARBALL_NAME="${PN}-2.4.9-patches-03"
128 +DESCRIPTION="Point-to-Point Protocol (PPP)"
129 +HOMEPAGE="https://ppp.samba.org/"
130 +SRC_URI="https://github.com/paulusmack/ppp/archive/${P}.tar.gz
131 + https://dev.gentoo.org/~polynomial-c/${PATCH_TARBALL_NAME}.tar.xz
132 + http://www.netservers.net.uk/gpl/ppp-dhcpc.tgz"
133 +
134 +LICENSE="BSD GPL-2"
135 +SLOT="0/${PV}"
136 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
137 +IUSE="activefilter atm dhcp +eap-tls gtk ipv6 pam radius systemd"
138 +
139 +DEPEND="
140 + dev-libs/openssl:0=
141 + virtual/libcrypt:=
142 + activefilter? ( net-libs/libpcap )
143 + atm? ( net-dialup/linux-atm )
144 + gtk? ( x11-libs/gtk+:2 )
145 + pam? ( sys-libs/pam )
146 + systemd? ( sys-apps/systemd )
147 +"
148 +RDEPEND="${DEPEND}
149 + !<net-misc/netifrc-0.7.1-r2"
150 +BDEPEND="virtual/pkgconfig"
151 +PDEPEND="net-dialup/ppp-scripts"
152 +
153 +S="${WORKDIR}/${PN}-${P}"
154 +
155 +src_prepare() {
156 + mv "${WORKDIR}/dhcp" "${S}/pppd/plugins" || die
157 +
158 + eapply "${WORKDIR}"/patches
159 + eapply "${FILESDIR}"/${P}-fix-MPPE-sstpc.patch
160 + eapply "${FILESDIR}"/${P}-fix-clang-nested-functions.patch
161 + eapply "${FILESDIR}"/${P}-fix-openssl-sysroot-clang.patch
162 +
163 + #IPX Support is removed in kernel >= 5.15
164 + sed -i 's/-DIPX_CHANGE //' pppd/Makefile.linux || die
165 +
166 + if use atm ; then
167 + einfo "Enabling PPPoATM support"
168 + sed -i '/^#HAVE_LIBATM=yes/s:#::' \
169 + pppd/plugins/pppoatm/Makefile.linux || die
170 + fi
171 +
172 + if ! use activefilter ; then
173 + einfo "Disabling active filter"
174 + sed -i '/^FILTER=y/s:^:#:' pppd/Makefile.linux || die
175 + fi
176 +
177 + if use pam ; then
178 + einfo "Enabling PAM"
179 + sed -i '/^#USE_PAM=y/s:^#::' pppd/Makefile.linux || die
180 + fi
181 +
182 + if ! use ipv6 ; then
183 + einfo "Disabling IPv6"
184 + sed -i '/^HAVE_INET6/s:^:#:' pppd/Makefile.linux || die
185 + else
186 + echo "+ipv6" >> etc.ppp/options || die
187 + fi
188 +
189 + einfo "Enabling CBCP"
190 + sed -i '/^#CBCP=y/s:#::' pppd/Makefile.linux || die
191 +
192 + if use dhcp ; then
193 + einfo "Adding ppp-dhcp plugin files"
194 + sed \
195 + -e '/^SUBDIRS :=/s:$: dhcp:' \
196 + -i pppd/plugins/Makefile.linux || die
197 + fi
198 +
199 + if ! use eap-tls ; then
200 + einfo "Disabling EAP-TLS pppd auth support"
201 + sed -i '/^USE_EAPTLS=y/s:^:#:' pppd/Makefile.linux || die
202 + einfo "Disabling EAP-TLS plugin support"
203 + sed -i '/^CFLAGS += -DUSE_EAPTLS=1/s:^:#:' \
204 + pppd/plugins/Makefile.linux || die
205 + fi
206 +
207 + # Set correct libdir
208 + sed -i -e "s:/lib/pppd:/$(get_libdir)/pppd:" \
209 + pppd/{pathnames.h,pppd.8} || die
210 +
211 + if use radius ; then
212 + # Set the right paths in radiusclient.conf
213 + sed -e "s:/usr/local/etc:/etc:" \
214 + -e "s:/usr/local/sbin:/usr/sbin:" \
215 + -i pppd/plugins/radius/etc/radiusclient.conf || die
216 + # Set config dir to /etc/ppp/radius
217 + sed -i -e "s:/etc/radiusclient:/etc/ppp/radius:g" \
218 + pppd/plugins/radius/{*.8,*.c,*.h} \
219 + pppd/plugins/radius/etc/* || die
220 + else
221 + einfo "Disabling radius"
222 + sed -i -e '/+= radius/s:^:#:' pppd/plugins/Makefile.linux || die
223 + fi
224 +
225 + if use systemd ; then
226 + einfo "Enabling systemd notification"
227 + sed '/SYSTEMD=/s@^#@@' -i pppd/Makefile.linux || die
228 + fi
229 +
230 + # Respect our pkg-config settings.
231 + sed -i \
232 + -e 's:pkg-config:$(PKG_CONFIG):' \
233 + contrib/pppgetpass/Makefile.linux || die
234 + sed -i \
235 + -e '/^LIBS/{s:-L/usr/local/ssl/lib::;s:-lcrypto:`$(PKG_CONFIG) --libs libcrypto`:}' \
236 + pppd/Makefile.linux || die
237 +
238 + eapply_user #549588
239 +}
240 +
241 +src_compile() {
242 + tc-export AR CC PKG_CONFIG
243 + emake CC="${CC}" COPTS="${CFLAGS} -D_GNU_SOURCE"
244 +
245 + # build pppgetpass
246 + cd contrib/pppgetpass || die
247 + if use gtk ; then
248 + emake -f Makefile.linux
249 + else
250 + emake pppgetpass.vt
251 + fi
252 +}
253 +
254 +src_install() {
255 + local i
256 + for i in chat pppd pppdump pppstats ; do
257 + doman ${i}/${i}.8
258 + dosbin ${i}/${i}
259 + done
260 + fperms u+s-w /usr/sbin/pppd
261 +
262 + # Install pppd header files
263 + emake -C pppd INSTROOT="${D}" install-devel
264 +
265 + dosbin pppd/plugins/pppoe/pppoe-discovery
266 +
267 + dodir /etc/ppp/peers
268 + insinto /etc/ppp
269 + insopts -m0600
270 + newins etc.ppp/pap-secrets pap-secrets.example
271 + newins etc.ppp/chap-secrets chap-secrets.example
272 +
273 + insopts -m0644
274 + doins etc.ppp/options
275 +
276 + if use pam; then
277 + pamd_mimic_system ppp auth account session
278 + fi
279 +
280 + local PLUGINS_DIR="/usr/$(get_libdir)/pppd/${PV}"
281 + insinto "${PLUGINS_DIR}"
282 + insopts -m0755
283 + doins pppd/plugins/minconn.so
284 + doins pppd/plugins/passprompt.so
285 + doins pppd/plugins/passwordfd.so
286 + doins pppd/plugins/winbind.so
287 + doins pppd/plugins/pppoe/pppoe.so
288 + doins pppd/plugins/pppol2tp/openl2tp.so
289 + doins pppd/plugins/pppol2tp/pppol2tp.so
290 + if use atm ; then
291 + doins pppd/plugins/pppoatm/pppoatm.so
292 + fi
293 + if use dhcp ; then
294 + doins pppd/plugins/dhcp/dhcpc.so
295 + fi
296 + if use radius ; then
297 + doins pppd/plugins/radius/rad{ius,attr,realms}.so
298 +
299 + #Copy radiusclient configuration files (#92878)
300 + insinto /etc/ppp/radius
301 + insopts -m0644
302 + doins pppd/plugins/radius/etc/{dictionary*,issue,port-id-map,radiusclient.conf,realms,servers}
303 +
304 + doman pppd/plugins/radius/pppd-rad{ius,attr}.8
305 + fi
306 +
307 + insinto /etc/modprobe.d
308 + insopts -m0644
309 + newins "${FILESDIR}/modules.ppp" ppp.conf
310 +
311 + dodoc PLUGINS README* SETUP Changes-2.3 FAQ
312 + dodoc "${FILESDIR}/README.mpls"
313 +
314 + dosbin scripts/p{on,off,log}
315 + doman scripts/pon.1
316 +
317 + # Adding misc. specialized scripts to doc dir
318 + dodoc -r scripts
319 + docinto scripts
320 + dodoc -r scripts/chatchat
321 +
322 + if use gtk ; then
323 + dosbin contrib/pppgetpass/{pppgetpass.vt,pppgetpass.gtk}
324 + newsbin contrib/pppgetpass/pppgetpass.sh pppgetpass
325 + else
326 + newsbin contrib/pppgetpass/pppgetpass.vt pppgetpass
327 + fi
328 + doman contrib/pppgetpass/pppgetpass.8
329 +}
330 +
331 +pkg_postinst() {
332 + if linux-info_get_any_version && linux_config_src_exists ; then
333 + echo
334 + ewarn "If the following test report contains a missing kernel configuration option that you need,"
335 + ewarn "you should reconfigure and rebuild your kernel before running pppd."
336 + CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY"
337 + local ERROR_PPP="CONFIG_PPP:\t missing PPP support (REQUIRED)"
338 + local ERROR_PPP_ASYNC="CONFIG_PPP_ASYNC:\t missing asynchronous serial line discipline (optional, but highly recommended)"
339 + local WARNING_PPP_SYNC_TTY="CONFIG_PPP_SYNC_TTY:\t missing synchronous serial line discipline (optional; used by 'sync' pppd option)"
340 + if use activefilter ; then
341 + CONFIG_CHECK="${CONFIG_CHECK} ~PPP_FILTER"
342 + local ERROR_PPP_FILTER="CONFIG_PPP_FILTER:\t missing PPP filtering support (REQUIRED)"
343 + fi
344 + CONFIG_CHECK="${CONFIG_CHECK} ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE"
345 + local ERROR_PPP_DEFLATE="CONFIG_PPP_DEFLATE:\t missing Deflate compression (optional, but highly recommended)"
346 + local ERROR_PPP_BSDCOMP="CONFIG_PPP_BSDCOMP:\t missing BSD-Compress compression (optional, but highly recommended)"
347 + local WARNING_PPP_MPPE="CONFIG_PPP_MPPE:\t missing MPPE encryption (optional, mostly used by PPTP links)"
348 + CONFIG_CHECK="${CONFIG_CHECK} ~PPPOE ~PACKET"
349 + local WARNING_PPPOE="CONFIG_PPPOE:\t missing PPPoE support (optional, needed by pppoe plugin)"
350 + local WARNING_PACKET="CONFIG_PACKET:\t missing AF_PACKET support (optional, used by pppoe and dhcpc plugins)"
351 + if use atm ; then
352 + CONFIG_CHECK="${CONFIG_CHECK} ~PPPOATM"
353 + local WARNING_PPPOATM="CONFIG_PPPOATM:\t missing PPPoA support (optional, needed by pppoatm plugin)"
354 + fi
355 + check_extra_config
356 + fi
357 +
358 + # create *-secrets files if not exists
359 + [[ -f "${EROOT}/etc/ppp/pap-secrets" ]] || \
360 + cp -pP "${EROOT}/etc/ppp/pap-secrets.example" "${EROOT}/etc/ppp/pap-secrets"
361 + [[ -f "${EROOT}/etc/ppp/chap-secrets" ]] || \
362 + cp -pP "${EROOT}/etc/ppp/chap-secrets.example" "${EROOT}/etc/ppp/chap-secrets"
363 +
364 + # lib name has changed
365 + sed -i -e "s:^rp-\(pppoe.so\):\1:" "${EROOT}/etc/ppp/options" || die
366 +
367 + echo
368 + elog "Pon, poff and plog scripts have been supplied for experienced users."
369 + elog "Users needing particular scripts (ssh,rsh,etc.) should check out the"
370 + elog "/usr/share/doc/${PF}/scripts directory."
371 +
372 + if [[ -n ${REPLACING_VERSIONS} ]] ; then
373 + ewarn '"rp-pppoe.so" plugin has been renamed to "pppoe.so"'
374 + fi
375 +}