wok view tazwikiss/receipt @ rev 13131

gejengel: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 08 13:21:38 2012 +0200 (2012-07-08)
parents 3656016d4910
children 2a21689b0af7
line source
1 # SliTaz package receipt.
3 PACKAGE="tazwikiss"
4 VERSION="1.4"
5 CATEGORY="office"
6 SHORT_DESC="Tiny SliTaz Wiki"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 SOURCE="slitaz-dev-tools"
9 TARBALL="$SOURCE-$VERSION.tar.bz2"
10 WGET_URL="http://hg.slitaz.org/slitaz-dev-tools/archive/$VERSION.tar.bz2"
11 WEB_SITE="http://www.slitaz.org/"
12 CONFIG_FILES="/var/www/wiki/config*.sh"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
17 mkdir -p $DESTDIR 2> /dev/null
18 cp -a $src/$PACKAGE/rootfs/* $DESTDIR
19 }
21 # Rules to gen a SliTaz package suitable for Tazpkg.
22 genpkg_rules()
23 {
24 cp -a $_pkg/* $fs
25 chown -R 80.80 $fs/var/www
26 }
28 # Pre and post install commands for Tazpkg.
29 post_install()
30 {
31 server=busybox
32 # Configure lighttpd server
33 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
34 server=lighttpd
35 if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then
36 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
37 cgi.assign = (\
38 ".sh" => "/bin/sh"\
39 )\
40 index-file.names = ( "index.sh" )\
41 }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf
42 if [ -z "$1" ]; then
43 # Start Web server.
44 /etc/init.d/lighttpd stop
45 /etc/init.d/lighttpd start
46 fi
47 fi
48 fi
49 # Configure apache server
50 if [ -f $1/etc/apache/httpd.conf ]; then
51 server=apache
52 if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then
53 cat > $1/etc/apache/conf.d/tazwikiss <<EOT
54 <DirectoryMatch /var/www/wiki/>
55 Options +ExecCGI
56 AddHandler cgi-script .sh
57 DirectoryIndex index.sh
58 AllowOverride None
59 Order allow,deny
60 Allow from all
61 </DirectoryMatch>
62 EOT
63 if [ -z "$1" ]; then
64 # Start Web server.
65 /etc/init.d/apache stop
66 /etc/init.d/apache start
67 fi
68 fi
69 fi
70 # Configure busybox/httpd server by default
71 if [ "$server" == "busybox" ]; then
72 sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf
73 if [ ! -s $1/etc/httpd.conf ]; then
74 cat > $1/etc/httpd.conf <<EOT
75 H:/var/www
76 A:0.0.0.0/0
77 .xml:text/xml
78 .tgz:application/x-tgz
79 .tar.gz:application/x-tgz
80 .tazpkg:application/x-tazpkg
81 EOT
82 fi
83 while read line; do
84 grep -q "$line" $1/etc/httpd.conf && continue
85 echo "$line" >> $1/etc/httpd.conf
86 done <<EOT
87 *.sh:/bin/sh
88 EOT
89 grep -q ' httpd ' $1/etc/rcS.conf ||
90 sed -i 's/ slim"/ httpd slim"/' $1/etc/rcS.conf
91 if [ -z "$1" ]; then
92 # Start Web server.
93 /etc/init.d/httpd stop
94 /etc/init.d/httpd start
95 fi
96 fi
97 while read line; do
98 [ -x $1/$line ] && continue
99 echo "WARNING: $line not found, $PACKAGE will not work !"
100 done <<EOT
101 /usr/sbin/httpd
102 /usr/lib/slitaz/httpdhelper.sh
103 EOT
104 echo "The default password to edit pages is 'test'"
105 }