wok-next annotate awstats/receipt @ rev 14907

lxinput: up 0.3.2; openbox: fix pipe menu display; slitaz-i18n: add missing core packages; tiny edits.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Aug 02 15:13:41 2013 +0300 (2013-08-02)
parents 3c6cad69d34c
children f4c22f009037
rev   line source
erjo@2649 1 # SliTaz package receipt.
erjo@2649 2
erjo@2649 3 PACKAGE="awstats"
slaxemulator@11065 4 VERSION="7.0"
erjo@2649 5 CATEGORY="network"
erjo@2649 6 SHORT_DESC="Log file analyzer"
erjo@2649 7 MAINTAINER="erjo@slitaz.org"
al@14789 8 WEB_SITE="http://awstats.sourceforge.net/"
al@14789 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
al@14789 10 WGET_URL="http://prdownloads.sourceforge.net/awstats/$TARBALL"
al@14789 11 TAGS="log analyze web mail ftp"
al@14789 12
erjo@2649 13 DEPENDS="perl"
pascal@5204 14 SUGGESTED="perl-net-xwhois"
erjo@2649 15
erjo@2649 16 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@2649 17 genpkg_rules()
erjo@2649 18 {
erjo@2649 19 mkdir -p $fs/usr/share/awstats/extras \
erjo@2649 20 $fs/var/www/cgi-bin \
erjo@2649 21 $fs/var/lib/awstats \
erjo@2649 22 $fs/etc/awstats \
al@14789 23
erjo@2649 24 cp -a $src/wwwroot/classes $fs/usr/share/awstats
erjo@2649 25 cp -a $src/wwwroot/css $fs/usr/share/awstats
erjo@2649 26 cp -a $src/wwwroot/icon $fs/usr/share/awstats
erjo@2649 27 cp -a $src/wwwroot/js $fs/usr/share/awstats
erjo@2649 28 cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats
erjo@2649 29 cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats
erjo@2649 30 cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats
al@14789 31
erjo@2649 32 cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin
erjo@2649 33 cp -a $src/wwwroot/cgi-bin/awstats.model.conf $fs/etc/awstats
al@14789 34
pankso@9697 35 cp $stuff/* $fs/usr/share/awstats/extras
pascal@5205 36
pascal@5205 37 # Add a link using google map
pascal@5205 38 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \
pascal@5205 39 $fs/usr/share/awstats/plugins/hostinfo.pm
pascal@5959 40
al@14789 41 # Avoid alias conflicts
pascal@5959 42 for i in classes css icon ; do
pascal@5959 43 sed -i "s| /$i| /awstats$i|" \
pascal@5959 44 $fs/usr/share/awstats/extras/awstats-apache.conf
pascal@5959 45 sed -i "s|\"/$i|\"/awstats$i|" \
pascal@5959 46 $fs/usr/share/awstats/extras/awstats-lighttpd.conf
pascal@5959 47 done
pascal@5959 48 sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
pascal@5959 49 $fs/etc/awstats/awstats.model.conf
pascal@5959 50 sed -i 's/classes/awstatsclasses/' \
pascal@5959 51 $fs/usr/share/awstats/plugins/graphapplet.pm
al@14789 52
al@14789 53 chown -R root:root $fs
al@14789 54 find $fs -type f -exec chmod a-x \{\} \;
al@14789 55 chmod a+x \
al@14789 56 $fs/usr/share/awstats/extras/update \
al@14789 57 $fs/var/www/cgi-bin/awstats.pl \
al@14789 58 $fs/usr/share/awstats/classes/src/Makefile.pl
erjo@2649 59 }
erjo@2649 60
erjo@2649 61 post_install()
erjo@2649 62 {
al@14789 63 echo "Processing post-install commands..."
erjo@2649 64 # Set lighttpd or apache config
erjo@2649 65 if [ -f $1/etc/apache/httpd.conf ]; then
erjo@2649 66 if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then
erjo@2649 67
pascal@5086 68 cp $1/usr/share/awstats/extras/awstats-apache.conf \
pascal@5086 69 $1/etc/apache/conf.d/awstats.conf
erjo@2649 70 fi
erjo@2649 71 if [ -z "$1" ]; then
erjo@2649 72 # Start Web server if necessary.
erjo@2649 73 if [ -f /var/run/apache/httpd.pid ]; then
erjo@2649 74 /etc/init.d/apache restart
erjo@2649 75 fi
erjo@2649 76 fi
erjo@2649 77 fi
erjo@2649 78
erjo@2649 79 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
erjo@2649 80 if [ ! -f $1/etc/lighttpd/awstats.conf ]; then
pascal@5086 81 cp $1/usr/share/awstats/extras/awstats-lighttpd.conf \
al@14789 82 $1/etc/lighttpd/awstats.conf
erjo@2649 83 fi
erjo@2649 84 # Start Web server if necessary.
erjo@2649 85 if [ -f /var/run/lighttpd.pid ]; then
erjo@2649 86 /etc/init.d/lighttpd restart
erjo@2649 87 fi
erjo@2649 88 fi
pascal@5959 89 cat <<EOT
pascal@5959 90 You should add in your crontab something like;
pascal@5959 91
pascal@5959 92 0 0 * * * /usr/share/awstats/extras/update
pascal@5959 93 EOT
erjo@2649 94 }
erjo@2649 95
erjo@2649 96 post_remove()
erjo@2649 97 {
erjo@2649 98 echo "Remove orphan dirctories."
erjo@2649 99 [ -d /usr/share/awstats ] && rm -rf /usr/share/awstats
al@14789 100
erjo@2649 101 #
erjo@2649 102 echo "All database and configuratoin files will be removed"
erjo@2649 103 echo -n "Please confirm removing (y/N) : "; read answer
al@14789 104
erjo@2649 105 case $answer in
al@14789 106 y|Y)
al@14789 107 rm -rf /var/lib/awstats
al@14789 108 rm -rf /etc/awstats
al@14789 109 ;;
al@14789 110 *)
al@14789 111 ;;
erjo@2649 112 esac
erjo@2649 113 }