wok-6.x view ppp/receipt @ rev 14064

shaarli: fix path + security fix
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Feb 20 11:36:45 2013 +0100 (2013-02-20)
parents 8c84f0c8afcb
children b768ede0c5cb
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 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://ppp.samba.org/"
10 WGET_URL="ftp://ftp.samba.org/pub/ppp/$TARBALL"
11 CONFIG_FILES="/etc/ppp"
13 # Rules to configure and make the package.
14 compile_rules()
15 {
16 cd $src
17 if ! grep -qs pppol2tpv3_addr include/linux/if_pppol2tp.h ; then
18 sed -i /#endif/d include/linux/if_pppol2tp.h
19 cat >> include/linux/if_pppol2tp.h <<EOT
20 /* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
21 * bits. So we need a different sockaddr structure.
22 */
23 struct pppol2tpv3_addr {
24 pid_t pid; /* pid that owns the fd. 0 => current */
25 int fd; /* FD of UDP or IP socket to use */
26 struct sockaddr_in addr; /* IP address and port to send to */
27 __u32 s_tunnel, s_session; /* For matching incoming packets */
28 __u32 d_tunnel, d_session; /* For sending outgoing packets */
29 };
30 #endif
31 EOT
32 fi
33 ./configure --prefix=/usr --mandir=/usr/share/man \
34 $CONFIGURE_ARGS &&
35 make &&
36 make DESTDIR=$DESTDIR/usr install
37 }
39 # Rules to gen a SliTaz package suitable for Tazpkg.
40 genpkg_rules()
41 {
42 mkdir -p $fs/usr
43 cp -a $_pkg/usr/sbin $fs/usr
44 cp -a $_pkg/usr/lib $fs/usr
45 # Config files.
46 mkdir -p $fs/etc/ppp/scripts
47 cp $stuff/README.scripts $fs/etc/ppp
48 cp -a $src/etc.ppp/* $fs/etc/ppp
50 # PPP scripts.
51 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
52 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
53 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' $fs/etc/ppp/scripts/ppp-on
55 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
56 cp -a $src/scripts/callback $fs/etc/ppp/scripts
57 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
58 cat >> $fs/etc/ppp/ip-up <<EOT
59 if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
60 rm -f /etc/ppp/resolv.prev
61 if [ -f /etc/resolv.conf ]; then
62 cp /etc/resolv.conf /etc/ppp/resolv.prev
63 grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
64 grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
65 cat /etc/ppp/resolv.conf >> /etc/resolv.conf
66 chmod 644 /etc/resolv.conf
67 else
68 cp /etc/ppp/resolv.conf /etc
69 chmod 644 /etc/resolv.conf
70 fi
71 fi
72 EOT
73 cat >> $fs/etc/ppp/ip-down <<EOT
74 if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
75 if [ -f /etc/ppp/resolv.prev ]; then
76 cp -f /etc/ppp/resolv.prev /etc/resolv.conf
77 chmod 644 /etc/resolv.conf
78 else
79 rm -f /etc/resolv.conf
80 fi
81 fi
82 EOT
83 # cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
84 # cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
85 chmod 711 $fs/etc/ppp/ip*
87 # insert #!/bin/sh on top line in ip* scripts
88 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip*
89 # add empty peers dir
90 mkdir -p $fs/etc/ppp/peers
91 # hide login/pass from regular users
92 chmod go-rwx $fs/etc/ppp/*secrets
93 chmod go-rwx $fs/etc/ppp/options
94 chmod 711 $fs/etc/ppp/scripts/*
95 }