wok-next view tazwikiss/receipt @ rev 21005

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