wok-6.x view awstats/receipt @ rev 23806

linld: add isoboot
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 24 16:16:52 2020 +0000 (2020-05-24)
parents ffecf6ac8f6b
children 5836340a00c2
line source
1 # SliTaz package receipt.
3 PACKAGE="awstats"
4 VERSION="7.7"
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="http://awstats.sourceforge.net/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="https://downloads.sourceforge.net/project/$PACKAGE/AWStats/$VERSION/$TARBALL"
15 DEPENDS="perl"
16 SUGGESTED="perl-net-xwhois perl-geo-ipfree"
18 # Rules to gen a SliTaz package suitable for Tazpkg.
19 genpkg_rules()
20 {
21 mkdir -p $fs/usr/share/awstats/extras \
22 $fs/var/www/cgi-bin \
23 $fs/var/lib/awstats \
24 $fs/etc/awstats \
25 $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 $fs/etc/awstats
39 cp $stuff/* $fs/usr/share/awstats/extras
41 # Add a link using google map
42 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \
43 $fs/usr/share/awstats/plugins/hostinfo.pm
45 # Avoid alias conflicts
46 for i in classes css icon ; do
47 sed -i "s| /$i| /awstats$i|" \
48 $fs/usr/share/awstats/extras/awstats-apache.conf
49 sed -i "s|\"/$i|\"/awstats$i|" \
50 $fs/usr/share/awstats/extras/awstats-lighttpd.conf
51 done
52 sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
53 $fs/etc/awstats/awstats.model.conf
54 sed -i 's/classes/awstatsclasses/' \
55 $fs/usr/share/awstats/plugins/graphapplet.pm
57 chown -R root:root $fs
58 find $fs -type f -exec chmod a-x \{\} \;
59 chmod a+x \
60 $fs/usr/share/awstats/extras/update \
61 $fs/var/www/cgi-bin/awstats.pl \
62 $fs/usr/share/awstats/classes/src/Makefile.pl
63 }
65 post_install()
66 {
67 # Set lighttpd or apache config
68 if [ -f "$1/etc/apache/httpd.conf" ]; then
69 if [ ! -f "$1/etc/apache/conf.d/awstats.conf" ]; then
71 cp "$1/usr/share/awstats/extras/awstats-apache.conf" \
72 "$1/etc/apache/conf.d/awstats.conf"
73 fi
74 if [ -z "$1" ]; then
75 # Start Web server if necessary.
76 if [ -f /var/run/apache/httpd.pid ]; then
77 /etc/init.d/apache restart
78 fi
79 fi
80 fi
82 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
83 if [ ! -f "$1/etc/lighttpd/awstats.conf" ]; then
84 cp "$1/usr/share/awstats/extras/awstats-lighttpd.conf" \
85 "$1/etc/lighttpd/awstats.conf"
86 fi
87 # Start Web server if necessary.
88 if [ -f /var/run/lighttpd.pid ]; then
89 /etc/init.d/lighttpd restart
90 fi
91 fi
92 [ "$quiet" ] || cat <<EOT
94 You should add in your crontab something like;
96 0 0 * * * /usr/share/awstats/extras/update
97 EOT
98 }
100 post_remove()
101 {
102 echo "Remove orphan dirctories."
103 [ -d /usr/share/awstats ] && rm -rf /usr/share/awstats
105 # FIXME
106 echo "All database and configuratoin files will be removed"
107 echo -n "Please confirm removing (y/N) : "; read answer
109 case $answer in
110 y|Y)
111 rm -rf /var/lib/awstats
112 rm -rf /etc/awstats
113 ;;
114 *)
115 ;;
116 esac
117 }