wok-next view awstats/receipt @ rev 21143

Small updates.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Jan 25 15:37:19 2019 +0200 (2019-01-25)
parents d5aab818505e
children 82485966ceca
line source
1 # SliTaz package receipt v2.
3 PACKAGE="awstats"
4 VERSION="7.0"
5 CATEGORY="network"
6 SHORT_DESC="Log file analyzer"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="GPL"
9 WEB_SITE="https://awstats.sourceforge.io/"
10 HOST_ARCH="any"
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"
17 TAGS_std="log analysis web mail ftp"
19 compile_rules() {
20 mkdir -p \
21 $install/usr/share/awstats/extras/ \
22 $install/var/www/cgi-bin/ \
23 $install/var/lib/awstats/ \
24 $install/etc/awstats/
26 cp -r wwwroot/classes $install/usr/share/awstats/
27 cp -r wwwroot/css $install/usr/share/awstats/
28 cp -r wwwroot/icon $install/usr/share/awstats/
29 cp -r wwwroot/js $install/usr/share/awstats/
30 cp -r wwwroot/cgi-bin/lang $install/usr/share/awstats/
31 cp -r wwwroot/cgi-bin/lib $install/usr/share/awstats/
32 cp -r wwwroot/cgi-bin/plugins $install/usr/share/awstats/
34 cp -r wwwroot/cgi-bin/awstats.pl $install/var/www/cgi-bin/
35 cp -r wwwroot/cgi-bin/awstats.model.conf $install/etc/awstats/
37 cp $stuff/* $install/usr/share/awstats/extras/
39 # Add a link using Google map
40 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \
41 $install/usr/share/awstats/plugins/hostinfo.pm
43 # Avoid alias conflicts
44 for i in classes css icon; do
45 sed -i "s| /$i| /awstats$i|" \
46 $install/usr/share/awstats/extras/awstats-apache.conf
47 sed -i "s|\"/$i|\"/awstats$i|" \
48 $install/usr/share/awstats/extras/awstats-lighttpd.conf
49 done
50 sed -i '/\/css\//d; s|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
51 $install/etc/awstats/awstats.model.conf
52 sed -i 's|classes|awstatsclasses|' \
53 $install/usr/share/awstats/plugins/graphapplet.pm
55 chown -R root:root $install
56 find $install -type f -exec chmod a-x '{}' \;
57 chmod a+x \
58 $install/usr/share/awstats/extras/update \
59 $install/var/www/cgi-bin/awstats.pl \
60 $install/usr/share/awstats/classes/src/Makefile.pl
61 }
63 post_install() {
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
67 cp "$1/usr/share/awstats/extras/awstats-apache.conf" \
68 "$1/etc/apache/conf.d/awstats.conf"
69 fi
70 if [ -z "$1" ]; then
71 # Start Web server if necessary.
72 if [ -f /var/run/apache/httpd.pid ]; then
73 /etc/init.d/apache restart
74 fi
75 fi
76 fi
78 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
79 if [ ! -f "$1/etc/lighttpd/awstats.conf" ]; then
80 cp "$1/usr/share/awstats/extras/awstats-lighttpd.conf" \
81 "$1/etc/lighttpd/awstats.conf"
82 fi
83 # Start Web server if necessary.
84 if [ -f /var/run/lighttpd.pid ]; then
85 /etc/init.d/lighttpd restart
86 fi
87 fi
89 [ -n "$quiet" ] || cat <<EOT
91 .-----------------------------------------------.
92 | You should add in your crontab something like |
93 | |
94 | 0 0 * * * /usr/share/awstats/extras/update |
95 '-----------------------------------------------'
96 EOT
97 }
99 post_remove() {
100 # Remove orphan directories
101 [ -d "$1/usr/share/awstats" ] && rm -rf "$1/usr/share/awstats"
103 # FIXME
104 echo "All database and configuration files will be removed"
105 echo -n "Please confirm removing (y/N) : "; read answer
107 case $answer in
108 y|Y) rm -rf "$1/var/lib/awstats" "$1/etc/awstats";;
109 esac
110 }