wok view awstats/receipt @ rev 24339

updated awstats (7.7 -> 7.8)
author Hans-G?nter Theisgen
date Sat Jan 29 17:28:31 2022 +0100 (2022-01-29)
parents 7aa14b7a600c
children 5f6c5106b1f5
line source
1 # SliTaz package receipt.
3 PACKAGE="awstats"
4 VERSION="7.8"
5 CATEGORY="network"
6 TAGS="log analysis web mail ftp"
7 SHORT_DESC="Log file analyzer."
8 MAINTAINER="erjo@slitaz.org"
9 LICENSE="GPL"
10 WEB_SITE="https://www.awstats.org/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="${WEB_SITE}files/$TARBALL"
15 SUGGESTED="perl-geo-ipfree perl-net-xwhois"
16 DEPENDS="perl"
18 # Rules to gen a SliTaz package suitable for Tazpkg.
19 genpkg_rules()
20 {
21 mkdir -p $fs/usr/share/awstats/extras
22 mkdir -p $fs/var/www/cgi-bin
23 mkdir -p $fs/var/lib/awstats
24 mkdir -p $fs/etc/awstats
25 mkdir -p $install/usr/share
27 cp -a $src/docs $install/usr/share/doc
28 cp -a $src/wwwroot/classes $fs/usr/share/awstats
29 cp -a $src/wwwroot/css $fs/usr/share/awstats
30 cp -a $src/wwwroot/icon $fs/usr/share/awstats
31 cp -a $src/wwwroot/js $fs/usr/share/awstats
32 cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats
33 cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats
34 cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats
36 cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin
37 cp -a $src/wwwroot/cgi-bin/awstats.model.conf \
38 $fs/etc/awstats
40 cp $stuff/* $fs/usr/share/awstats/extras
42 # Add a link using google map
43 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \
44 $fs/usr/share/awstats/plugins/hostinfo.pm
46 # Avoid alias conflicts
47 for i in classes css icon
48 do
49 sed -i "s| /$i| /awstats$i|" \
50 $fs/usr/share/awstats/extras/awstats-apache.conf
51 sed -i "s|\"/$i|\"/awstats$i|" \
52 $fs/usr/share/awstats/extras/awstats-lighttpd.conf
53 done
54 sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
55 $fs/etc/awstats/awstats.model.conf
56 sed -i 's/classes/awstatsclasses/' \
57 $fs/usr/share/awstats/plugins/graphapplet.pm
59 chown -R root:root $fs
60 find $fs -type f -exec chmod a-x \{\} \;
62 chmod a+x $fs/usr/share/awstats/classes/src/Makefile.pl
63 chmod a+x $fs/usr/share/awstats/extras/update
64 chmod a+x $fs/var/www/cgi-bin/awstats.pl
65 }
67 post_install()
68 {
69 # Set lighttpd or apache config
70 if [ -f "$1/etc/apache/httpd.conf" ]
71 then
72 if [ ! -f "$1/etc/apache/conf.d/awstats.conf" ]
73 then
74 cp "$1/usr/share/awstats/extras/awstats-apache.conf" \
75 "$1/etc/apache/conf.d/awstats.conf"
76 fi
77 if [ -z "$1" ]
78 then
79 # Start Web server if necessary.
80 if [ -f /var/run/apache/httpd.pid ]
81 then
82 /etc/init.d/apache restart
83 fi
84 fi
85 fi
87 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
88 then
89 if [ ! -f "$1/etc/lighttpd/awstats.conf" ]
90 then
91 cp "$1/usr/share/awstats/extras/awstats-lighttpd.conf" \
92 "$1/etc/lighttpd/awstats.conf"
93 fi
94 # Start Web server if necessary.
95 if [ -f /var/run/lighttpd.pid ]
96 then
97 /etc/init.d/lighttpd restart
98 fi
99 fi
100 [ "$quiet" ] || cat <<EOT
102 You should add in your crontab something like;
104 0 0 * * * /usr/share/awstats/extras/update
105 EOT
106 }
108 post_remove()
109 {
110 echo "Remove orphan dirctories."
111 [ -d /usr/share/awstats ] &&
112 rm -rf /usr/share/awstats
114 # FIXME
115 echo "All database and configuratoin files will be removed"
116 echo -n "Please confirm removing (y/N) : "
117 read answer
119 case $answer in
120 (y|Y)
121 rm -rf /var/lib/awstats
122 rm -rf /etc/awstats
123 ;;
124 (*)
125 ;;
126 esac
127 }