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/ppp/
Date: Fri, 27 Aug 2021 12:13:21
Message-Id: 1630066390.62e75843d667106005d59275a569af6a7ae2b294.polynomial-c@gentoo
1 commit: 62e75843d667106005d59275a569af6a7ae2b294
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 27 12:02:06 2021 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 27 12:13:10 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62e75843
7
8 net-dialup/ppp: Revbump to implement systemd notification
9
10 Thanks-to: Steven Davies <gentoo-bugzilla2 <AT> steev.me.uk>
11 Closes: https://bugs.gentoo.org/810652
12 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
13
14 net-dialup/ppp/ppp-2.4.9-r5.ebuild | 251 +++++++++++++++++++++++++++++++++++++
15 1 file changed, 251 insertions(+)
16
17 diff --git a/net-dialup/ppp/ppp-2.4.9-r5.ebuild b/net-dialup/ppp/ppp-2.4.9-r5.ebuild
18 new file mode 100644
19 index 00000000000..092ae4b58bc
20 --- /dev/null
21 +++ b/net-dialup/ppp/ppp-2.4.9-r5.ebuild
22 @@ -0,0 +1,251 @@
23 +# Copyright 1999-2021 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit linux-info pam toolchain-funcs
29 +
30 +PATCH_TARBALL_NAME="${PN}-2.4.9-patches-03"
31 +DESCRIPTION="Point-to-Point Protocol (PPP)"
32 +HOMEPAGE="https://ppp.samba.org/"
33 +SRC_URI="https://github.com/paulusmack/ppp/archive/${P}.tar.gz
34 + https://dev.gentoo.org/~polynomial-c/${PATCH_TARBALL_NAME}.tar.xz
35 + http://www.netservers.net.uk/gpl/ppp-dhcpc.tgz"
36 +
37 +LICENSE="BSD GPL-2"
38 +SLOT="0/${PV}"
39 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
40 +IUSE="activefilter atm dhcp +eap-tls gtk ipv6 pam radius systemd"
41 +
42 +DEPEND="
43 + dev-libs/openssl:0=
44 + virtual/libcrypt:=
45 + activefilter? ( net-libs/libpcap )
46 + atm? ( net-dialup/linux-atm )
47 + gtk? ( x11-libs/gtk+:2 )
48 + pam? ( sys-libs/pam )
49 + systemd? ( sys-apps/systemd )
50 +"
51 +RDEPEND="${DEPEND}
52 + !<net-misc/netifrc-0.7.1-r2"
53 +BDEPEND="virtual/pkgconfig"
54 +PDEPEND="net-dialup/ppp-scripts"
55 +
56 +S="${WORKDIR}/${PN}-${P}"
57 +
58 +src_prepare() {
59 + mv "${WORKDIR}/dhcp" "${S}/pppd/plugins" || die
60 +
61 + eapply "${WORKDIR}"/patches
62 +
63 + if use atm ; then
64 + einfo "Enabling PPPoATM support"
65 + sed -i '/^#HAVE_LIBATM=yes/s:#::' \
66 + pppd/plugins/pppoatm/Makefile.linux || die
67 + fi
68 +
69 + if ! use activefilter ; then
70 + einfo "Disabling active filter"
71 + sed -i '/^FILTER=y/s:^:#:' pppd/Makefile.linux || die
72 + fi
73 +
74 + if use pam ; then
75 + einfo "Enabling PAM"
76 + sed -i '/^#USE_PAM=y/s:^#::' pppd/Makefile.linux || die
77 + fi
78 +
79 + if ! use ipv6 ; then
80 + einfo "Disabling IPv6"
81 + sed -i '/^HAVE_INET6/s:^:#:' pppd/Makefile.linux || die
82 + else
83 + echo "+ipv6" >> etc.ppp/options || die
84 + fi
85 +
86 + einfo "Enabling CBCP"
87 + sed -i '/^#CBCP=y/s:#::' pppd/Makefile.linux || die
88 +
89 + if use dhcp ; then
90 + einfo "Adding ppp-dhcp plugin files"
91 + sed \
92 + -e '/^SUBDIRS :=/s:$: dhcp:' \
93 + -i pppd/plugins/Makefile.linux || die
94 + fi
95 +
96 + if ! use eap-tls ; then
97 + einfo "Disabling EAP-TLS pppd auth support"
98 + sed -i '/^USE_EAPTLS=y/s:^:#:' pppd/Makefile.linux || die
99 + einfo "Disabling EAP-TLS plugin support"
100 + sed -i '/^CFLAGS += -DUSE_EAPTLS=1/s:^:#:' \
101 + pppd/plugins/Makefile.linux || die
102 + fi
103 +
104 + # Set correct libdir
105 + sed -i -e "s:/lib/pppd:/$(get_libdir)/pppd:" \
106 + pppd/{pathnames.h,pppd.8} || die
107 +
108 + if use radius ; then
109 + # Set the right paths in radiusclient.conf
110 + sed -e "s:/usr/local/etc:/etc:" \
111 + -e "s:/usr/local/sbin:/usr/sbin:" \
112 + -i pppd/plugins/radius/etc/radiusclient.conf || die
113 + # Set config dir to /etc/ppp/radius
114 + sed -i -e "s:/etc/radiusclient:/etc/ppp/radius:g" \
115 + pppd/plugins/radius/{*.8,*.c,*.h} \
116 + pppd/plugins/radius/etc/* || die
117 + else
118 + einfo "Disabling radius"
119 + sed -i -e '/+= radius/s:^:#:' pppd/plugins/Makefile.linux || die
120 + fi
121 +
122 + if use systemd ; then
123 + einfo "Enabling systemd notification"
124 + sed '/SYSTEMD=/s@^#@@' -i pppd/Makefile.linux \
125 + die
126 + fi
127 +
128 + # Respect our pkg-config settings.
129 + sed -i \
130 + -e 's:pkg-config:$(PKG_CONFIG):' \
131 + contrib/pppgetpass/Makefile.linux || die
132 + sed -i \
133 + -e '/^LIBS/{s:-L/usr/local/ssl/lib::;s:-lcrypto:`$(PKG_CONFIG) --libs libcrypto`:}' \
134 + pppd/Makefile.linux || die
135 +
136 + eapply_user #549588
137 +}
138 +
139 +src_compile() {
140 + tc-export AR CC PKG_CONFIG
141 + emake CC="${CC}" COPTS="${CFLAGS} -D_GNU_SOURCE"
142 +
143 + # build pppgetpass
144 + cd contrib/pppgetpass || die
145 + if use gtk ; then
146 + emake -f Makefile.linux
147 + else
148 + emake pppgetpass.vt
149 + fi
150 +}
151 +
152 +src_install() {
153 + local i
154 + for i in chat pppd pppdump pppstats ; do
155 + doman ${i}/${i}.8
156 + dosbin ${i}/${i}
157 + done
158 + fperms u+s-w /usr/sbin/pppd
159 +
160 + # Install pppd header files
161 + emake -C pppd INSTROOT="${D}" install-devel
162 +
163 + dosbin pppd/plugins/pppoe/pppoe-discovery
164 +
165 + dodir /etc/ppp/peers
166 + insinto /etc/ppp
167 + insopts -m0600
168 + newins etc.ppp/pap-secrets pap-secrets.example
169 + newins etc.ppp/chap-secrets chap-secrets.example
170 +
171 + insopts -m0644
172 + doins etc.ppp/options
173 +
174 + if use pam; then
175 + pamd_mimic_system ppp auth account session
176 + fi
177 +
178 + local PLUGINS_DIR="/usr/$(get_libdir)/pppd/${PV}"
179 + insinto "${PLUGINS_DIR}"
180 + insopts -m0755
181 + doins pppd/plugins/minconn.so
182 + doins pppd/plugins/passprompt.so
183 + doins pppd/plugins/passwordfd.so
184 + doins pppd/plugins/winbind.so
185 + doins pppd/plugins/pppoe/pppoe.so
186 + doins pppd/plugins/pppol2tp/openl2tp.so
187 + doins pppd/plugins/pppol2tp/pppol2tp.so
188 + if use atm ; then
189 + doins pppd/plugins/pppoatm/pppoatm.so
190 + fi
191 + if use dhcp ; then
192 + doins pppd/plugins/dhcp/dhcpc.so
193 + fi
194 + if use radius ; then
195 + doins pppd/plugins/radius/rad{ius,attr,realms}.so
196 +
197 + #Copy radiusclient configuration files (#92878)
198 + insinto /etc/ppp/radius
199 + insopts -m0644
200 + doins pppd/plugins/radius/etc/{dictionary*,issue,port-id-map,radiusclient.conf,realms,servers}
201 +
202 + doman pppd/plugins/radius/pppd-rad{ius,attr}.8
203 + fi
204 +
205 + insinto /etc/modprobe.d
206 + insopts -m0644
207 + newins "${FILESDIR}/modules.ppp" ppp.conf
208 +
209 + dodoc PLUGINS README* SETUP Changes-2.3 FAQ
210 + dodoc "${FILESDIR}/README.mpls"
211 +
212 + dosbin scripts/p{on,off,log}
213 + doman scripts/pon.1
214 +
215 + # Adding misc. specialized scripts to doc dir
216 + dodoc -r scripts
217 + docinto scripts
218 + dodoc -r scripts/chatchat
219 +
220 + if use gtk ; then
221 + dosbin contrib/pppgetpass/{pppgetpass.vt,pppgetpass.gtk}
222 + newsbin contrib/pppgetpass/pppgetpass.sh pppgetpass
223 + else
224 + newsbin contrib/pppgetpass/pppgetpass.vt pppgetpass
225 + fi
226 + doman contrib/pppgetpass/pppgetpass.8
227 +}
228 +
229 +pkg_postinst() {
230 + if linux-info_get_any_version && linux_config_src_exists ; then
231 + echo
232 + ewarn "If the following test report contains a missing kernel configuration option that you need,"
233 + ewarn "you should reconfigure and rebuild your kernel before running pppd."
234 + CONFIG_CHECK="~PPP ~PPP_ASYNC ~PPP_SYNC_TTY"
235 + local ERROR_PPP="CONFIG_PPP:\t missing PPP support (REQUIRED)"
236 + local ERROR_PPP_ASYNC="CONFIG_PPP_ASYNC:\t missing asynchronous serial line discipline (optional, but highly recommended)"
237 + local WARNING_PPP_SYNC_TTY="CONFIG_PPP_SYNC_TTY:\t missing synchronous serial line discipline (optional; used by 'sync' pppd option)"
238 + if use activefilter ; then
239 + CONFIG_CHECK="${CONFIG_CHECK} ~PPP_FILTER"
240 + local ERROR_PPP_FILTER="CONFIG_PPP_FILTER:\t missing PPP filtering support (REQUIRED)"
241 + fi
242 + CONFIG_CHECK="${CONFIG_CHECK} ~PPP_DEFLATE ~PPP_BSDCOMP ~PPP_MPPE"
243 + local ERROR_PPP_DEFLATE="CONFIG_PPP_DEFLATE:\t missing Deflate compression (optional, but highly recommended)"
244 + local ERROR_PPP_BSDCOMP="CONFIG_PPP_BSDCOMP:\t missing BSD-Compress compression (optional, but highly recommended)"
245 + local WARNING_PPP_MPPE="CONFIG_PPP_MPPE:\t missing MPPE encryption (optional, mostly used by PPTP links)"
246 + CONFIG_CHECK="${CONFIG_CHECK} ~PPPOE ~PACKET"
247 + local WARNING_PPPOE="CONFIG_PPPOE:\t missing PPPoE support (optional, needed by pppoe plugin)"
248 + local WARNING_PACKET="CONFIG_PACKET:\t missing AF_PACKET support (optional, used by pppoe and dhcpc plugins)"
249 + if use atm ; then
250 + CONFIG_CHECK="${CONFIG_CHECK} ~PPPOATM"
251 + local WARNING_PPPOATM="CONFIG_PPPOATM:\t missing PPPoA support (optional, needed by pppoatm plugin)"
252 + fi
253 + check_extra_config
254 + fi
255 +
256 + # create *-secrets files if not exists
257 + [[ -f "${EROOT}/etc/ppp/pap-secrets" ]] || \
258 + cp -pP "${EROOT}/etc/ppp/pap-secrets.example" "${EROOT}/etc/ppp/pap-secrets"
259 + [[ -f "${EROOT}/etc/ppp/chap-secrets" ]] || \
260 + cp -pP "${EROOT}/etc/ppp/chap-secrets.example" "${EROOT}/etc/ppp/chap-secrets"
261 +
262 + # lib name has changed
263 + sed -i -e "s:^rp-\(pppoe.so\):\1:" "${EROOT}/etc/ppp/options" || die
264 +
265 + echo
266 + elog "Pon, poff and plog scripts have been supplied for experienced users."
267 + elog "Users needing particular scripts (ssh,rsh,etc.) should check out the"
268 + elog "/usr/share/doc/${PF}/scripts directory."
269 +
270 + if [[ -n ${REPLACING_VERSIONS} ]] ; then
271 + ewarn '"rp-pppoe.so" plugin has been renamed to "pppoe.so"'
272 + fi
273 +}