# HG changeset patch # User Eric Joseph-Alexandre # Date 1240006908 -7200 # Node ID 9c3d6a557b06336de906f953031c77c57ba8f4bb # Parent ac009b72eed0b60d4826e0c68bf6e0007fb0aa6f Add awstats diff -r ac009b72eed0 -r 9c3d6a557b06 awstats/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/awstats/receipt Sat Apr 18 00:21:48 2009 +0200 @@ -0,0 +1,84 @@ +# SliTaz package receipt. + +PACKAGE="awstats" +VERSION="6.9" +CATEGORY="network" +SHORT_DESC="Log file analyzer" +MAINTAINER="erjo@slitaz.org" +DEPENDS="perl" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://awstats.sourceforge.net/" +WGET_URL="http://prdownloads.sourceforge.net/awstats/$TARBALL" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/share/awstats/extras \ + $fs/var/www/cgi-bin \ + $fs/var/lib/awstats \ + $fs/etc/awstats \ + + cp -a $src/wwwroot/classes $fs/usr/share/awstats + cp -a $src/wwwroot/css $fs/usr/share/awstats + cp -a $src/wwwroot/icon $fs/usr/share/awstats + cp -a $src/wwwroot/js $fs/usr/share/awstats + cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats + cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats + cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats + + cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin + cp -a $src/wwwroot/cgi-bin/awstats.model.conf $fs/etc/awstats + + cp stuff/awstats-apache.conf $fs/usr/share/awstats/extras + cp stuff/awstats-lighttpd.conf $fs/usr/share/awstats/extras +} + +post_install() +{ + echo "Processing post-install commands..." + # Set lighttpd or apache config + if [ -f $1/etc/apache/httpd.conf ]; then + if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then + + cp /usr/share/awstats/extras/awstats-apache.conf \ + /etc/apache/conf.d/awstats.conf + fi + if [ -z "$1" ]; then + # Start Web server if necessary. + if [ -f /var/run/apache/httpd.pid ]; then + /etc/init.d/apache restart + fi + fi + fi + + if [ -f $1/etc/lighttpd/lighttpd.conf ]; then + if [ ! -f $1/etc/lighttpd/awstats.conf ]; then + cp /usr/share/awstats/extras/awstats-lighttpd.conf \ + /etc/lighttpd/awstats.conf + fi + # Start Web server if necessary. + if [ -f /var/run/lighttpd.pid ]; then + /etc/init.d/lighttpd restart + fi + fi +} + +post_remove() +{ + echo "Remove orphan dirctories." + [ -d /usr/share/awstats ] && rm -rf /usr/share/awstats + + # + echo "All database and configuratoin files will be removed" + echo -n "Please confirm removing (y/N) : "; read answer + + case $answer in + y|Y) + rm -rf /var/lib/awstats + rm -rf /etc/awstats + ;; + *) + ;; + esac + +} diff -r ac009b72eed0 -r 9c3d6a557b06 awstats/stuff/awstats-apache.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/awstats/stuff/awstats-apache.conf Sat Apr 18 00:21:48 2009 +0200 @@ -0,0 +1,14 @@ +# Config file for running AWStats with Apache + +Alias /classes "/usr/share/awstats/classes/" +Alias /css "/usr//share/awstats//css/" +Alias /icons "/usr//share/awstats//icon/" + +ScriptAlias /stats/ "/var/www/cgi-bin/" + + + Options None + AllowOverride None + Order allow,deny + Allow from all + diff -r ac009b72eed0 -r 9c3d6a557b06 awstats/stuff/awstats-lighttpd.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/awstats/stuff/awstats-lighttpd.conf Sat Apr 18 00:21:48 2009 +0200 @@ -0,0 +1,19 @@ +# Config file for running AWStats with Lighttpd + +index-file.names = ( "awstats.pl" ) + +alias.url = ( + "/classes" => "/usr/share/awstats/classes/", + "/css" => "/usr/share/awstats/css/", + "/stats" => "/var/www/cgi-bin/", + "/icon" => "/usr/share/awstats/icon/" + ) + +# provide awstats cgi-bin access +$HTTP["url"] =~ "/stats" { + cgi.assign = ( ".pl" => "/usr/bin/perl" ) +} + +#url.rewrite-once = ( "^/awstats.pl(.*)" => "/stats/awstats.pl$1" ) + +