wok view ppp/receipt @ rev 18019

Up ppp (2.4.7)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 02 21:48:46 2015 +0200 (2015-05-02)
parents 22d242cf69af
children 5c05d949d429
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="http://ppp.samba.org/"
11 WGET_URL="https://github.com/paulusmack/ppp/archive/$TARBALL"
12 CONFIG_FILES="/etc/ppp"
13 HOST_ARCH="i486 arm"
15 DEPENDS="wget"
16 SUGGESTED="tazpanel"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 ./configure --prefix=/usr \
22 $CONFIGURE_ARGS &&
23 make &&
24 make DESTDIR=$DESTDIR/usr install
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network
31 cp -a $install/usr/sbin $fs/usr
32 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
33 cp -a $stuff/pppnc-server $fs/usr/sbin
34 ln $fs/usr/sbin/pppnc-server $fs/usr/sbin/pppnc-client
35 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
36 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
38 # Config files.
39 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
40 cp $stuff/README.scripts $fs/etc/ppp
41 cp -a $src/etc.ppp/* $fs/etc/ppp
43 # PPP scripts.
44 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
45 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
46 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
47 $fs/etc/ppp/scripts/ppp-on
49 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
50 cp -a $src/scripts/callback $fs/etc/ppp/scripts
51 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
52 cat >> $fs/etc/ppp/ip-up <<EOT
53 #!/bin/sh
55 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
56 . /etc/ppp/ip-up.d/\$6 "\$@"
57 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
58 rm -f /etc/ppp/resolv.prev
59 if [ -f /etc/resolv.conf ]; then
60 cp /etc/resolv.conf /etc/ppp/resolv.prev
61 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
62 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
63 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
64 chmod 644 /etc/resolv.conf
65 else
66 cp /etc/ppp/resolv.conf /etc
67 chmod 644 /etc/resolv.conf
68 fi
69 fi
70 EOT
71 cat >> $fs/etc/ppp/ip-down <<EOT
72 #!/bin/sh
74 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
75 . /etc/ppp/ip-down.d/\$6 "\$@"
76 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
77 if [ -f /etc/ppp/resolv.prev ]; then
78 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
79 chmod 644 /etc/resolv.conf
80 else
81 rm -f /etc/resolv.conf
82 fi
83 fi
84 EOT
85 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
86 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
87 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
89 # insert #!/bin/sh on top line in ip* scripts
90 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
91 # add empty peers dir
92 mkdir -p $fs/etc/ppp/peers
93 # hide login/pass from regular users
94 chmod go-rwx $fs/etc/ppp/*secrets
95 chmod go-rwx $fs/etc/ppp/options
96 chmod 711 $fs/etc/ppp/scripts/*
97 }