1 # Build recipe for rp-pppoe.
3 # Copyright (c) 2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
30 fetch=https://dianne.skoll.ca/projects/rp-pppoe/download/$tarname
33 PPP over Ethernet (xDSL support).
35 PPPoE (Point-to-Point Protocol over Ethernet) is a protocol used by many
36 DSL Internet Service Providers. RP-PPPoE is a free PPPoE client, relay
37 and server for GNU/Linux.
40 homepage=https://dianne.skoll.ca/projects/rp-pppoe/
43 # Source documentation
44 docs="README SERVPOET doc/*"
45 docsdir="${docdir}/${program}-${version}"
49 unpack "${tardir}/$tarname"
53 # Apply a patch from "Alpine Linux"
54 patch -Np1 -i "${worktree}/patches/rp-pppoe/musl-fix.patch"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
61 ./configure CPPFLAGS="$QICPPFLAGS" \
62 CFLAGS="$QICFLAGS -D_GNU_SOURCE -fno-strict-aliasing" \
63 LDFLAGS="$QILDFLAGS" \
65 --libdir=/usr/lib${libSuffix} \
69 --build="$(gcc -dumpmachine)"
71 make -j${jobs} V=1 PLUGIN_DIR="/usr/libexec/rp-pppoe" all rp-pppoe.so
72 make -j${jobs} PLUGIN_DIR="/usr/libexec/rp-pppoe" DESTDIR="$destdir" install
76 # To manage .new configs via graft(1)
77 touch "${destdir}/etc/ppp/.graft-config"
79 # Make happy tutorials that point this out
80 ln -s pppoe-stop "${destdir}/usr/sbin/adsl-stop"
81 ln -s pppoe-start "${destdir}/usr/sbin/adsl-start"
82 ln -s pppoe-start.8 "${destdir}/${mandir}/man8/adsl-start.8"
83 ln -s pppoe-stop.8 "${destdir}/${mandir}/man8/adsl-stop.8"
85 # Compress and link man pages (if needed)
86 if test -d "${destdir}/$mandir"
89 cd "${destdir}/$mandir"
90 find . -type f -exec lzip -9 {} +
91 find . -type l | while read -r file
93 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
100 mkdir -p "${destdir}/$docsdir"
101 cp -p $docs "${destdir}/$docsdir"