wok diff webalizer/receipt @ rev 1843

webalizer: add post_install
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 11 21:13:04 2008 +0000 (2008-12-11)
parents 690da2cb396e
children f606ce8506ca
line diff
     1.1 --- a/webalizer/receipt	Sat Nov 08 13:59:35 2008 +0000
     1.2 +++ b/webalizer/receipt	Thu Dec 11 21:13:04 2008 +0000
     1.3 @@ -8,7 +8,7 @@
     1.4  TARBALL="$PACKAGE-$VERSION-src.tar.bz2"
     1.5  WEB_SITE="http://www.webalizer.com/"
     1.6  WGET_URL="ftp://ftp.mrunix.net/pub/$PACKAGE/$TARBALL"
     1.7 -DEPENDS="libgd zlib db"
     1.8 +DEPENDS="libgd zlib db apache"
     1.9  BUILD_DEPENDS="libgd libgd-dev zlib-dev db db-dev"
    1.10  
    1.11  # Rules to configure and make the package.
    1.12 @@ -24,8 +24,20 @@
    1.13  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.14  genpkg_rules()
    1.15  {
    1.16 -	mkdir -p $fs/usr $fs/etc
    1.17 +	mkdir -p $fs/usr $fs/etc $fs/var/www/webalizer
    1.18 +	chown 80 $fs/var/www/webalizer
    1.19  	cp -a $_pkg/etc/webalizer.conf.sample $fs/etc/webalizer.conf
    1.20  	cp -a $_pkg/usr/bin $fs/usr
    1.21  }
    1.22  
    1.23 +# Pre and post install commands for Tazpkg.
    1.24 +post_install()
    1.25 +{
    1.26 +	if [ -z "$1" ]; then
    1.27 +		webalizer -o /var/www/webalizer /var/log/apache/access_log 
    1.28 +		crontab -l 2> /dev/null | grep -q webalizer || crontab - << EOT
    1.29 +$(crontab -l 2> /dev/null)
    1.30 +30 0 * * * /usr/bin/webalizer -o /var/www/webalizer /var/log/apache/access_log
    1.31 +EOT
    1.32 +	fi
    1.33 +}