wok-next annotate ppp/receipt @ rev 20564

shell-detector, screenfetch: create $install tree
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 10 10:14:26 2018 +0200 (2018-04-10)
parents d3adbeea3a9f
children f4db0f796bc3
rev   line source
pascal@20286 1 # SliTaz package receipt v2.
pankso@6 2
pankso@6 3 PACKAGE="ppp"
pascal@18019 4 VERSION="2.4.7"
pankso@203 5 CATEGORY="network"
pascal@20286 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 WEB_SITE="http://ppp.samba.org/"
pankso@6 10
al@19663 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
al@19663 12 WGET_URL="$GITHUB/paulusmack/ppp/tarball/ppp-$VERSION"
al@20443 13
pascal@20286 14 BUILD_DEPENDS="pam-dev"
pascal@20286 15 SPLIT="ppp ppp-pam ppp-dev"
pascal@18017 16
al@20443 17 compile_rules() {
pascal@19089 18 case "$ARCH" in
al@20443 19 arm*) export PATH=/cross/arm/tools/arm-slitaz-linux-gnueabi/bin:$PATH;;
pascal@19089 20 esac
al@19663 21
pascal@20286 22 cp -a $src $src-pam
al@19663 23 ./configure $CONFIGURE_ARGS &&
pascal@1634 24 make &&
al@20292 25 make DESTDIR=$DESTDIR/usr install || return 1
pascal@20286 26
pascal@20286 27 cd $src-pam
pascal@20286 28 sed -i 's/#USE_PAM/USE_PAM/' pppd/Makefile.linux
pascal@20286 29 ./configure $CONFIGURE_ARGS &&
pascal@20286 30 make &&
pascal@20286 31 make DESTDIR=$DESTDIR-pam/usr install
pankso@6 32 }
pankso@6 33
al@20443 34 genpkg_rules() {
pascal@20286 35 case $PACKAGE in
al@20443 36 ppp|ppp-pam)
al@20443 37 if [ $PACKAGE == 'ppp-pam' ]; then
al@20443 38 DEPENDS="pam"
al@20443 39 PROVIDE="ppp:pam"
al@20443 40 CAT="network|with PAM support"
al@20443 41 install=$install-pam
al@20443 42 fi
al@20443 43 SUGGESTED="tazpanel"
al@20443 44 CONFIG_FILES="/etc/ppp/options /etc/ppp/*secrets"
al@20443 45 mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network/VPN
al@20443 46 cp -a $install/usr/sbin $fs/usr
al@20443 47 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
al@20443 48 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel
al@20443 49 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp
al@20443 50 ln -s ../../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/VPN/ppp
al@19663 51
al@20443 52 # Config files.
al@20443 53 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
al@20443 54 cp $stuff/README.scripts $fs/etc/ppp
al@20443 55 cp -a $src/etc.ppp/* $fs/etc/ppp
domcox@12173 56
al@20443 57 # PPP scripts.
al@20443 58 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
al@20443 59 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
al@20443 60 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
al@20443 61 $fs/etc/ppp/scripts/ppp-on
al@19663 62
al@20443 63 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
al@20443 64 cp -a $src/scripts/callback $fs/etc/ppp/scripts
al@20443 65 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
al@20443 66 cat >> $fs/etc/ppp/ip-up <<EOT
pascal@15886 67 #!/bin/sh
pascal@15886 68
pascal@15885 69 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
pascal@15885 70 . /etc/ppp/ip-up.d/\$6 "\$@"
pascal@15885 71 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
trixar_za@12286 72 rm -f /etc/ppp/resolv.prev
trixar_za@12286 73 if [ -f /etc/resolv.conf ]; then
trixar_za@12286 74 cp /etc/resolv.conf /etc/ppp/resolv.prev
trixar_za@12286 75 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
trixar_za@12286 76 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
trixar_za@12286 77 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
trixar_za@12286 78 chmod 644 /etc/resolv.conf
trixar_za@12286 79 else
trixar_za@12286 80 cp /etc/ppp/resolv.conf /etc
trixar_za@12286 81 chmod 644 /etc/resolv.conf
trixar_za@12286 82 fi
trixar_za@12286 83 fi
trixar_za@12286 84 EOT
al@20443 85 cat >> $fs/etc/ppp/ip-down <<EOT
pascal@15886 86 #!/bin/sh
pascal@15886 87
pascal@15885 88 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
pascal@15885 89 . /etc/ppp/ip-down.d/\$6 "\$@"
pascal@15885 90 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
trixar_za@12286 91 if [ -f /etc/ppp/resolv.prev ]; then
trixar_za@12286 92 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
trixar_za@12286 93 chmod 644 /etc/resolv.conf
trixar_za@12286 94 else
trixar_za@12286 95 rm -f /etc/resolv.conf
trixar_za@12286 96 fi
trixar_za@12286 97 fi
trixar_za@12286 98 EOT
al@20443 99 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
al@20443 100 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
al@20443 101 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
domcox@12173 102
al@20443 103 # insert #!/bin/sh on top line in ip* scripts
al@20443 104 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
al@20443 105 # add empty peers dir
al@20443 106 mkdir -p $fs/etc/ppp/peers
al@20443 107 # hide login/pass from regular users
al@20443 108 chmod go-rwx $fs/etc/ppp/*secrets
al@20443 109 chmod go-rwx $fs/etc/ppp/options
al@20443 110 chmod 711 $fs/etc/ppp/scripts/*
al@20443 111 ;;
al@20443 112 ppp-dev)
al@20443 113 copy include/
al@20443 114 ;;
pascal@20286 115 esac
pascal@15886 116 }