wok-tiny view manager/receipt @ rev 35

kernel: no more /proc/config.gz
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Feb 04 18:08:55 2011 +0100 (2011-02-04)
parents
children 8fa973073dd6
line source
1 # SliTaz package receipt.
3 PACKAGE="manager"
4 VERSION="1.0"
5 CATEGORY="network"
6 SHORT_DESC="Tiny SliTaz Web Manager"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 WEB_SITE="http://mirror.slitaz.org/pizza/tiny/"
9 CONFIG_FILES="/etc/httpd.conf"
10 DEPENDS="base-tiny"
11 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 genpkg_rules()
15 {
16 cp -a stuff/. $fs
17 }
19 post_install()
20 {
21 grep -q httpd $1/etc/rcS.conf ||
22 sed -i 's/^RUN_DAEMONS="/&httpd /' $1/etc/rcS.conf
23 grep -q HTTPD_OPTIONS $1/etc/daemons.conf ||
24 cat >> $1/etc/daemons.conf <<EOT
26 # Http daemon options.
27 HTTPD_OPTIONS="-u 0:0"
28 EOT
29 while read line comment ; do
30 grep -qs "^$line" $1/etc/httpd.conf && continue
31 echo "$line $comment" >> $1/etc/httpd.conf
32 done <<EOT
33 H:/var/www # define the server root.
34 I:index.sh # Show index.html when a directory is requested
35 *.sh:/bin/sh # run xxx.sh through an interpreter
36 A:127.0.0.1 # Allow local loopback connections
37 $( . $1/etc/network.conf
38 while [ -n "$IP" ]; do
39 echo "A:$IP/$NETMASK # Allow address from $IP/$NETMASK"
40 IP="$LAN_IP" ; NETMASK="$LAN_NETMASK" ; LAN_IP=""
41 done )
42 D:* # Deny from other IP connections
43 /adm:admin:$MANAGER_PASSWORD # Require user admin, pwd setup on urls starting with /adm/
44 EOT
45 grep -qs "^E404:" $1/etc/httpd.conf || cat >> $1/etc/httpd.conf <<EOT
46 E404:/var/www/E404.html # the 404 (not found) error page
47 EOT
48 }
50 config_form()
51 {
52 [ -n "$MANAGER_PASSWORD" ] || MANAGER_PASSWORD=setup
53 cat <<EOT
54 <table>
55 <tr>
56 <td>Admin password ( for http://the-tiny-server/adm/ )</td>
57 <td><input type="text" name="MANAGER_PASSWORD" value="$MANAGER_PASSWORD" /></td>
58 </tr>
59 </table>
60 EOT
61 }