wok-4.x rev 2649

Add awstats
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Sat Apr 18 00:21:48 2009 +0200 (2009-04-18)
parents ac009b72eed0
children 176a21b0a0b7
files awstats/receipt awstats/stuff/awstats-apache.conf awstats/stuff/awstats-lighttpd.conf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/awstats/receipt	Sat Apr 18 00:21:48 2009 +0200
     1.3 @@ -0,0 +1,84 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="awstats"
     1.7 +VERSION="6.9"
     1.8 +CATEGORY="network"
     1.9 +SHORT_DESC="Log file analyzer"
    1.10 +MAINTAINER="erjo@slitaz.org"
    1.11 +DEPENDS="perl"
    1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.13 +WEB_SITE="http://awstats.sourceforge.net/"
    1.14 +WGET_URL="http://prdownloads.sourceforge.net/awstats/$TARBALL"
    1.15 +
    1.16 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.17 +genpkg_rules()
    1.18 +{
    1.19 +	mkdir -p $fs/usr/share/awstats/extras \
    1.20 +		$fs/var/www/cgi-bin \
    1.21 +		$fs/var/lib/awstats \
    1.22 +		$fs/etc/awstats \
    1.23 +		
    1.24 +	cp -a $src/wwwroot/classes $fs/usr/share/awstats
    1.25 +	cp -a $src/wwwroot/css $fs/usr/share/awstats
    1.26 +	cp -a $src/wwwroot/icon $fs/usr/share/awstats
    1.27 +	cp -a $src/wwwroot/js $fs/usr/share/awstats
    1.28 +	cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats
    1.29 +	cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats
    1.30 +	cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats
    1.31 +	
    1.32 +	cp -a $src/wwwroot/cgi-bin/awstats.pl  $fs/var/www/cgi-bin
    1.33 +	cp -a $src/wwwroot/cgi-bin/awstats.model.conf  $fs/etc/awstats
    1.34 +	
    1.35 +	cp stuff/awstats-apache.conf $fs/usr/share/awstats/extras
    1.36 +	cp stuff/awstats-lighttpd.conf $fs/usr/share/awstats/extras
    1.37 +}
    1.38 +
    1.39 +post_install()
    1.40 +{
    1.41 +    echo "Processing post-install commands..."
    1.42 +	# Set lighttpd or apache config
    1.43 +	if [ -f $1/etc/apache/httpd.conf ]; then
    1.44 +		if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then
    1.45 +			
    1.46 +			cp /usr/share/awstats/extras/awstats-apache.conf \
    1.47 +				/etc/apache/conf.d/awstats.conf
    1.48 +		fi
    1.49 +		if [ -z "$1" ]; then
    1.50 +			# Start Web server if necessary.
    1.51 +			if [ -f /var/run/apache/httpd.pid ]; then
    1.52 +				/etc/init.d/apache restart
    1.53 +			fi
    1.54 +		fi
    1.55 +	fi
    1.56 +
    1.57 +	if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
    1.58 +		if [ ! -f $1/etc/lighttpd/awstats.conf ]; then
    1.59 +			cp /usr/share/awstats/extras/awstats-lighttpd.conf \
    1.60 +				/etc/lighttpd/awstats.conf			
    1.61 +		fi
    1.62 +					# Start Web server if necessary.
    1.63 +		if [ -f /var/run/lighttpd.pid ]; then
    1.64 +			/etc/init.d/lighttpd restart
    1.65 +		fi
    1.66 +	fi
    1.67 +}
    1.68 +
    1.69 +post_remove()
    1.70 +{
    1.71 +		echo "Remove orphan dirctories."
    1.72 +		[ -d /usr/share/awstats ] && rm -rf /usr/share/awstats
    1.73 +		
    1.74 +		# 
    1.75 +		echo "All database and configuratoin files will be removed"
    1.76 +		echo -n "Please confirm removing (y/N) : "; read answer
    1.77 +		
    1.78 +		case $answer in 
    1.79 +		y|Y)
    1.80 +			rm -rf /var/lib/awstats
    1.81 +			rm -rf /etc/awstats
    1.82 +			;;
    1.83 +		*)
    1.84 +			;;
    1.85 +		esac
    1.86 +		
    1.87 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/awstats/stuff/awstats-apache.conf	Sat Apr 18 00:21:48 2009 +0200
     2.3 @@ -0,0 +1,14 @@
     2.4 +# Config file for running  AWStats with Apache
     2.5 +
     2.6 +Alias /classes "/usr/share/awstats/classes/"
     2.7 +Alias /css "/usr//share/awstats//css/"
     2.8 +Alias /icons "/usr//share/awstats//icon/"
     2.9 +
    2.10 +ScriptAlias /stats/ "/var/www/cgi-bin/"
    2.11 +
    2.12 +<Directory "/var/www/cgi-bin">
    2.13 +	Options None
    2.14 +	AllowOverride None
    2.15 +	Order allow,deny
    2.16 +	Allow from all 
    2.17 +</Directory>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/awstats/stuff/awstats-lighttpd.conf	Sat Apr 18 00:21:48 2009 +0200
     3.3 @@ -0,0 +1,19 @@
     3.4 +# Config file for running  AWStats with Lighttpd
     3.5 +
     3.6 +index-file.names = ( "awstats.pl" )
     3.7 +
     3.8 +alias.url = (
     3.9 +                "/classes" => "/usr/share/awstats/classes/",
    3.10 +                "/css" => "/usr/share/awstats/css/",
    3.11 +                "/stats" => "/var/www/cgi-bin/",
    3.12 +                "/icon" => "/usr/share/awstats/icon/"
    3.13 +              )
    3.14 +			  
    3.15 +# provide awstats cgi-bin access
    3.16 +$HTTP["url"] =~ "/stats" {
    3.17 +      cgi.assign = ( ".pl" => "/usr/bin/perl" )
    3.18 +}
    3.19 +
    3.20 +#url.rewrite-once = ( "^/awstats.pl(.*)" => "/stats/awstats.pl$1" )
    3.21 +
    3.22 +