wok annotate tazwikiss/receipt @ rev 10471

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