wok-next view tazwikiss/receipt @ rev 20674
Up putty (0.70)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat May 12 05:17:48 2018 +0300 (2018-05-12) |
parents | 6d2b71cbba60 |
children | cd7906120828 |
line source
1 # SliTaz package receipt.
3 PACKAGE="tazwikiss"
4 VERSION="306"
5 CATEGORY="office"
6 SHORT_DESC="Tiny SliTaz Wiki"
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="BSD"
9 WEB_SITE="http://www.slitaz.org/"
10 CONFIG_FILES="/var/www/wiki/config.sh /var/www/wiki/config-de.sh \
11 /var/www/wiki/config-fr.sh"
13 TARBALL="slitaz-dev-tools-$VERSION.tar.bz2"
14 WGET_URL="http://hg.slitaz.org/slitaz-dev-tools/archive/$VERSION.tar.bz2"
16 DEPENDS="busybox slitaz-base-files"
17 SIBLINGS="mirror-tools qemu-box slitaz-dev-tools slitaz-mercurial-style \
18 tazchroot tazdev yaff"
20 # Rules to configure and make the package.
21 compile_rules()
22 {
23 mkdir -p $DESTDIR 2>/dev/null
24 cp -a $src/$PACKAGE/rootfs/* $DESTDIR
25 }
27 # Rules to gen a SliTaz package suitable for Tazpkg.
28 genpkg_rules()
29 {
30 cp -a $install/* $fs
31 chown -R 80.80 $fs/var/www
32 }
34 # Pre and post install commands for Tazpkg.
35 post_install()
36 {
37 server=busybox
38 # Configure lighttpd server
39 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
40 server=lighttpd
41 if ! grep -q '"/wiki/"' "$1/etc/lighttpd/lighttpd.conf"; then
42 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
43 cgi.assign = (\
44 ".sh" => "/bin/sh"\
45 )\
46 index-file.names = ( "index.sh" )\
47 }\n\n&|' -i "$1/etc/lighttpd/lighttpd.conf"
48 if [ -z "$1" ]; then
49 # Start Web server.
50 /etc/init.d/lighttpd stop
51 /etc/init.d/lighttpd start
52 fi
53 fi
54 fi
55 # Configure apache server
56 if [ -f "$1/etc/apache/httpd.conf" ]; then
57 server=apache
58 if [ ! -f "$1/etc/apache/conf.d/tazwikiss" ]; then
59 cat > "$1/etc/apache/conf.d/tazwikiss" <<EOT
60 <DirectoryMatch /var/www/wiki/>
61 Options +ExecCGI
62 AddHandler cgi-script .sh
63 DirectoryIndex index.sh
64 AllowOverride None
65 Order allow,deny
66 Allow from all
67 </DirectoryMatch>
68 EOT
69 if [ -z "$1" ]; then
70 echo
71 # Start Web server.
72 /etc/init.d/apache stop
73 /etc/init.d/apache start
74 fi
75 fi
76 fi
77 # Configure busybox/httpd server by default
78 if [ "$server" == "busybox" ]; then
79 sed -i 's/lighttpd/httpd/' "$1/etc/rcS.conf"
80 if [ ! -s "$1/etc/httpd.conf" ]; then
81 cat > "$1/etc/httpd.conf" <<EOT
82 H:/var/www
83 A:0.0.0.0/0
84 .xml:text/xml
85 .tgz:application/x-tgz
86 .tar.gz:application/x-tgz
87 .tazpkg:application/x-tazpkg
88 EOT
89 fi
90 while read line; do
91 grep -q "$line" "$1/etc/httpd.conf" && continue
92 echo "$line" >> "$1/etc/httpd.conf"
93 done <<EOT
94 *.sh:/bin/sh
95 EOT
96 grep -q ' httpd ' "$1/etc/rcS.conf" ||
97 sed -i 's/ slim"/ httpd slim"/' "$1/etc/rcS.conf"
98 if [ -z "$1" ]; then
99 echo
100 # Start Web server.
101 /etc/init.d/httpd stop
102 /etc/init.d/httpd start
103 fi
104 fi
106 [ -n "$quiet" ] && return
107 echo -e "The default password to edit pages is 'test'\n"
108 }