wok view ppp/receipt @ rev 25632
Up gtklife (5.3)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Dec 23 14:06:29 2023 +0000 (8 months ago) |
parents | ac8ca9758df1 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="ppp"
4 VERSION="2.4.7"
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 BUILD_DEPENDS="wget"
17 SUGGESTED="tazpanel"
19 # What is the latest version available today?
20 current_version()
21 {
22 wget -O - ${WGET_URL%/arch*}/tags 2>/dev/null | \
23 sed '/tag\//!d;s|.*tag/[a-z-]*||;s|".*||;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
33 ./configure --prefix=/usr \
34 $CONFIGURE_ARGS &&
35 make &&
36 make DESTDIR=$DESTDIR/usr install
37 }
39 # Rules to gen a SliTaz package suitable for Tazpkg.
40 genpkg_rules()
41 {
42 mkdir -p $fs/usr/share/applications \
43 $fs/var/www/tazpanel/menu.d/network/VPN
44 cp -a $install/usr/sbin $fs/usr
45 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
46 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
47 cp $stuff/*.desktop $fs/usr/share/applications
48 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
49 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
51 # Config files.
52 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
53 cp $stuff/README.scripts $fs/etc/ppp
54 cp -a $src/etc.ppp/* $fs/etc/ppp
56 # PPP scripts.
57 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
58 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
59 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
60 $fs/etc/ppp/scripts/ppp-on
62 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
63 cp -a $src/scripts/callback $fs/etc/ppp/scripts
64 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
65 cat >> $fs/etc/ppp/ip-up <<EOT
66 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
67 . /etc/ppp/ip-up.d/\$6 "\$@"
68 elif [ -n "\$DNS1\$DNS2" ]; then
69 rm -f /etc/ppp/resolv.prev
70 [ -s /etc/resolv.conf ] && mv -f /etc/resolv.conf /etc/ppp/resolv.prev
71 [ -n "\$DNS1" ] && echo "nameserver \$DNS1" >> /etc/resolv.conf
72 [ -n "\$DNS2" ] && echo "nameserver \$DNS2" >> /etc/resolv.conf
73 chmod 644 /etc/resolv.conf
74 fi
75 EOT
76 cat >> $fs/etc/ppp/ip-down <<EOT
77 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
78 . /etc/ppp/ip-down.d/\$6 "\$@"
79 elif [ -n "\$DNS1\$DNS2" ]; then
80 rm -f /etc/resolv.conf
81 mv -f /etc/ppp/resolv.prev /etc/resolv.conf
82 fi
83 EOT
84 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
85 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
86 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
88 # insert #!/bin/sh on top line in ip* scripts
89 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
90 # add empty peers dir
91 mkdir -p $fs/etc/ppp/peers
92 # hide login/pass from regular users
93 chmod go-rwx $fs/etc/ppp/*secrets
94 chmod go-rwx $fs/etc/ppp/options
95 chmod 711 $fs/etc/ppp/scripts/*
96 }
98 post_install()
99 {
100 rm -f $1/var/cache/tazpanel/header.* 2>/dev/null || true
101 chroot "$1/" chgrp dialout /usr/sbin/pppd
102 chmod 4750 $1/usr/sbin/pppd
103 echo
104 echo " ADD yourself to group dialout to use pppd: addgroup tux dialout"
105 }