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

Add sshpass
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 05 09:25:00 2014 +0100 (2014-11-05)
parents b5bb376d98ad
children d211311bd968
line source
1 # SliTaz package receipt.
3 PACKAGE="tazwikiss"
4 VERSION="2.1.1"
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"
14 HOST_ARCH="any"
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 $install/* $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/lib/slitaz/httphelper.sh
105 EOT
106 echo "The default password to edit pages is 'test'"
107 }