wok view tazwikiss/receipt @ rev 15973

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