wok-next view awstats/receipt @ rev 21727

created recipe for vbindiff
author Hans-G?nter Theisgen
date Sat Nov 21 14:32:44 2020 +0100 (2020-11-21)
parents 053a334547a1
children
line source
1 # SliTaz package receipt v2.
3 PACKAGE="awstats"
4 VERSION="7.7"
5 CATEGORY="network"
6 TAGS_std="log analysis web mail ftp"
7 SHORT_DESC="Log file analyzer"
8 MAINTAINER="maintainer@slitaz.org"
9 LICENSE="GPL"
10 WEB_SITE="https://awstats.sourceforge.net/"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
15 DEPENDS_std="perl"
16 SUGGESTED_std="perl-net-xwhois perl-geo-ipfree"
18 HOST_ARCH="any"
20 compile_rules()
21 {
22 mkdir -p \
23 $install/usr/share/awstats/extras/ \
24 $install/var/www/cgi-bin/ \
25 $install/var/lib/awstats/ \
26 $install/etc/awstats/
28 cp -r wwwroot/classes $install/usr/share/awstats/
29 cp -r wwwroot/css $install/usr/share/awstats/
30 cp -r wwwroot/icon $install/usr/share/awstats/
31 cp -r wwwroot/js $install/usr/share/awstats/
32 cp -r wwwroot/cgi-bin/lang $install/usr/share/awstats/
33 cp -r wwwroot/cgi-bin/lib $install/usr/share/awstats/
34 cp -r wwwroot/cgi-bin/plugins $install/usr/share/awstats/
36 cp -r wwwroot/cgi-bin/awstats.pl $install/var/www/cgi-bin/
37 cp -r wwwroot/cgi-bin/awstats.model.conf $install/etc/awstats/
39 cp $stuff/* $install/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 $install/usr/share/awstats/plugins/hostinfo.pm
45 # Avoid alias conflicts
46 for i in classes css icon
47 do
48 sed -i "s| /$i| /awstats$i|" \
49 $install/usr/share/awstats/extras/awstats-apache.conf
50 sed -i "s|\"/$i|\"/awstats$i|" \
51 $install/usr/share/awstats/extras/awstats-lighttpd.conf
52 done
53 sed -i '/\/css\//d; s|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
54 $install/etc/awstats/awstats.model.conf
55 sed -i 's|classes|awstatsclasses|' \
56 $install/usr/share/awstats/plugins/graphapplet.pm
58 chown -R root:root $install
59 find $install -type f -exec chmod a-x '{}' \;
60 chmod a+x \
61 $install/usr/share/awstats/extras/update \
62 $install/var/www/cgi-bin/awstats.pl \
63 $install/usr/share/awstats/classes/src/Makefile.pl
64 }
66 post_install()
67 {
68 # Set lighttpd or apache config
69 if [ -f "$1/etc/apache/httpd.conf" ]; then
70 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
93 [ -n "$quiet" ] || cat <<EOT
95 .-----------------------------------------------.
96 | You should add in your crontab something like |
97 | |
98 | 0 0 * * * /usr/share/awstats/extras/update |
99 '-----------------------------------------------'
100 EOT
101 }
103 post_remove()
104 {
105 # Remove orphan directories
106 [ -d "$1/usr/share/awstats" ] && rm -rf "$1/usr/share/awstats"
108 # FIXME
109 echo "All database and configuration files will be removed"
110 echo -n "Please confirm removing (y/N) : "; read answer
112 case $answer in
113 y|Y) rm -rf "$1/var/lib/awstats" "$1/etc/awstats";;
114 esac
115 }