wok-6.x annotate ppp/receipt @ rev 23892

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