wok-6.x view tazwikiss/receipt @ rev 10475

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