wok-next view ppp/receipt @ rev 20292

Up warzone2100; add pulse; tiny edits for fresh *-pam changes
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Nov 08 19:39:57 2017 +0200 (2017-11-08)
parents 9d04ac35b45f
children 0e7893ac206d
line source
1 # SliTaz package receipt v2.
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 WEB_SITE="http://ppp.samba.org/"
10 CONFIG_FILES="/etc/ppp/options /etc/ppp/*secrets"
11 HOST_ARCH="i486 arm"
12 SUGGESTED="tazpanel"
14 TARBALL="$PACKAGE-$VERSION.tar.gz"
15 WGET_URL="$GITHUB/paulusmack/ppp/tarball/ppp-$VERSION"
16 BUILD_DEPENDS="pam-dev"
17 SPLIT="ppp ppp-pam ppp-dev"
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
27 cp -a $src $src-pam
28 ./configure $CONFIGURE_ARGS &&
29 make &&
30 make DESTDIR=$DESTDIR/usr install || return 1
32 cd $src-pam
33 sed -i 's/#USE_PAM/USE_PAM/' pppd/Makefile.linux
34 ./configure $CONFIGURE_ARGS &&
35 make &&
36 make DESTDIR=$DESTDIR-pam/usr install
37 }
39 # Rules to gen a SliTaz package suitable for Tazpkg.
40 genpkg_rules()
41 {
42 case $PACKAGE in
43 ppp|ppp-pam)
44 if [ $PACKAGE == 'ppp-pam' ]; then
45 DEPENDS="pam"
46 PROVIDE="ppp:pam"
47 CAT="network|with PAM support"
48 install=$install-pam
49 fi
50 mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN
51 cp -a $install/usr/sbin $fs/usr
52 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
53 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
54 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
55 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
57 # Config files.
58 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
59 cp $stuff/README.scripts $fs/etc/ppp
60 cp -a $src/etc.ppp/* $fs/etc/ppp
62 # PPP scripts.
63 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
64 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
65 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
66 $fs/etc/ppp/scripts/ppp-on
68 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
69 cp -a $src/scripts/callback $fs/etc/ppp/scripts
70 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
71 cat >> $fs/etc/ppp/ip-up <<EOT
72 #!/bin/sh
74 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
75 . /etc/ppp/ip-up.d/\$6 "\$@"
76 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
77 rm -f /etc/ppp/resolv.prev
78 if [ -f /etc/resolv.conf ]; then
79 cp /etc/resolv.conf /etc/ppp/resolv.prev
80 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
81 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
82 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
83 chmod 644 /etc/resolv.conf
84 else
85 cp /etc/ppp/resolv.conf /etc
86 chmod 644 /etc/resolv.conf
87 fi
88 fi
89 EOT
90 cat >> $fs/etc/ppp/ip-down <<EOT
91 #!/bin/sh
93 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
94 . /etc/ppp/ip-down.d/\$6 "\$@"
95 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
96 if [ -f /etc/ppp/resolv.prev ]; then
97 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
98 chmod 644 /etc/resolv.conf
99 else
100 rm -f /etc/resolv.conf
101 fi
102 fi
103 EOT
104 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
105 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
106 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
108 # insert #!/bin/sh on top line in ip* scripts
109 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
110 # add empty peers dir
111 mkdir -p $fs/etc/ppp/peers
112 # hide login/pass from regular users
113 chmod go-rwx $fs/etc/ppp/*secrets
114 chmod go-rwx $fs/etc/ppp/options
115 chmod 711 $fs/etc/ppp/scripts/*
116 ;;
117 ppp-dev)
118 copy include/
119 ;;
120 esac
121 }