wok annotate awstats/receipt @ rev 5204

Add perl-net-xwhois
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 30 10:54:38 2010 +0200 (2010-03-30)
parents d815e78b71e4
children e21766a94165
rev   line source
erjo@2649 1 # SliTaz package receipt.
erjo@2649 2
erjo@2649 3 PACKAGE="awstats"
erjo@4690 4 VERSION="6.95"
erjo@2649 5 CATEGORY="network"
erjo@2649 6 SHORT_DESC="Log file analyzer"
erjo@2649 7 MAINTAINER="erjo@slitaz.org"
erjo@2649 8 DEPENDS="perl"
pascal@5204 9 SUGGESTED="perl-net-xwhois"
erjo@2649 10 TARBALL="$PACKAGE-$VERSION.tar.gz"
erjo@2649 11 WEB_SITE="http://awstats.sourceforge.net/"
erjo@2649 12 WGET_URL="http://prdownloads.sourceforge.net/awstats/$TARBALL"
jozee@3564 13 TAGS="log analyze web mail ftp"
erjo@2649 14
erjo@2649 15 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@2649 16 genpkg_rules()
erjo@2649 17 {
erjo@2649 18 mkdir -p $fs/usr/share/awstats/extras \
erjo@2649 19 $fs/var/www/cgi-bin \
erjo@2649 20 $fs/var/lib/awstats \
erjo@2649 21 $fs/etc/awstats \
erjo@2649 22
erjo@2649 23 cp -a $src/wwwroot/classes $fs/usr/share/awstats
erjo@2649 24 cp -a $src/wwwroot/css $fs/usr/share/awstats
erjo@2649 25 cp -a $src/wwwroot/icon $fs/usr/share/awstats
erjo@2649 26 cp -a $src/wwwroot/js $fs/usr/share/awstats
erjo@2649 27 cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats
erjo@2649 28 cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats
erjo@2649 29 cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats
erjo@2649 30
erjo@2649 31 cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin
erjo@2649 32 cp -a $src/wwwroot/cgi-bin/awstats.model.conf $fs/etc/awstats
erjo@2649 33
erjo@2649 34 cp stuff/awstats-apache.conf $fs/usr/share/awstats/extras
erjo@2649 35 cp stuff/awstats-lighttpd.conf $fs/usr/share/awstats/extras
erjo@2649 36 }
erjo@2649 37
erjo@2649 38 post_install()
erjo@2649 39 {
erjo@2649 40 echo "Processing post-install commands..."
erjo@2649 41 # Set lighttpd or apache config
erjo@2649 42 if [ -f $1/etc/apache/httpd.conf ]; then
erjo@2649 43 if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then
erjo@2649 44
pascal@5086 45 cp $1/usr/share/awstats/extras/awstats-apache.conf \
pascal@5086 46 $1/etc/apache/conf.d/awstats.conf
erjo@2649 47 fi
erjo@2649 48 if [ -z "$1" ]; then
erjo@2649 49 # Start Web server if necessary.
erjo@2649 50 if [ -f /var/run/apache/httpd.pid ]; then
erjo@2649 51 /etc/init.d/apache restart
erjo@2649 52 fi
erjo@2649 53 fi
erjo@2649 54 fi
erjo@2649 55
erjo@2649 56 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
erjo@2649 57 if [ ! -f $1/etc/lighttpd/awstats.conf ]; then
pascal@5086 58 cp $1/usr/share/awstats/extras/awstats-lighttpd.conf \
pascal@5086 59 $1/etc/lighttpd/awstats.conf
erjo@2649 60 fi
erjo@2649 61 # Start Web server if necessary.
erjo@2649 62 if [ -f /var/run/lighttpd.pid ]; then
erjo@2649 63 /etc/init.d/lighttpd restart
erjo@2649 64 fi
erjo@2649 65 fi
erjo@2649 66 }
erjo@2649 67
erjo@2649 68 post_remove()
erjo@2649 69 {
erjo@2649 70 echo "Remove orphan dirctories."
erjo@2649 71 [ -d /usr/share/awstats ] && rm -rf /usr/share/awstats
erjo@2649 72
erjo@2649 73 #
erjo@2649 74 echo "All database and configuratoin files will be removed"
erjo@2649 75 echo -n "Please confirm removing (y/N) : "; read answer
erjo@2649 76
erjo@2649 77 case $answer in
erjo@2649 78 y|Y)
erjo@2649 79 rm -rf /var/lib/awstats
erjo@2649 80 rm -rf /etc/awstats
erjo@2649 81 ;;
erjo@2649 82 *)
erjo@2649 83 ;;
erjo@2649 84 esac
erjo@2649 85
erjo@2649 86 }