wok annotate tazwikiss/receipt @ rev 6899

Up: libsdl-gfx to 2.0.22.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Oct 21 10:52:43 2010 +0000 (2010-10-21)
parents
children 19914b75dc51
rev   line source
pascal@5859 1 # SliTaz package receipt.
pascal@5859 2
pascal@5859 3 PACKAGE="tazwikiss"
pascal@5859 4 VERSION="0.3"
pascal@5859 5 CATEGORY="office"
pascal@5859 6 SHORT_DESC="Tiny SliTaz Wiki"
pascal@5859 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@5859 8 WEB_SITE="http://www.slitaz.org/"
pascal@5859 9 CONFIG_FILES="/var/www/wiki/config*.sh"
pascal@5859 10
pascal@5859 11 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@5859 12 genpkg_rules()
pascal@5859 13 {
pascal@5859 14 cp -a stuff/* $fs
pascal@5859 15 chown -R 80.80 $fs/var/www
pascal@5859 16 }
pascal@5859 17
pascal@5859 18 # Pre and post install commands for Tazpkg.
pascal@5859 19 post_install()
pascal@5859 20 {
pascal@5859 21 server=busybox
pascal@5859 22 # Configure lighttpd server
pascal@5859 23 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@5859 24 server=lighttpd
pascal@5859 25 if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then
pascal@5859 26 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
pascal@5859 27 cgi.assign = (\
pascal@5859 28 ".sh" => "/bin/sh"\
pascal@5859 29 )\
pascal@5859 30 index-file.names = ( "index.sh" )\
pascal@5859 31 }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf
pascal@5859 32 if [ -z "$1" ]; then
pascal@5859 33 # Start Web server.
pascal@5859 34 /etc/init.d/lighttpd stop
pascal@5859 35 /etc/init.d/lighttpd start
pascal@5859 36 fi
pascal@5859 37 fi
pascal@5859 38 fi
pascal@5859 39 # Configure apache server
pascal@5859 40 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@5859 41 server=apache
pascal@5859 42 if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then
pascal@5859 43 cat > $1/etc/apache/conf.d/tazwikiss <<EOT
pascal@5859 44 <DirectoryMatch /var/www/wiki/>
pascal@5859 45 Options +ExecCGI
pascal@5859 46 AddHandler cgi-script .sh
pascal@5859 47 DirectoryIndex index.sh
pascal@5859 48 AllowOverride None
pascal@5859 49 Order allow,deny
pascal@5859 50 Allow from all
pascal@5859 51 </DirectoryMatch>
pascal@5859 52 EOT
pascal@5859 53 if [ -z "$1" ]; then
pascal@5859 54 # Start Web server.
pascal@5859 55 /etc/init.d/apache stop
pascal@5859 56 /etc/init.d/apache start
pascal@5859 57 fi
pascal@5859 58 fi
pascal@5859 59 fi
pascal@5859 60 # Configure busybox/httpd server by default
pascal@5859 61 if [ "$server" == "busybox" ]; then
pascal@5859 62 sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf
pascal@5859 63 if [ ! -s $1/etc/httpd.conf ]; then
pascal@5859 64 cat > $1/etc/httpd.conf <<EOT
pascal@5859 65 H:/var/www
pascal@5859 66 A:0.0.0.0/0
pascal@5859 67 EOT
pascal@5859 68 fi
pascal@5859 69 while read line; do
pascal@5859 70 grep -q "$line" $1/etc/httpd.conf || continue
pascal@5859 71 echo "$line" >> $1/etc/httpd.conf
pascal@5859 72 done <<EOT
pascal@5859 73 I:index.sh
pascal@5859 74 *.sh:/bin/sh
pascal@5859 75 EOT
pascal@5859 76 if [ -z "$1" ]; then
pascal@5859 77 # Start Web server.
pascal@5859 78 /etc/init.d/httpd stop
pascal@5859 79 /etc/init.d/httpd start
pascal@5859 80 fi
pascal@5859 81 fi
pascal@5859 82 while read line; do
pascal@5859 83 [ -x $1/$line ] && continue
pascal@5859 84 echo "WARNING: $line not found, $PACKAGE will not work !"
pascal@5859 85 done <<EOT
pascal@5859 86 /usr/sbin/httpd
pascal@5859 87 /usr/bin/httpd_helper.sh
pascal@5859 88 EOT
pascal@5859 89 echo "The default password to edit pages is 'test'"
pascal@5859 90 }