wok-current view ppp/receipt @ rev 23958

Up fossil (2.12.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Oct 01 09:48:30 2020 +0000 (2020-10-01)
parents c34ef09acb7c
children 5ea0ce1cecc0
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 # Rules to configure and make the package.
20 compile_rules()
21 {
22 case "$ARCH" in
23 arm*)
24 export PATH=/cross/arm/tools/arm-slitaz-linux-gnueabi/bin:$PATH
25 esac
26 ./configure --prefix=/usr \
27 $CONFIGURE_ARGS &&
28 make &&
29 make DESTDIR=$DESTDIR/usr install
30 }
32 # Rules to gen a SliTaz package suitable for Tazpkg.
33 genpkg_rules()
34 {
35 mkdir -p $fs/usr/share/applications \
36 $fs/var/www/tazpanel/menu.d/network/VPN
37 cp -a $install/usr/sbin $fs/usr
38 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
39 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
40 cp $stuff/*.desktop $fs/usr/share/applications
41 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
42 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
44 # Config files.
45 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
46 cp $stuff/README.scripts $fs/etc/ppp
47 cp -a $src/etc.ppp/* $fs/etc/ppp
49 # PPP scripts.
50 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
51 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
52 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
53 $fs/etc/ppp/scripts/ppp-on
55 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
56 cp -a $src/scripts/callback $fs/etc/ppp/scripts
57 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
58 cat >> $fs/etc/ppp/ip-up <<EOT
59 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
60 . /etc/ppp/ip-up.d/\$6 "\$@"
61 elif [ -n "\$DNS1\$DNS2" ]; then
62 rm -f /etc/ppp/resolv.prev
63 [ -s /etc/resolv.conf ] && mv -f /etc/resolv.conf /etc/ppp/resolv.prev
64 [ -n "\$DNS1" ] && echo "nameserver \$DNS1" >> /etc/resolv.conf
65 [ -n "\$DNS2" ] && echo "nameserver \$DNS2" >> /etc/resolv.conf
66 chmod 644 /etc/resolv.conf
67 fi
68 EOT
69 cat >> $fs/etc/ppp/ip-down <<EOT
70 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
71 . /etc/ppp/ip-down.d/\$6 "\$@"
72 elif [ -n "\$DNS1\$DNS2" ]; then
73 rm -f /etc/resolv.conf
74 mv -f /etc/ppp/resolv.prev /etc/resolv.conf
75 fi
76 EOT
77 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
78 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
79 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
81 # insert #!/bin/sh on top line in ip* scripts
82 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
83 # add empty peers dir
84 mkdir -p $fs/etc/ppp/peers
85 # hide login/pass from regular users
86 chmod go-rwx $fs/etc/ppp/*secrets
87 chmod go-rwx $fs/etc/ppp/options
88 chmod 711 $fs/etc/ppp/scripts/*
89 }
91 post_install()
92 {
93 rm -f $1/var/cache/tazpanel/header.* 2>/dev/null || true
94 chroot "$1/" chgrp dialout /usr/sbin/pppd
95 chmod 4750 $1/usr/sbin/pppd
96 echo
97 echo " ADD yourself to group dialout to use pppd: addgroup tux dialout"
98 }