wok-current annotate ppp/receipt @ rev 18017
ppp:add ppp.cgi
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat May 02 16:52:55 2015 +0200 (2015-05-02) |
parents | e6bbb8cc0677 |
children | c6508bb9fd8a |
rev | line source |
---|---|
pankso@6 | 1 # SliTaz package receipt. |
pankso@6 | 2 |
pankso@6 | 3 PACKAGE="ppp" |
jozee@5100 | 4 VERSION="2.4.5" |
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" |
pankso@6 | 10 WEB_SITE="http://ppp.samba.org/" |
pankso@6 | 11 WGET_URL="ftp://ftp.samba.org/pub/ppp/$TARBALL" |
pascal@1634 | 12 CONFIG_FILES="/etc/ppp" |
pankso@16194 | 13 HOST_ARCH="i486 arm" |
pankso@6 | 14 |
pascal@18017 | 15 SUGGESTED="tazpanel" |
pascal@18017 | 16 |
pankso@6 | 17 # Rules to configure and make the package. |
pankso@6 | 18 compile_rules() |
pankso@6 | 19 { |
pascal@11799 | 20 if ! grep -qs pppol2tpv3_addr include/linux/if_pppol2tp.h ; then |
pascal@11799 | 21 sed -i /#endif/d include/linux/if_pppol2tp.h |
pascal@11799 | 22 cat >> include/linux/if_pppol2tp.h <<EOT |
pascal@11797 | 23 /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32 |
pascal@11797 | 24 * bits. So we need a different sockaddr structure. |
pascal@11797 | 25 */ |
pascal@11797 | 26 struct pppol2tpv3_addr { |
pascal@11797 | 27 pid_t pid; /* pid that owns the fd. 0 => current */ |
pascal@11797 | 28 int fd; /* FD of UDP or IP socket to use */ |
pascal@11797 | 29 struct sockaddr_in addr; /* IP address and port to send to */ |
pascal@11797 | 30 __u32 s_tunnel, s_session; /* For matching incoming packets */ |
pascal@11797 | 31 __u32 d_tunnel, d_session; /* For sending outgoing packets */ |
pascal@11797 | 32 }; |
pascal@11798 | 33 #endif |
pascal@11797 | 34 EOT |
pascal@11799 | 35 fi |
pankso@16194 | 36 ./configure --prefix=/usr \ |
pascal@1634 | 37 $CONFIGURE_ARGS && |
pascal@1634 | 38 make && |
pascal@11797 | 39 make DESTDIR=$DESTDIR/usr install |
pankso@6 | 40 } |
pankso@6 | 41 |
pankso@6 | 42 # Rules to gen a SliTaz package suitable for Tazpkg. |
pankso@6 | 43 genpkg_rules() |
pankso@6 | 44 { |
pascal@18017 | 45 mkdir -p $fs/usr $fs/var/www/tazpanel/menu.d/network |
pascal@15603 | 46 cp -a $install/usr/sbin $fs/usr |
pankso@16194 | 47 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr |
pascal@15968 | 48 cp -a $stuff/pppnc-server $fs/usr/sbin |
pascal@15968 | 49 ln $fs/usr/sbin/pppnc-server $fs/usr/sbin/pppnc-client |
pascal@18017 | 50 cp -a $stuff/ppp.cgi $fs/var/www/tazpanel |
pascal@18017 | 51 ln -s ../../ppp.cgi $fs/var/www/tazpanel/menu.d/network/ppp |
pascal@18017 | 52 |
pankso@6 | 53 # Config files. |
pascal@15885 | 54 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d |
slaxemulator@9475 | 55 cp $stuff/README.scripts $fs/etc/ppp |
pankso@6 | 56 cp -a $src/etc.ppp/* $fs/etc/ppp |
domcox@12173 | 57 |
pankso@6 | 58 # PPP scripts. |
pankso@6 | 59 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts |
pankso@6 | 60 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts |
pankso@16194 | 61 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \ |
pankso@16194 | 62 $fs/etc/ppp/scripts/ppp-on |
jozee@5104 | 63 |
pankso@6 | 64 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts |
pankso@6 | 65 cp -a $src/scripts/callback $fs/etc/ppp/scripts |
pankso@6 | 66 cp -a $src/scripts/redialer $fs/etc/ppp/scripts |
trixar_za@12286 | 67 cat >> $fs/etc/ppp/ip-up <<EOT |
pascal@15886 | 68 #!/bin/sh |
pascal@15886 | 69 |
pascal@15885 | 70 if [ -x /etc/ppp/ip-up.d/\$6 ]; then |
pascal@15885 | 71 . /etc/ppp/ip-up.d/\$6 "\$@" |
pascal@15885 | 72 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then |
trixar_za@12286 | 73 rm -f /etc/ppp/resolv.prev |
trixar_za@12286 | 74 if [ -f /etc/resolv.conf ]; then |
trixar_za@12286 | 75 cp /etc/resolv.conf /etc/ppp/resolv.prev |
trixar_za@12286 | 76 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf |
trixar_za@12286 | 77 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf |
trixar_za@12286 | 78 cat /etc/ppp/resolv.conf >> /etc/resolv.conf |
trixar_za@12286 | 79 chmod 644 /etc/resolv.conf |
trixar_za@12286 | 80 else |
trixar_za@12286 | 81 cp /etc/ppp/resolv.conf /etc |
trixar_za@12286 | 82 chmod 644 /etc/resolv.conf |
trixar_za@12286 | 83 fi |
trixar_za@12286 | 84 fi |
trixar_za@12286 | 85 EOT |
trixar_za@12286 | 86 cat >> $fs/etc/ppp/ip-down <<EOT |
pascal@15886 | 87 #!/bin/sh |
pascal@15886 | 88 |
pascal@15885 | 89 if [ -x /etc/ppp/ip-down.d/\$6 ]; then |
pascal@15885 | 90 . /etc/ppp/ip-down.d/\$6 "\$@" |
pascal@15885 | 91 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then |
trixar_za@12286 | 92 if [ -f /etc/ppp/resolv.prev ]; then |
trixar_za@12286 | 93 cp -f /etc/ppp/resolv.prev /etc/resolv.conf |
trixar_za@12286 | 94 chmod 644 /etc/resolv.conf |
trixar_za@12286 | 95 else |
trixar_za@12286 | 96 rm -f /etc/resolv.conf |
trixar_za@12286 | 97 fi |
trixar_za@12286 | 98 fi |
trixar_za@12286 | 99 EOT |
trixar_za@12286 | 100 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up |
trixar_za@12286 | 101 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down |
pascal@15885 | 102 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down |
domcox@12173 | 103 |
jozee@5092 | 104 # insert #!/bin/sh on top line in ip* scripts |
pankso@16194 | 105 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null |
jozee@5104 | 106 # add empty peers dir |
jozee@5104 | 107 mkdir -p $fs/etc/ppp/peers |
domcox@12174 | 108 # hide login/pass from regular users |
domcox@12174 | 109 chmod go-rwx $fs/etc/ppp/*secrets |
domcox@12174 | 110 chmod go-rwx $fs/etc/ppp/options |
domcox@12174 | 111 chmod 711 $fs/etc/ppp/scripts/* |
pascal@15886 | 112 } |