wok view ppp/receipt @ rev 17820
marlin: fix tests-pathbar.vala
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Mar 22 09:52:23 2015 +0100 (2015-03-22) |
parents | 86575a4745f4 |
children | 22d242cf69af |
line source
1 # SliTaz package receipt.
3 PACKAGE="ppp"
4 VERSION="2.4.5"
5 CATEGORY="network"
6 SHORT_DESC="Implements the Point-to-Point Protocol (PPP)."
7 MAINTAINER="pankso@slitaz.org"
8 LICENSE="BSD GPL"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="http://ppp.samba.org/"
11 WGET_URL="ftp://ftp.samba.org/pub/ppp/$TARBALL"
12 CONFIG_FILES="/etc/ppp"
13 HOST_ARCH="i486 arm"
15 # Rules to configure and make the package.
16 compile_rules()
17 {
18 if ! grep -qs pppol2tpv3_addr include/linux/if_pppol2tp.h ; then
19 sed -i /#endif/d include/linux/if_pppol2tp.h
20 cat >> include/linux/if_pppol2tp.h <<EOT
21 /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
22 * bits. So we need a different sockaddr structure.
23 */
24 struct pppol2tpv3_addr {
25 pid_t pid; /* pid that owns the fd. 0 => current */
26 int fd; /* FD of UDP or IP socket to use */
27 struct sockaddr_in addr; /* IP address and port to send to */
28 __u32 s_tunnel, s_session; /* For matching incoming packets */
29 __u32 d_tunnel, d_session; /* For sending outgoing packets */
30 };
31 #endif
32 EOT
33 fi
34 ./configure --prefix=/usr \
35 $CONFIGURE_ARGS &&
36 make &&
37 make DESTDIR=$DESTDIR/usr install
38 }
40 # Rules to gen a SliTaz package suitable for Tazpkg.
41 genpkg_rules()
42 {
43 mkdir -p $fs/usr
44 cp -a $install/usr/sbin $fs/usr
45 [ -d "$install/usr/lib" ] && cp -a $install/usr/lib $fs/usr
46 cp -a $stuff/pppnc-server $fs/usr/sbin
47 ln $fs/usr/sbin/pppnc-server $fs/usr/sbin/pppnc-client
48 # Config files.
49 mkdir -p $fs/etc/ppp/scripts $fs/etc/ppp/ip-up.d $fs/etc/ppp/ip-down.d
50 cp $stuff/README.scripts $fs/etc/ppp
51 cp -a $src/etc.ppp/* $fs/etc/ppp
53 # PPP scripts.
54 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
55 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
56 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
57 $fs/etc/ppp/scripts/ppp-on
59 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
60 cp -a $src/scripts/callback $fs/etc/ppp/scripts
61 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
62 cat >> $fs/etc/ppp/ip-up <<EOT
63 #!/bin/sh
65 if [ -x /etc/ppp/ip-up.d/\$6 ]; then
66 . /etc/ppp/ip-up.d/\$6 "\$@"
67 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
68 rm -f /etc/ppp/resolv.prev
69 if [ -f /etc/resolv.conf ]; then
70 cp /etc/resolv.conf /etc/ppp/resolv.prev
71 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
72 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
73 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
74 chmod 644 /etc/resolv.conf
75 else
76 cp /etc/ppp/resolv.conf /etc
77 chmod 644 /etc/resolv.conf
78 fi
79 fi
80 EOT
81 cat >> $fs/etc/ppp/ip-down <<EOT
82 #!/bin/sh
84 if [ -x /etc/ppp/ip-down.d/\$6 ]; then
85 . /etc/ppp/ip-down.d/\$6 "\$@"
86 elif [ -n "\$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
87 if [ -f /etc/ppp/resolv.prev ]; then
88 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
89 chmod 644 /etc/resolv.conf
90 else
91 rm -f /etc/resolv.conf
92 fi
93 fi
94 EOT
95 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
96 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
97 chmod 711 $fs/etc/ppp/ip-up $fs/etc/ppp/ip-down
99 # insert #!/bin/sh on top line in ip* scripts
100 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip* 2>/dev/null
101 # add empty peers dir
102 mkdir -p $fs/etc/ppp/peers
103 # hide login/pass from regular users
104 chmod go-rwx $fs/etc/ppp/*secrets
105 chmod go-rwx $fs/etc/ppp/options
106 chmod 711 $fs/etc/ppp/scripts/*
107 }