wok view tazwikiss/receipt @ rev 8983
Up: mercurial to 1.8.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Mar 02 15:39:38 2011 +0000 (2011-03-02) |
parents | 2618628083de |
children | 9272b69b5779 |
line source
1 # SliTaz package receipt.
3 PACKAGE="tazwikiss"
4 VERSION="1.0"
5 CATEGORY="office"
6 SHORT_DESC="Tiny SliTaz Wiki"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 BUILD_DEPENDS="mercurial"
9 SOURCE="slitaz-dev-tools"
10 WGET_URL="mercurial|http://hg.slitaz.org/slitaz-dev-tools"
11 BRANCH="$VERSION"
12 WEB_SITE="http://www.slitaz.org/"
13 CONFIG_FILES="/var/www/wiki/config*.sh"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 cp -a $src/$PACKAGE/rootfs/* $fs
19 chown -R 80.80 $fs/var/www
20 }
22 # Pre and post install commands for Tazpkg.
23 post_install()
24 {
25 server=busybox
26 # Configure lighttpd server
27 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
28 server=lighttpd
29 if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then
30 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
31 cgi.assign = (\
32 ".sh" => "/bin/sh"\
33 )\
34 index-file.names = ( "index.sh" )\
35 }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf
36 if [ -z "$1" ]; then
37 # Start Web server.
38 /etc/init.d/lighttpd stop
39 /etc/init.d/lighttpd start
40 fi
41 fi
42 fi
43 # Configure apache server
44 if [ -f $1/etc/apache/httpd.conf ]; then
45 server=apache
46 if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then
47 cat > $1/etc/apache/conf.d/tazwikiss <<EOT
48 <DirectoryMatch /var/www/wiki/>
49 Options +ExecCGI
50 AddHandler cgi-script .sh
51 DirectoryIndex index.sh
52 AllowOverride None
53 Order allow,deny
54 Allow from all
55 </DirectoryMatch>
56 EOT
57 if [ -z "$1" ]; then
58 # Start Web server.
59 /etc/init.d/apache stop
60 /etc/init.d/apache start
61 fi
62 fi
63 fi
64 # Configure busybox/httpd server by default
65 if [ "$server" == "busybox" ]; then
66 sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf
67 if [ ! -s $1/etc/httpd.conf ]; then
68 cat > $1/etc/httpd.conf <<EOT
69 H:/var/www
70 A:0.0.0.0/0
71 EOT
72 fi
73 while read line; do
74 grep -q "$line" $1/etc/httpd.conf && continue
75 echo "$line" >> $1/etc/httpd.conf
76 done <<EOT
77 *.sh:/bin/sh
78 EOT
79 grep -q ' httpd ' $1/etc/rcS.conf ||
80 sed -i 's/ slim"/ httpd slim"/' $1/etc/rcS.conf
81 if [ -z "$1" ]; then
82 # Start Web server.
83 /etc/init.d/httpd stop
84 /etc/init.d/httpd start
85 fi
86 fi
87 while read line; do
88 [ -x $1/$line ] && continue
89 echo "WARNING: $line not found, $PACKAGE will not work !"
90 done <<EOT
91 /usr/sbin/httpd
92 /usr/bin/httpd_helper.sh
93 EOT
94 echo "The default password to edit pages is 'test'"
95 }