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