wok-current annotate ppp/receipt @ rev 23902
Add SECRET_FILES variable
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Aug 01 16:19:51 2020 +0000 (2020-08-01) |
parents | c34ef09acb7c |
children | 5ea0ce1cecc0 |
rev | line source |
---|---|
pankso@6 | 1 # SliTaz package receipt. |
pankso@6 | 2 |
pankso@6 | 3 PACKAGE="ppp" |
pascal@18019 | 4 VERSION="2.4.7" |
pankso@203 | 5 CATEGORY="network" |
pankso@6 | 6 SHORT_DESC="Implements the Point-to-Point Protocol (PPP)." |
pankso@6 | 7 MAINTAINER="pankso@slitaz.org" |
pascal@14698 | 8 LICENSE="BSD GPL" |
pankso@6 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
pascal@20669 | 10 WEB_SITE="https://ppp.samba.org/" |
pascal@18019 | 11 WGET_URL="https://github.com/paulusmack/ppp/archive/$TARBALL" |
pascal@23902 | 12 CONFIG_FILES="/etc/ppp/options" |
pascal@23902 | 13 SECRET_FILES="/etc/ppp/*secrets" |
pankso@16194 | 14 HOST_ARCH="i486 arm" |
pankso@6 | 15 |
pascal@18043 | 16 BUILD_DEPENDS="wget" |
pascal@18017 | 17 SUGGESTED="tazpanel" |
pascal@18017 | 18 |
pankso@6 | 19 # Rules to configure and make the package. |
pankso@6 | 20 compile_rules() |
pankso@6 | 21 { |
pascal@19089 | 22 case "$ARCH" in |
pascal@19089 | 23 arm*) |
pascal@19089 | 24 export PATH=/cross/arm/tools/arm-slitaz-linux-gnueabi/bin:$PATH |
pascal@19089 | 25 esac |
pankso@16194 | 26 ./configure --prefix=/usr \ |
pascal@18019 | 27 $CONFIGURE_ARGS && |
pascal@1634 | 28 make && |
pascal@11797 | 29 make DESTDIR=$DESTDIR/usr install |
pankso@6 | 30 } |
pankso@6 | 31 |
pankso@6 | 32 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@6 | 33 genpkg_rules() |
pankso@6 | 34 { |
pascal@22849 | 35 mkdir -p $fs/usr/share/applications \ |
pascal@22849 | 36 $fs/var/www/tazpanel/menu.d/network/VPN |
pascal@15603 | 37 cp -a $install/usr/sbin $fs/usr |
pankso@16194 | 38 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr |
pascal@18017 | 39 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel |
pascal@22849 | 40 cp $stuff/*.desktop $fs/usr/share/applications |
pascal@18017 | 41 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp |
pascal@18025 | 42 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp |
pascal@18017 | 43 |
pankso@6 | 44 # Config files. |
pascal@15885 | 45 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d |
slaxemulator@9475 | 46 cp $stuff/README.scripts $fs/etc/ppp |
pankso@6 | 47 cp -a $src/etc.ppp/* $fs/etc/ppp |
domcox@12173 | 48 |
pankso@6 | 49 # PPP scripts. |
pankso@6 | 50 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts |
pankso@6 | 51 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts |
pankso@16194 | 52 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \ |
pankso@16194 | 53 $fs/etc/ppp/scripts/ppp-on |
jozee@5104 | 54 |
pankso@6 | 55 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts |
pankso@6 | 56 cp -a $src/scripts/callback $fs/etc/ppp/scripts |
pankso@6 | 57 cp -a $src/scripts/redialer $fs/etc/ppp/scripts |
trixar_za@12286 | 58 cat >> $fs/etc/ppp/ip-up <<EOT |
pascal@15885 | 59 if [ -x /etc/ppp/ip-up.d/\$6 ]; then |
pascal@15885 | 60 . /etc/ppp/ip-up.d/\$6 "\$@" |
pascal@22849 | 61 elif [ -n "\$DNS1\$DNS2" ]; then |
trixar_za@12286 | 62 rm -f /etc/ppp/resolv.prev |
pascal@22849 | 63 [ -s /etc/resolv.conf ] && mv -f /etc/resolv.conf /etc/ppp/resolv.prev |
pascal@22849 | 64 [ -n "\$DNS1" ] && echo "nameserver \$DNS1" >> /etc/resolv.conf |
pascal@22849 | 65 [ -n "\$DNS2" ] && echo "nameserver \$DNS2" >> /etc/resolv.conf |
pascal@22849 | 66 chmod 644 /etc/resolv.conf |
trixar_za@12286 | 67 fi |
trixar_za@12286 | 68 EOT |
trixar_za@12286 | 69 cat >> $fs/etc/ppp/ip-down <<EOT |
pascal@15885 | 70 if [ -x /etc/ppp/ip-down.d/\$6 ]; then |
pascal@15885 | 71 . /etc/ppp/ip-down.d/\$6 "\$@" |
pascal@22849 | 72 elif [ -n "\$DNS1\$DNS2" ]; then |
pascal@22849 | 73 rm -f /etc/resolv.conf |
pascal@22849 | 74 mv -f /etc/ppp/resolv.prev /etc/resolv.conf |
trixar_za@12286 | 75 fi |
trixar_za@12286 | 76 EOT |
trixar_za@12286 | 77 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up |
trixar_za@12286 | 78 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down |
pascal@15885 | 79 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down |
domcox@12173 | 80 |
jozee@5092 | 81 # insert #!/bin/sh on top line in ip* scripts |
pankso@16194 | 82 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null |
jozee@5104 | 83 # add empty peers dir |
jozee@5104 | 84 mkdir -p $fs/etc/ppp/peers |
domcox@12174 | 85 # hide login/pass from regular users |
domcox@12174 | 86 chmod go-rwx $fs/etc/ppp/*secrets |
domcox@12174 | 87 chmod go-rwx $fs/etc/ppp/options |
domcox@12174 | 88 chmod 711 $fs/etc/ppp/scripts/* |
pascal@15886 | 89 } |
pascal@20155 | 90 |
pascal@20155 | 91 post_install() |
pascal@20155 | 92 { |
pascal@20155 | 93 rm -f $1/var/cache/tazpanel/header.* 2>/dev/null || true |
pascal@20305 | 94 chroot "$1/" chgrp dialout /usr/sbin/pppd |
pascal@20305 | 95 chmod 4750 $1/usr/sbin/pppd |
pascal@20319 | 96 echo |
pascal@20305 | 97 echo " ADD yourself to group dialout to use pppd: addgroup tux dialout" |
pascal@20155 | 98 } |