wok-4.x annotate tazwikiss/receipt @ rev 9325
Fix: wbar2 receipt path
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Mar 18 13:08:22 2011 +0100 (2011-03-18) |
parents | bf6db9997f47 |
children | b6feaccd6461 |
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@5859 | 15 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@5859 | 16 genpkg_rules() |
pascal@5859 | 17 { |
slaxemulator@8851 | 18 cp -a $src/$PACKAGE/rootfs/* $fs |
pascal@5859 | 19 chown -R 80.80 $fs/var/www |
pascal@5859 | 20 } |
pascal@5859 | 21 |
pascal@5859 | 22 # Pre and post install commands for Tazpkg. |
pascal@5859 | 23 post_install() |
pascal@5859 | 24 { |
pascal@5859 | 25 server=busybox |
pascal@5859 | 26 # Configure lighttpd server |
pascal@5859 | 27 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
pascal@5859 | 28 server=lighttpd |
pascal@5859 | 29 if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then |
pascal@5859 | 30 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\ |
pascal@5859 | 31 cgi.assign = (\ |
pascal@5859 | 32 ".sh" => "/bin/sh"\ |
pascal@5859 | 33 )\ |
pascal@5859 | 34 index-file.names = ( "index.sh" )\ |
pascal@5859 | 35 }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf |
pascal@5859 | 36 if [ -z "$1" ]; then |
pascal@5859 | 37 # Start Web server. |
pascal@5859 | 38 /etc/init.d/lighttpd stop |
pascal@5859 | 39 /etc/init.d/lighttpd start |
pascal@5859 | 40 fi |
pascal@5859 | 41 fi |
pascal@5859 | 42 fi |
pascal@5859 | 43 # Configure apache server |
pascal@5859 | 44 if [ -f $1/etc/apache/httpd.conf ]; then |
pascal@5859 | 45 server=apache |
pascal@5859 | 46 if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then |
pascal@5859 | 47 cat > $1/etc/apache/conf.d/tazwikiss <<EOT |
pascal@5859 | 48 <DirectoryMatch /var/www/wiki/> |
pascal@5859 | 49 Options +ExecCGI |
pascal@5859 | 50 AddHandler cgi-script .sh |
pascal@5859 | 51 DirectoryIndex index.sh |
pascal@5859 | 52 AllowOverride None |
pascal@5859 | 53 Order allow,deny |
pascal@5859 | 54 Allow from all |
pascal@5859 | 55 </DirectoryMatch> |
pascal@5859 | 56 EOT |
pascal@5859 | 57 if [ -z "$1" ]; then |
pascal@5859 | 58 # Start Web server. |
pascal@5859 | 59 /etc/init.d/apache stop |
pascal@5859 | 60 /etc/init.d/apache start |
pascal@5859 | 61 fi |
pascal@5859 | 62 fi |
pascal@5859 | 63 fi |
pascal@5859 | 64 # Configure busybox/httpd server by default |
pascal@5859 | 65 if [ "$server" == "busybox" ]; then |
pascal@5859 | 66 sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf |
pascal@5859 | 67 if [ ! -s $1/etc/httpd.conf ]; then |
pascal@5859 | 68 cat > $1/etc/httpd.conf <<EOT |
pascal@5859 | 69 H:/var/www |
pascal@5859 | 70 A:0.0.0.0/0 |
pascal@5859 | 71 EOT |
pascal@5859 | 72 fi |
pascal@5859 | 73 while read line; do |
pascal@7124 | 74 grep -q "$line" $1/etc/httpd.conf && continue |
pascal@5859 | 75 echo "$line" >> $1/etc/httpd.conf |
pascal@5859 | 76 done <<EOT |
pascal@5859 | 77 *.sh:/bin/sh |
pascal@5859 | 78 EOT |
pascal@7124 | 79 grep -q ' httpd ' $1/etc/rcS.conf || |
pascal@7124 | 80 sed -i 's/ slim"/ httpd slim"/' $1/etc/rcS.conf |
pascal@5859 | 81 if [ -z "$1" ]; then |
pascal@5859 | 82 # Start Web server. |
pascal@5859 | 83 /etc/init.d/httpd stop |
pascal@5859 | 84 /etc/init.d/httpd start |
pascal@5859 | 85 fi |
pascal@5859 | 86 fi |
pascal@5859 | 87 while read line; do |
pascal@5859 | 88 [ -x $1/$line ] && continue |
pascal@5859 | 89 echo "WARNING: $line not found, $PACKAGE will not work !" |
pascal@5859 | 90 done <<EOT |
pascal@5859 | 91 /usr/sbin/httpd |
pascal@5859 | 92 /usr/bin/httpd_helper.sh |
pascal@5859 | 93 EOT |
pascal@5859 | 94 echo "The default password to edit pages is 'test'" |
pascal@5859 | 95 } |