wok annotate awstats/receipt @ rev 11065
Up: awstats to 7.0.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Mon Oct 17 00:42:47 2011 +0000 (2011-10-17) |
parents | a1644dbcf632 |
children | a7b54d88ae54 |
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" |
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 |
pankso@9697 | 34 cp $stuff/* $fs/usr/share/awstats/extras |
pascal@5205 | 35 |
pascal@5205 | 36 # Add a link using google map |
pascal@5205 | 37 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \ |
pascal@5205 | 38 $fs/usr/share/awstats/plugins/hostinfo.pm |
pascal@5959 | 39 |
pascal@5959 | 40 # Avoid alias conflits |
pascal@5959 | 41 for i in classes css icon ; do |
pascal@5959 | 42 sed -i "s| /$i| /awstats$i|" \ |
pascal@5959 | 43 $fs/usr/share/awstats/extras/awstats-apache.conf |
pascal@5959 | 44 sed -i "s|\"/$i|\"/awstats$i|" \ |
pascal@5959 | 45 $fs/usr/share/awstats/extras/awstats-lighttpd.conf |
pascal@5959 | 46 done |
pascal@5959 | 47 sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \ |
pascal@5959 | 48 $fs/etc/awstats/awstats.model.conf |
pascal@5959 | 49 sed -i 's/classes/awstatsclasses/' \ |
pascal@5959 | 50 $fs/usr/share/awstats/plugins/graphapplet.pm |
erjo@2649 | 51 } |
erjo@2649 | 52 |
erjo@2649 | 53 post_install() |
erjo@2649 | 54 { |
erjo@2649 | 55 echo "Processing post-install commands..." |
erjo@2649 | 56 # Set lighttpd or apache config |
erjo@2649 | 57 if [ -f $1/etc/apache/httpd.conf ]; then |
erjo@2649 | 58 if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then |
erjo@2649 | 59 |
pascal@5086 | 60 cp $1/usr/share/awstats/extras/awstats-apache.conf \ |
pascal@5086 | 61 $1/etc/apache/conf.d/awstats.conf |
erjo@2649 | 62 fi |
erjo@2649 | 63 if [ -z "$1" ]; then |
erjo@2649 | 64 # Start Web server if necessary. |
erjo@2649 | 65 if [ -f /var/run/apache/httpd.pid ]; then |
erjo@2649 | 66 /etc/init.d/apache restart |
erjo@2649 | 67 fi |
erjo@2649 | 68 fi |
erjo@2649 | 69 fi |
erjo@2649 | 70 |
erjo@2649 | 71 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
erjo@2649 | 72 if [ ! -f $1/etc/lighttpd/awstats.conf ]; then |
pascal@5086 | 73 cp $1/usr/share/awstats/extras/awstats-lighttpd.conf \ |
pascal@5086 | 74 $1/etc/lighttpd/awstats.conf |
erjo@2649 | 75 fi |
erjo@2649 | 76 # Start Web server if necessary. |
erjo@2649 | 77 if [ -f /var/run/lighttpd.pid ]; then |
erjo@2649 | 78 /etc/init.d/lighttpd restart |
erjo@2649 | 79 fi |
erjo@2649 | 80 fi |
pascal@5959 | 81 cat <<EOT |
pascal@5959 | 82 You should add in your crontab something like; |
pascal@5959 | 83 |
pascal@5959 | 84 0 0 * * * /usr/share/awstats/extras/update |
pascal@5959 | 85 EOT |
erjo@2649 | 86 } |
erjo@2649 | 87 |
erjo@2649 | 88 post_remove() |
erjo@2649 | 89 { |
erjo@2649 | 90 echo "Remove orphan dirctories." |
erjo@2649 | 91 [ -d /usr/share/awstats ] && rm -rf /usr/share/awstats |
erjo@2649 | 92 |
erjo@2649 | 93 # |
erjo@2649 | 94 echo "All database and configuratoin files will be removed" |
erjo@2649 | 95 echo -n "Please confirm removing (y/N) : "; read answer |
erjo@2649 | 96 |
erjo@2649 | 97 case $answer in |
erjo@2649 | 98 y|Y) |
erjo@2649 | 99 rm -rf /var/lib/awstats |
erjo@2649 | 100 rm -rf /etc/awstats |
erjo@2649 | 101 ;; |
erjo@2649 | 102 *) |
erjo@2649 | 103 ;; |
erjo@2649 | 104 esac |
erjo@2649 | 105 |
erjo@2649 | 106 } |