wok-tiny view ppp/receipt @ rev 90

Add some licenses
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jul 05 13:51:26 2013 +0200 (2013-07-05)
parents 263f310ed822
children 371673f39e46
line source
1 # SliTaz package receipt.
3 PACKAGE="ppp"
4 VERSION="2.4.5"
5 CATEGORY="network"
6 SHORT_DESC="Point to Point Protocol (Internet with RTC modems)"
7 MAINTAINER="pascal.bellard@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 [ -n "$TARGET" ] || TARGET="i486"
13 BUILD_DEPENDS="uclibc-cross-compiler-$TARGET"
14 DEPENDS="libdl libgcc_s"
15 CONFIG_FILES="/etc/ppp/"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 cd $src
21 ./configure --prefix=/usr --mandir=/usr/share/man \
22 $CONFIGURE_ARGS &&
23 make CC=uclibc-$TARGET-cc &&
24 make DESTDIR=$PWD/_pkg/usr install
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 mkdir -p $fs/etc/ppp/peers $fs/etc/ppp/scripts $fs/usr/sbin
31 cp -a $_pkg/usr/sbin/pppd $fs/usr/sbin
32 cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
33 cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
34 cp -a stuff/* $fs
35 cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
36 cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts
37 cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
38 cp -a $src/scripts/callback $fs/etc/ppp/scripts
39 cp -a $src/scripts/redialer $fs/etc/ppp/scripts
40 cp -a $src/etc.ppp/* $fs/etc/ppp
41 chmod +x $fs/etc/ppp/ip*
42 # insert #!/bin/sh on top line in ip* scripts
43 sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip*
44 # add empty peers dir
45 sed -i 's:ppp/ppp-on-dialer:ppp/scripts/ppp-on-dialer:' \
46 $fs/etc/ppp/scripts/ppp-on
48 #sed: taz/ppp-2.4.5/fs/etc/ppp/scripts/ppp-on: Not a directory
51 }
53 config_form()
54 {
55 [ -n "$OPTIONS" ] || OPTIONS="lock"
56 [ -n "$LOCAL_IP" ] || LOCAL_IP="0.0.0.0"
57 [ -n "$REMOTE_IP" ] || REMOTE_IP="0.0.0.0"
58 [ -n "$NETMASK" ] || NETMASK="255.255.255.0"
59 cat <<EOT
60 <pre>
61 $(cat $1/etc/ppp/README.scripts)
62 </pre>
63 <table>
64 <tr>
65 <td>Telephone number</td>
66 <td><input type="text" name="TELEPHONE" value="$TELEPHONE" /></td>
67 </tr>
68 <tr>
69 <td>Account name</td>
70 <td><input type="text" name="ACCOUNT" value="$ACCOUNT" /></td>
71 </tr>
72 <tr>
73 <td>Account password</td>
74 <td><input type="text" name="PASSWORD" value="$PASSWORD" /></td>
75 </tr>
76 <tr>
77 <td>callback password</td>
78 <td><input type="text" name="MODEMPASS" value="$MODEMPASS" /></td>
79 </tr>
80 <tr>
81 <td>Options</td>
82 <td><textarea name="OPTIONS" cols="60" wrap="off">
83 $OPTIONS
84 </textarea></td>
85 </tr>
86 <tr>
87 <td></td><td><pre>$(cat $1/etc/ppp/chap-secrets)</pre></td>
88 </tr>
89 <tr>
90 <td>chap-secrets</td>
91 <td><textarea name="CHAPSECRETS" cols="60" wrap="off">
92 $CHAPSECRETS
93 </textarea></td>
94 </tr>
95 <tr>
96 <td></td><td><pre>$(cat $1/etc/ppp/pap-secrets)</pre></td>
97 </tr>
98 <tr>
99 <td>pap-secrets</td>
100 <td><textarea name="PAPSECRETS" cols="60" wrap="off">
101 $PAPSECRETS
102 </textarea></td>
103 </tr>
104 <tr>
105 <td>Connection script</td>
106 <td><select name="DIALER_SCRIPT">
107 <option value="/etc/ppp/ppp-on-dialer">/etc/ppp/ppp-on-dialer</option>
108 <option value="/etc/ppp/scripts/callback"$([ "$DIALER_SCRIPT" == "/etc/ppp/scripts/callback" ] &&
109 echo ' selected="selected"')>/etc/ppp/scripts/callback</option>
110 </select></td>
111 </tr>
112 <tr>
113 <td>local ip</td>
114 <td><input type="text" name="LOCAL_IP" value="$LOCAL_IP" /></td>
115 </tr>
116 <tr>
117 <td>remote ip</td>
118 <td><input type="text" name="REMOTE_IP" value="$REMOTE_IP" /></td>
119 </tr>
120 <tr>
121 <td>netmask</td>
122 <td><input type="text" name="NETMASK" value="$NETMASK" /></td>
123 </tr>
124 </table>
125 EOT
126 }
128 post_install()
129 {
130 rm -f $1/etc/ppp/README.scripts
131 cat > $1/etc/ppp/options <<EOT
132 $OPTIONS
133 EOT
134 cat >> $1/etc/ppp/pap-secrets <<EOT
135 $PAPSECRETS
136 EOT
137 cat >> $1/etc/ppp/chap-secrets <<EOT
138 $CHAPSECRETS
139 EOT
140 sed -i -e "s/^TELEPHONE=.*/TELEPHONE=\"$TELEPHONE\"/" \
141 -e "s/^ACCOUNT=.*/ACCOUNT=\"$ACCOUNT\"/" \
142 -e "s/^PASSWORD=.*/PASSWORD=\"$PASSWORD\"/" \
143 -e "s/^LOCAL_IP=.*/LOCAL_IP=\"$LOCAL_IP\"/" \
144 -e "s/^REMOTE_IP=.*/REMOTE_IP=\"$REMOTE_IP\"/" \
145 -e "s/^NETMASK=.*/NETMASK=\"$NETMASK\"/" \
146 -e "s/^DIALER_SCRIPT=.*/DIALER_SCRIPT=\"$DIALER_SCRIPT\"/" \
147 $1/etc/ppp/scripts/ppp-on
148 sed -i -e "s/^PHONE=.*/PHONE=\"$TELEPHONE\"/" \
149 -e "s/^PASSWORD=.*/PASSWORD=\"$PASSWORD\"/" \
150 -e "s/^ACCOUNT=.*/ACCOUNT=\"$ACCOUNT\"/" \
151 -e "s/^MODEMPASS=.*/MODEMPASS=\"$MODEMPASS\"/" \
152 $1/etc/ppp/scripts/callback
153 }