wok-tiny annotate wiki/receipt @ rev 86
Add lpd-config
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Aug 21 19:04:10 2012 +0200 (2012-08-21) |
parents | d3c5f3688ec0 |
children | a6d2ddc65590 |
rev | line source |
---|---|
pascal@12 | 1 # SliTaz package receipt. |
pascal@12 | 2 |
pascal@12 | 3 PACKAGE="wiki" |
pascal@12 | 4 VERSION="1.0" |
pascal@12 | 5 CATEGORY="network" |
pascal@12 | 6 SHORT_DESC="Tiny SliTaz Wiki" |
pascal@12 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@55 | 8 WEB_SITE="http://tiny.slitaz.org/" |
pascal@12 | 9 DEPENDS="base-tiny" |
pascal@12 | 10 CONFIG_FILES="/etc/daemons.conf /etc/rcS.conf" |
pascal@12 | 11 |
pascal@12 | 12 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@12 | 13 genpkg_rules() |
pascal@12 | 14 { |
pascal@12 | 15 cp -a stuff/. $fs |
pascal@12 | 16 } |
pascal@12 | 17 |
pascal@12 | 18 post_install() |
pascal@12 | 19 { |
pascal@86 | 20 grep -q inetd $1/etc/rcS.conf || |
pascal@86 | 21 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf |
pascal@86 | 22 grep -q /httpd $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT |
pascal@86 | 23 http stream tcp nowait root /usr/sbin/httpd /usr/sbin/httpd -i -u 0:0 |
pascal@12 | 24 EOT |
pascal@12 | 25 while read line comment ; do |
pascal@12 | 26 grep -qs "^$line" $1/etc/httpd.conf && continue |
pascal@12 | 27 echo "$line $comment" >> $1/etc/httpd.conf |
pascal@12 | 28 done <<EOT |
pascal@12 | 29 H:/var/www # define the server root. |
pascal@12 | 30 I:index.sh # Show index.html when a directory is requested |
pascal@12 | 31 *.sh:/bin/sh # run xxx.sh through an interpreter |
pascal@12 | 32 A:127.0.0.1 # Allow local loopback connections |
pascal@12 | 33 $( . $1/etc/network.conf |
pascal@12 | 34 while [ -n "$IP" ]; do |
pascal@45 | 35 IFS=. ; set -- $IP $NETMASK ; unset IFS |
pascal@45 | 36 echo "A: $(($1 & $5)).$(($2 & $6)).$(($3 & $7)).$(($4 & $8))/$NETMASK" |
pascal@12 | 37 IP="$LAN_IP" ; NETMASK="$LAN_NETMASK" ; LAN_IP="" |
pascal@12 | 38 done ) |
pascal@12 | 39 D:* # Deny from other IP connections |
pascal@12 | 40 EOT |
pascal@12 | 41 sed -i "s/^PASSWORD=.*/PASSWORD=\"$WIKI_PASSWORD\"/" \ |
pascal@12 | 42 $1/var/www/wiki/config*.sh |
pascal@12 | 43 } |
pascal@12 | 44 |
pascal@12 | 45 config_form() |
pascal@12 | 46 { |
pascal@12 | 47 [ -n "$WIKI_PASSWORD" ] || WIKI_PASSWORD=test |
pascal@12 | 48 cat <<EOT |
pascal@12 | 49 <table> |
pascal@12 | 50 <tr> |
pascal@12 | 51 <td>Wiki password</td> |
pascal@12 | 52 <td><input type="text" name="WIKI_PASSWORD" value="$WIKI_PASSWORD" /></td> |
pascal@12 | 53 </tr> |
pascal@12 | 54 </table> |
pascal@12 | 55 EOT |
pascal@12 | 56 } |
pascal@12 | 57 |