wok annotate tazwikiss/receipt @ rev 13772

Up spacefm (0.8.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 03 14:47:00 2013 +0100 (2013-01-03)
parents 3656016d4910
children 2a21689b0af7
rev   line source
pascal@5859 1 # SliTaz package receipt.
pascal@5859 2
pascal@5859 3 PACKAGE="tazwikiss"
pascal@10946 4 VERSION="1.4"
pascal@5859 5 CATEGORY="office"
pascal@5859 6 SHORT_DESC="Tiny SliTaz Wiki"
pascal@5859 7 MAINTAINER="pascal.bellard@slitaz.org"
slaxemulator@8851 8 SOURCE="slitaz-dev-tools"
pankso@10475 9 TARBALL="$SOURCE-$VERSION.tar.bz2"
slaxemulator@10728 10 WGET_URL="http://hg.slitaz.org/slitaz-dev-tools/archive/$VERSION.tar.bz2"
pascal@5859 11 WEB_SITE="http://www.slitaz.org/"
pascal@5859 12 CONFIG_FILES="/var/www/wiki/config*.sh"
pascal@5859 13
pascal@10471 14 # Rules to configure and make the package.
pascal@10471 15 compile_rules()
pascal@10471 16 {
pascal@10471 17 mkdir -p $DESTDIR 2> /dev/null
pascal@10471 18 cp -a $src/$PACKAGE/rootfs/* $DESTDIR
pascal@10471 19 }
pascal@10471 20
pascal@5859 21 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@5859 22 genpkg_rules()
pascal@5859 23 {
pascal@10481 24 cp -a $_pkg/* $fs
pascal@5859 25 chown -R 80.80 $fs/var/www
pascal@5859 26 }
pascal@5859 27
pascal@5859 28 # Pre and post install commands for Tazpkg.
pascal@5859 29 post_install()
pascal@5859 30 {
pascal@5859 31 server=busybox
pascal@5859 32 # Configure lighttpd server
pascal@5859 33 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@5859 34 server=lighttpd
pascal@5859 35 if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then
pascal@5859 36 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\
pascal@5859 37 cgi.assign = (\
pascal@5859 38 ".sh" => "/bin/sh"\
pascal@5859 39 )\
pascal@5859 40 index-file.names = ( "index.sh" )\
pascal@5859 41 }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf
pascal@5859 42 if [ -z "$1" ]; then
pascal@5859 43 # Start Web server.
pascal@5859 44 /etc/init.d/lighttpd stop
pascal@5859 45 /etc/init.d/lighttpd start
pascal@5859 46 fi
pascal@5859 47 fi
pascal@5859 48 fi
pascal@5859 49 # Configure apache server
pascal@5859 50 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@5859 51 server=apache
pascal@5859 52 if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then
pascal@5859 53 cat > $1/etc/apache/conf.d/tazwikiss <<EOT
pascal@5859 54 <DirectoryMatch /var/www/wiki/>
pascal@5859 55 Options +ExecCGI
pascal@5859 56 AddHandler cgi-script .sh
pascal@5859 57 DirectoryIndex index.sh
pascal@5859 58 AllowOverride None
pascal@5859 59 Order allow,deny
pascal@5859 60 Allow from all
pascal@5859 61 </DirectoryMatch>
pascal@5859 62 EOT
pascal@5859 63 if [ -z "$1" ]; then
pascal@5859 64 # Start Web server.
pascal@5859 65 /etc/init.d/apache stop
pascal@5859 66 /etc/init.d/apache start
pascal@5859 67 fi
pascal@5859 68 fi
pascal@5859 69 fi
pascal@5859 70 # Configure busybox/httpd server by default
pascal@5859 71 if [ "$server" == "busybox" ]; then
pascal@5859 72 sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf
pascal@5859 73 if [ ! -s $1/etc/httpd.conf ]; then
pascal@5859 74 cat > $1/etc/httpd.conf <<EOT
pascal@5859 75 H:/var/www
pascal@5859 76 A:0.0.0.0/0
pascal@9514 77 .xml:text/xml
pascal@9514 78 .tgz:application/x-tgz
pascal@9514 79 .tar.gz:application/x-tgz
pascal@9514 80 .tazpkg:application/x-tazpkg
pascal@5859 81 EOT
pascal@5859 82 fi
pascal@5859 83 while read line; do
pascal@7124 84 grep -q "$line" $1/etc/httpd.conf && continue
pascal@5859 85 echo "$line" >> $1/etc/httpd.conf
pascal@5859 86 done <<EOT
pascal@5859 87 *.sh:/bin/sh
pascal@5859 88 EOT
pascal@7124 89 grep -q ' httpd ' $1/etc/rcS.conf ||
pascal@7124 90 sed -i 's/ slim"/ httpd slim"/' $1/etc/rcS.conf
pascal@5859 91 if [ -z "$1" ]; then
pascal@5859 92 # Start Web server.
pascal@5859 93 /etc/init.d/httpd stop
pascal@5859 94 /etc/init.d/httpd start
pascal@5859 95 fi
pascal@5859 96 fi
pascal@5859 97 while read line; do
pascal@5859 98 [ -x $1/$line ] && continue
pascal@5859 99 echo "WARNING: $line not found, $PACKAGE will not work !"
pascal@5859 100 done <<EOT
pascal@5859 101 /usr/sbin/httpd
pascal@13131 102 /usr/lib/slitaz/httpdhelper.sh
pascal@5859 103 EOT
pascal@5859 104 echo "The default password to edit pages is 'test'"
pascal@5859 105 }