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