wok-6.x view ppp/receipt @ rev 20491

libzim-dev: add libzim.pc
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 27 23:06:17 2018 +0200 (2018-10-27)
parents df2a96b56a0f
children a78610b2eb47
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/options /etc/ppp/*secrets"
13 HOST_ARCH="i486 arm"
15 BUILD_DEPENDS="wget"
16 SUGGESTED="tazpanel"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 case "$ARCH" in
22 arm*)
23 export PATH=/cross/arm/tools/arm-slitaz-linux-gnueabi/bin:$PATH
24 esac
25 ./configure --prefix=/usr \
26 $CONFIGURE_ARGS &&
27 make &&
28 make DESTDIR=$DESTDIR/usr install
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN
35 cp -a $install/usr/sbin $fs/usr
36 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
37 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
38 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
39 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
41 # Config files.
42 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
43 cp $stuff/README.scripts $fs/etc/ppp
44 cp -a $src/etc.ppp/* $fs/etc/ppp
46 # PPP scripts.
47 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
48 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
49 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
50 $fs/etc/ppp/scripts/ppp-on
52 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
53 cp -a $src/scripts/callback $fs/etc/ppp/scripts
54 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
55 cat >> $fs/etc/ppp/ip-up <<EOT
56 #!/bin/sh
58 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
59 . /etc/ppp/ip-up.d/\$6 "\$@"
60 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
61 rm -f /etc/ppp/resolv.prev
62 if [ -f /etc/resolv.conf ]; then
63 cp /etc/resolv.conf /etc/ppp/resolv.prev
64 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
65 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
66 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
67 chmod 644 /etc/resolv.conf
68 else
69 cp /etc/ppp/resolv.conf /etc
70 chmod 644 /etc/resolv.conf
71 fi
72 fi
73 EOT
74 cat >> $fs/etc/ppp/ip-down <<EOT
75 #!/bin/sh
77 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
78 . /etc/ppp/ip-down.d/\$6 "\$@"
79 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
80 if [ -f /etc/ppp/resolv.prev ]; then
81 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
82 chmod 644 /etc/resolv.conf
83 else
84 rm -f /etc/resolv.conf
85 fi
86 fi
87 EOT
88 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
89 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
90 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
92 # insert #!/bin/sh on top line in ip* scripts
93 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
94 # add empty peers dir
95 mkdir -p $fs/etc/ppp/peers
96 # hide login/pass from regular users
97 chmod go-rwx $fs/etc/ppp/*secrets
98 chmod go-rwx $fs/etc/ppp/options
99 chmod 711 $fs/etc/ppp/scripts/*
100 }
102 post_install()
103 {
104 rm -f $1/var/cache/tazpanel/header.* 2>/dev/null || true
105 chroot "$1/" chgrp dialout /usr/sbin/pppd
106 chmod 4750 $1/usr/sbin/pppd
107 echo
108 echo " ADD yourself to group dialout to use pppd: addgroup tux dialout"
109 }