wok annotate awstats/receipt @ rev 4612

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