wok-tiny view ppp/receipt @ rev 142

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