wok-6.x diff tazwikiss/receipt @ rev 6544
Up: libtool to 2.4.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Thu Oct 07 00:37:08 2010 +0000 (2010-10-07) |
parents | |
children | 19914b75dc51 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tazwikiss/receipt Thu Oct 07 00:37:08 2010 +0000 1.3 @@ -0,0 +1,90 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="tazwikiss" 1.7 +VERSION="0.3" 1.8 +CATEGORY="office" 1.9 +SHORT_DESC="Tiny SliTaz Wiki" 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +WEB_SITE="http://www.slitaz.org/" 1.12 +CONFIG_FILES="/var/www/wiki/config*.sh" 1.13 + 1.14 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.15 +genpkg_rules() 1.16 +{ 1.17 + cp -a stuff/* $fs 1.18 + chown -R 80.80 $fs/var/www 1.19 +} 1.20 + 1.21 +# Pre and post install commands for Tazpkg. 1.22 +post_install() 1.23 +{ 1.24 + server=busybox 1.25 + # Configure lighttpd server 1.26 + if [ -f $1/etc/lighttpd/lighttpd.conf ]; then 1.27 + server=lighttpd 1.28 + if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then 1.29 + sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\ 1.30 + cgi.assign = (\ 1.31 + ".sh" => "/bin/sh"\ 1.32 + )\ 1.33 + index-file.names = ( "index.sh" )\ 1.34 +}\n\n&|' -i $1/etc/lighttpd/lighttpd.conf 1.35 + if [ -z "$1" ]; then 1.36 + # Start Web server. 1.37 + /etc/init.d/lighttpd stop 1.38 + /etc/init.d/lighttpd start 1.39 + fi 1.40 + fi 1.41 + fi 1.42 + # Configure apache server 1.43 + if [ -f $1/etc/apache/httpd.conf ]; then 1.44 + server=apache 1.45 + if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then 1.46 + cat > $1/etc/apache/conf.d/tazwikiss <<EOT 1.47 +<DirectoryMatch /var/www/wiki/> 1.48 + Options +ExecCGI 1.49 + AddHandler cgi-script .sh 1.50 + DirectoryIndex index.sh 1.51 + AllowOverride None 1.52 + Order allow,deny 1.53 + Allow from all 1.54 +</DirectoryMatch> 1.55 +EOT 1.56 + if [ -z "$1" ]; then 1.57 + # Start Web server. 1.58 + /etc/init.d/apache stop 1.59 + /etc/init.d/apache start 1.60 + fi 1.61 + fi 1.62 + fi 1.63 + # Configure busybox/httpd server by default 1.64 + if [ "$server" == "busybox" ]; then 1.65 + sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf 1.66 + if [ ! -s $1/etc/httpd.conf ]; then 1.67 + cat > $1/etc/httpd.conf <<EOT 1.68 +H:/var/www 1.69 +A:0.0.0.0/0 1.70 +EOT 1.71 + fi 1.72 + while read line; do 1.73 + grep -q "$line" $1/etc/httpd.conf || continue 1.74 + echo "$line" >> $1/etc/httpd.conf 1.75 + done <<EOT 1.76 +I:index.sh 1.77 +*.sh:/bin/sh 1.78 +EOT 1.79 + if [ -z "$1" ]; then 1.80 + # Start Web server. 1.81 + /etc/init.d/httpd stop 1.82 + /etc/init.d/httpd start 1.83 + fi 1.84 + fi 1.85 + while read line; do 1.86 + [ -x $1/$line ] && continue 1.87 + echo "WARNING: $line not found, $PACKAGE will not work !" 1.88 + done <<EOT 1.89 +/usr/sbin/httpd 1.90 +/usr/bin/httpd_helper.sh 1.91 +EOT 1.92 + echo "The default password to edit pages is 'test'" 1.93 +}