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