wok-next view tazwikiss/receipt @ rev 21020
Cleaning is almost finished... I should proceed to upgrades.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Fri Nov 02 14:15:08 2018 +0200 (2018-11-02) |
parents | cd7906120828 |
children |
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 SIBLINGS="mirror-tools qemu-box slitaz-dev-tools slitaz-mercurial-style \
19 tazchroot tazdev yaff"
21 compile_rules() {
22 mkdir -p $install
23 cp -a $src/$PACKAGE/rootfs/* $install
24 }
26 genpkg_rules() {
27 cp -a $install/* $fs
28 chown -R 80.80 $fs/var/www
29 DEPENDS="busybox slitaz-base-files"
30 }
32 post_install() {
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 echo
67 # Start Web server.
68 /etc/init.d/apache stop
69 /etc/init.d/apache start
70 fi
71 fi
72 fi
73 # Configure busybox/httpd server by default
74 if [ "$server" == "busybox" ]; then
75 sed -i 's/lighttpd/httpd/' "$1/etc/rcS.conf"
76 if [ ! -s "$1/etc/httpd.conf" ]; then
77 cat > "$1/etc/httpd.conf" <<EOT
78 H:/var/www
79 A:0.0.0.0/0
80 .xml:text/xml
81 .tgz:application/x-tgz
82 .tar.gz:application/x-tgz
83 .tazpkg:application/x-tazpkg
84 EOT
85 fi
86 while read line; do
87 grep -q "$line" "$1/etc/httpd.conf" && continue
88 echo "$line" >> "$1/etc/httpd.conf"
89 done <<EOT
90 *.sh:/bin/sh
91 EOT
92 grep -q ' httpd ' "$1/etc/rcS.conf" ||
93 sed -i 's/ slim"/ httpd slim"/' "$1/etc/rcS.conf"
94 if [ -z "$1" ]; then
95 echo
96 # Start Web server.
97 /etc/init.d/httpd stop
98 /etc/init.d/httpd start
99 fi
100 fi
102 [ -n "$quiet" ] && return
103 echo -e "The default password to edit pages is 'test'\n"
104 }