wok-tiny annotate wiki/receipt @ rev 141

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