wok-tiny view wiki/receipt @ rev 12

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