# SliTaz package receipt. PACKAGE="tazwikiss" VERSION="1.4" CATEGORY="office" SHORT_DESC="Tiny SliTaz Wiki" MAINTAINER="pascal.bellard@slitaz.org" SOURCE="slitaz-dev-tools" TARBALL="$SOURCE-$VERSION.tar.bz2" WGET_URL="http://hg.slitaz.org/slitaz-dev-tools/archive/$VERSION.tar.bz2" WEB_SITE="http://www.slitaz.org/" CONFIG_FILES="/var/www/wiki/config*.sh" # Rules to configure and make the package. compile_rules() { mkdir -p $DESTDIR 2> /dev/null cp -a $src/$PACKAGE/rootfs/* $DESTDIR } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { cp -a $_pkg/* $fs chown -R 80.80 $fs/var/www } # Pre and post install commands for Tazpkg. post_install() { server=busybox # Configure lighttpd server if [ -f $1/etc/lighttpd/lighttpd.conf ]; then server=lighttpd if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\ cgi.assign = (\ ".sh" => "/bin/sh"\ )\ index-file.names = ( "index.sh" )\ }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf if [ -z "$1" ]; then # Start Web server. /etc/init.d/lighttpd stop /etc/init.d/lighttpd start fi fi fi # Configure apache server if [ -f $1/etc/apache/httpd.conf ]; then server=apache if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then cat > $1/etc/apache/conf.d/tazwikiss < Options +ExecCGI AddHandler cgi-script .sh DirectoryIndex index.sh AllowOverride None Order allow,deny Allow from all EOT if [ -z "$1" ]; then # Start Web server. /etc/init.d/apache stop /etc/init.d/apache start fi fi fi # Configure busybox/httpd server by default if [ "$server" == "busybox" ]; then sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf if [ ! -s $1/etc/httpd.conf ]; then cat > $1/etc/httpd.conf <> $1/etc/httpd.conf done <