wok-current view awstats/receipt @ rev 6584

Up: libpir, libpir-dev to 1.4.11.4.
author Christopher Rogers <slaxemulator@gmail.com>
date Fri Oct 08 23:49:12 2010 +0000 (2010-10-08)
parents e21766a94165
children a1644dbcf632
line source
1 # SliTaz package receipt.
3 PACKAGE="awstats"
4 VERSION="6.95"
5 CATEGORY="network"
6 SHORT_DESC="Log file analyzer"
7 MAINTAINER="erjo@slitaz.org"
8 DEPENDS="perl"
9 SUGGESTED="perl-net-xwhois"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://awstats.sourceforge.net/"
12 WGET_URL="http://prdownloads.sourceforge.net/awstats/$TARBALL"
13 TAGS="log analyze web mail ftp"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 mkdir -p $fs/usr/share/awstats/extras \
19 $fs/var/www/cgi-bin \
20 $fs/var/lib/awstats \
21 $fs/etc/awstats \
23 cp -a $src/wwwroot/classes $fs/usr/share/awstats
24 cp -a $src/wwwroot/css $fs/usr/share/awstats
25 cp -a $src/wwwroot/icon $fs/usr/share/awstats
26 cp -a $src/wwwroot/js $fs/usr/share/awstats
27 cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats
28 cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats
29 cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats
31 cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin
32 cp -a $src/wwwroot/cgi-bin/awstats.model.conf $fs/etc/awstats
34 cp stuff/* $fs/usr/share/awstats/extras
36 # Add a link using google map
37 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \
38 $fs/usr/share/awstats/plugins/hostinfo.pm
40 # Avoid alias conflits
41 for i in classes css icon ; do
42 sed -i "s| /$i| /awstats$i|" \
43 $fs/usr/share/awstats/extras/awstats-apache.conf
44 sed -i "s|\"/$i|\"/awstats$i|" \
45 $fs/usr/share/awstats/extras/awstats-lighttpd.conf
46 done
47 sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
48 $fs/etc/awstats/awstats.model.conf
49 sed -i 's/classes/awstatsclasses/' \
50 $fs/usr/share/awstats/plugins/graphapplet.pm
51 }
53 post_install()
54 {
55 echo "Processing post-install commands..."
56 # Set lighttpd or apache config
57 if [ -f $1/etc/apache/httpd.conf ]; then
58 if [ ! -f $1/etc/apache/conf.d/awstats.conf ]; then
60 cp $1/usr/share/awstats/extras/awstats-apache.conf \
61 $1/etc/apache/conf.d/awstats.conf
62 fi
63 if [ -z "$1" ]; then
64 # Start Web server if necessary.
65 if [ -f /var/run/apache/httpd.pid ]; then
66 /etc/init.d/apache restart
67 fi
68 fi
69 fi
71 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
72 if [ ! -f $1/etc/lighttpd/awstats.conf ]; then
73 cp $1/usr/share/awstats/extras/awstats-lighttpd.conf \
74 $1/etc/lighttpd/awstats.conf
75 fi
76 # Start Web server if necessary.
77 if [ -f /var/run/lighttpd.pid ]; then
78 /etc/init.d/lighttpd restart
79 fi
80 fi
81 cat <<EOT
82 You should add in your crontab something like;
84 0 0 * * * /usr/share/awstats/extras/update
85 EOT
86 }
88 post_remove()
89 {
90 echo "Remove orphan dirctories."
91 [ -d /usr/share/awstats ] && rm -rf /usr/share/awstats
93 #
94 echo "All database and configuratoin files will be removed"
95 echo -n "Please confirm removing (y/N) : "; read answer
97 case $answer in
98 y|Y)
99 rm -rf /var/lib/awstats
100 rm -rf /etc/awstats
101 ;;
102 *)
103 ;;
104 esac
106 }