wok-current annotate awstats/receipt @ rev 18444

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