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