wok-next view ppp/receipt @ rev 20674
Up putty (0.70)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat May 12 05:17:48 2018 +0300 (2018-05-12) |
parents | 0e7893ac206d |
children | a3c581bf52b8 |
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/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$GITHUB/paulusmack/ppp/tarball/ppp-$VERSION"
14 BUILD_DEPENDS="pam-dev"
15 SPLIT="ppp ppp-pam ppp-dev"
17 compile_rules() {
18 case "$ARCH" in
19 arm*) export PATH=/cross/arm/tools/arm-slitaz-linux-gnueabi/bin:$PATH;;
20 esac
22 cp -a $src $src-pam
23 ./configure $CONFIGURE_ARGS &&
24 make &&
25 make DESTDIR=$DESTDIR/usr install || return 1
27 cd $src-pam
28 sed -i 's/#USE_PAM/USE_PAM/' pppd/Makefile.linux
29 ./configure $CONFIGURE_ARGS &&
30 make &&
31 make DESTDIR=$DESTDIR-pam/usr install
32 }
34 genpkg_rules() {
35 case $PACKAGE in
36 ppp|ppp-pam)
37 if [ $PACKAGE == 'ppp-pam' ]; then
38 DEPENDS="pam"
39 PROVIDE="ppp:pam"
40 CAT="network|with PAM support"
41 install=$install-pam
42 fi
43 SUGGESTED="tazpanel"
44 CONFIG_FILES="/etc/ppp/options /etc/ppp/*secrets"
45 mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN
46 cp -a $install/usr/sbin $fs/usr
47 chgrp dialout $fs/usr/sbin/pppd
48 chmod 4750 $fs/usr/sbin/pppd
49 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
50 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
51 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
52 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
54 # Config files.
55 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
56 cp $stuff/README.scripts $fs/etc/ppp
57 cp -a $src/etc.ppp/* $fs/etc/ppp
59 # PPP scripts.
60 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
61 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
62 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
63 $fs/etc/ppp/scripts/ppp-on
65 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
66 cp -a $src/scripts/callback $fs/etc/ppp/scripts
67 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
68 cat >> $fs/etc/ppp/ip-up <<EOT
69 #!/bin/sh
71 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
72 . /etc/ppp/ip-up.d/\$6 "\$@"
73 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
74 rm -f /etc/ppp/resolv.prev
75 if [ -f /etc/resolv.conf ]; then
76 cp /etc/resolv.conf /etc/ppp/resolv.prev
77 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
78 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
79 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
80 chmod 644 /etc/resolv.conf
81 else
82 cp /etc/ppp/resolv.conf /etc
83 chmod 644 /etc/resolv.conf
84 fi
85 fi
86 EOT
87 cat >> $fs/etc/ppp/ip-down <<EOT
88 #!/bin/sh
90 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
91 . /etc/ppp/ip-down.d/\$6 "\$@"
92 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
93 if [ -f /etc/ppp/resolv.prev ]; then
94 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
95 chmod 644 /etc/resolv.conf
96 else
97 rm -f /etc/resolv.conf
98 fi
99 fi
100 EOT
101 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
102 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
103 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
105 # insert #!/bin/sh on top line in ip* scripts
106 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
107 # add empty peers dir
108 mkdir -p $fs/etc/ppp/peers
109 # hide login/pass from regular users
110 chmod go-rwx $fs/etc/ppp/*secrets
111 chmod go-rwx $fs/etc/ppp/options
112 chmod 711 $fs/etc/ppp/scripts/*
113 ;;
114 ppp-dev)
115 copy include/
116 ;;
117 esac
118 }