recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / networking / rp-pppoe / recipe
blobe9052f3ebd58f2619632935973337a2fe514b3d8
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
18 set -e
20 program=rp-pppoe
21 version=3.15
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://dianne.skoll.ca/projects/rp-pppoe/download/$tarname
32 description="
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/
41 license=GPLv2+
43 # Source documentation
44 docs="README SERVPOET doc/*"
45 docsdir="${docdir}/${program}-${version}"
47 build()
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
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 .
59     cd src
61     ./configure CPPFLAGS="$QICPPFLAGS" \
62     CFLAGS="$QICFLAGS -D_GNU_SOURCE -fno-strict-aliasing" \
63     LDFLAGS="$QILDFLAGS" \
64      $configure_args \
65      --libdir=/usr/lib${libSuffix} \
66      --mandir=$mandir \
67      --docdir=$docsdir \
68      --enable-plugin \
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
74     cd ..
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"
87     then
88         (
89             cd "${destdir}/$mandir"
90             find . -type f -exec lzip -9 {} +
91             find . -type l | while read -r file
92             do
93                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
94                 rm -- "$file"
95             done
96         )
97     fi
99     # Copy documentation
100     mkdir -p "${destdir}/$docsdir"
101     cp -p $docs "${destdir}/$docsdir"