wok-current view ppp/receipt @ rev 25634

Mass update, new toolchain gcc 8.3.0, glibc 2.28.0
author Stanislas Leduc <shann@slitaz.org>
date Sun Jan 14 08:12:37 2024 +0000 (7 months ago)
parents ac8ca9758df1
children
line source
1 # SliTaz package receipt.
3 PACKAGE="ppp"
4 VERSION="2.4.9"
5 CATEGORY="network"
6 SHORT_DESC="Implements the Point-to-Point Protocol (PPP)."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD GPL"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="https://ppp.samba.org/"
11 WGET_URL="https://github.com/paulusmack/ppp/archive/$TARBALL"
12 CONFIG_FILES="/etc/ppp/options"
13 SECRET_FILES="/etc/ppp/*secrets"
14 HOST_ARCH="i486 arm"
16 DEPENDS="libpcap libssl"
17 BUILD_DEPENDS="wget openssl-dev libpcap-dev"
18 SUGGESTED="tazpanel"
20 current_version()
21 {
22 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
23 sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
24 }
26 # Rules to configure and make the package.
27 compile_rules()
28 {
29 case "$ARCH" in
30 arm*)
31 export PATH=/cross/arm/tools/arm-slitaz-linux-gnueabi/bin:$PATH
32 esac
34 # Patch to use with glibc < 2.24
35 # see https://github.com/ppp-project/ppp/commit/98ec18f
36 patch -p1 < $stuff/ppp-glibc.patch
38 ./configure --prefix=/usr \
39 $CONFIGURE_ARGS &&
40 make &&
41 make DESTDIR=$DESTDIR/usr install
42 }
44 # Rules to gen a SliTaz package suitable for Tazpkg.
45 genpkg_rules()
46 {
47 mkdir -p $fs/usr/share/applications \
48 $fs/var/www/tazpanel/menu.d/network/VPN
49 cp -a $install/usr/sbin $fs/usr
50 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
51 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
52 cp $stuff/*.desktop $fs/usr/share/applications
53 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
54 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
56 # Config files.
57 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
58 cp $stuff/README.scripts $fs/etc/ppp
59 cp -a $src/etc.ppp/* $fs/etc/ppp
61 # PPP scripts.
62 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
63 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
64 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
65 $fs/etc/ppp/scripts/ppp-on
67 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
68 cp -a $src/scripts/callback $fs/etc/ppp/scripts
69 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
70 cat >> $fs/etc/ppp/ip-up <<EOT
71 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
72 . /etc/ppp/ip-up.d/\$6 "\$@"
73 elif [ -n "\$DNS1\$DNS2" ]; then
74 rm -f /etc/ppp/resolv.prev
75 [ -s /etc/resolv.conf ] && mv -f /etc/resolv.conf /etc/ppp/resolv.prev
76 [ -n "\$DNS1" ] && echo "nameserver \$DNS1" >> /etc/resolv.conf
77 [ -n "\$DNS2" ] && echo "nameserver \$DNS2" >> /etc/resolv.conf
78 chmod 644 /etc/resolv.conf
79 fi
80 EOT
81 cat >> $fs/etc/ppp/ip-down <<EOT
82 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
83 . /etc/ppp/ip-down.d/\$6 "\$@"
84 elif [ -n "\$DNS1\$DNS2" ]; then
85 rm -f /etc/resolv.conf
86 mv -f /etc/ppp/resolv.prev /etc/resolv.conf
87 fi
88 EOT
89 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
90 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
91 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
93 # insert #!/bin/sh on top line in ip* scripts
94 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
95 # add empty peers dir
96 mkdir -p $fs/etc/ppp/peers
97 # hide login/pass from regular users
98 chmod go-rwx $fs/etc/ppp/*secrets
99 chmod go-rwx $fs/etc/ppp/options
100 chmod 711 $fs/etc/ppp/scripts/*
101 }
103 post_install()
104 {
105 rm -f $1/var/cache/tazpanel/header.* 2>/dev/null || true
106 chroot "$1/" chgrp dialout /usr/sbin/pppd
107 chmod 4750 $1/usr/sbin/pppd
108 echo
109 echo " ADD yourself to group dialout to use pppd: addgroup tux dialout"
110 }