wok view tazwikiss/receipt @ rev 25161
created recipe for py3k-pillow
author | Hans-G?nter Theisgen |
---|---|
date | Fri Jul 01 10:04:47 2022 +0100 (2022-07-01) |
parents | 02c70d036ea0 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="tazwikiss"
4 VERSION="258"
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 /var/www/wiki/config-de.sh \
14 /var/www/wiki/config-fr.sh"
15 HOST_ARCH="any"
17 current_version()
18 {
19 wget -O - http://hg.slitaz.org/slitaz-dev-tools/ 2>/dev/null | \
20 sed '/^Changeset/!d;s|.*">|http://hg.slitaz.org/slitaz-dev-tools/rev/|;s|<.*||' | \
21 xargs wget -O - 2>/dev/null | sed '/rev /!d;s|.*rev ||;s| .*||'
22 }
24 # Rules to configure and make the package.
25 compile_rules()
26 {
27 mkdir -p $DESTDIR 2>/dev/null
28 cp -a $src/$PACKAGE/rootfs/* $DESTDIR
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 cp -a $install/* $fs
35 chown -R 80.80 $fs/var/www
36 }
38 # Pre and post install commands for Tazpkg.
39 post_install()
40 {
41 server=busybox
42 # Configure lighttpd server
43 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
44 server=lighttpd
45 if ! grep -q '"/wiki/"' "$1/etc/lighttpd/lighttpd.conf"; then
46 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
47 cgi.assign = (\
48 ".sh" => "/bin/sh"\
49 )\
50 index-file.names = ( "index.sh" )\
51 }\n\n&|' -i "$1/etc/lighttpd/lighttpd.conf"
52 if [ -z "$1" ]; then
53 # Start Web server.
54 /etc/init.d/lighttpd stop
55 /etc/init.d/lighttpd start
56 fi
57 fi
58 fi
59 # Configure apache server
60 if [ -f "$1/etc/apache/httpd.conf" ]; then
61 server=apache
62 if [ ! -f "$1/etc/apache/conf.d/tazwikiss" ]; then
63 cat > "$1/etc/apache/conf.d/tazwikiss" <<EOT
64 <DirectoryMatch /var/www/wiki/>
65 Options +ExecCGI
66 AddHandler cgi-script .sh
67 DirectoryIndex index.sh
68 AllowOverride None
69 Order allow,deny
70 Allow from all
71 </DirectoryMatch>
72 EOT
73 if [ -z "$1" ]; then
74 echo
75 # Start Web server.
76 /etc/init.d/apache stop
77 /etc/init.d/apache start
78 fi
79 fi
80 fi
81 # Configure busybox/httpd server by default
82 if [ "$server" = "busybox" ]; then
83 sed -i 's/lighttpd/httpd/' "$1/etc/rcS.conf"
84 if [ ! -s "$1/etc/httpd.conf" ]; then
85 cat > "$1/etc/httpd.conf" <<EOT
86 H:/var/www
87 A:0.0.0.0/0
88 .xml:text/xml
89 .tgz:application/x-tgz
90 .tar.gz:application/x-tgz
91 .tazpkg:application/x-tazpkg
92 EOT
93 fi
94 while read line; do
95 grep -q "$line" "$1/etc/httpd.conf" && continue
96 echo "$line" >> "$1/etc/httpd.conf"
97 done <<EOT
98 *.sh:/bin/sh
99 EOT
100 grep -q ' httpd ' "$1/etc/rcS.conf" ||
101 sed -i 's/ slim"/ httpd slim"/' "$1/etc/rcS.conf"
102 if [ -z "$1" ]; then
103 echo
104 # Start Web server.
105 /etc/init.d/httpd stop
106 /etc/init.d/httpd start
107 fi
108 fi
109 while read line; do
110 [ -x "$1/$line" ] && continue
111 echo "WARNING: $line not found, $PACKAGE will not work!"
112 done <<EOT
113 /usr/sbin/httpd
114 /usr/lib/slitaz/httphelper.sh
115 EOT
116 echo "The default password to edit pages is 'test'"
117 echo
118 }