wok annotate awstats/receipt @ rev 25041

Up fatattr (1.0.1), puzzles (20220128)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 27 17:15:46 2022 +0000 (2022-05-27)
parents 5836340a00c2
children 096ad9edc98b
rev   line source
erjo@2649 1 # SliTaz package receipt.
erjo@2649 2
erjo@2649 3 PACKAGE="awstats"
Hans-G?nter@24339 4 VERSION="7.8"
erjo@2649 5 CATEGORY="network"
Hans-G?nter@20732 6 TAGS="log analysis web mail ftp"
Hans-G?nter@24339 7 SHORT_DESC="Log file analyzer."
erjo@2649 8 MAINTAINER="erjo@slitaz.org"
pascal@15201 9 LICENSE="GPL"
Hans-G?nter@24339 10 WEB_SITE="https://www.awstats.org/"
Hans-G?nter@20732 11
al@14789 12 TARBALL="$PACKAGE-$VERSION.tar.gz"
Hans-G?nter@24339 13 WGET_URL="${WEB_SITE}files/$TARBALL"
al@14789 14
Hans-G?nter@24339 15 SUGGESTED="perl-geo-ipfree perl-net-xwhois"
erjo@2649 16 DEPENDS="perl"
erjo@2649 17
pascal@24340 18 # What is the latest version available today?
pascal@24340 19 current_version()
pascal@24340 20 {
pascal@24340 21 wget -O - $WEB_SITE 2>/dev/null | \
pascal@24340 22 sed '/^Last stable/!d;s|.*<b>||;s|<.*||;q'
pascal@24340 23 }
pascal@24340 24
erjo@2649 25 # Rules to gen a SliTaz package suitable for Tazpkg.
erjo@2649 26 genpkg_rules()
erjo@2649 27 {
Hans-G?nter@24339 28 mkdir -p $fs/usr/share/awstats/extras
Hans-G?nter@24339 29 mkdir -p $fs/var/www/cgi-bin
Hans-G?nter@24339 30 mkdir -p $fs/var/lib/awstats
Hans-G?nter@24339 31 mkdir -p $fs/etc/awstats
Hans-G?nter@24339 32 mkdir -p $install/usr/share
al@14789 33
Hans-G?nter@24339 34 cp -a $src/docs $install/usr/share/doc
Hans-G?nter@24339 35 cp -a $src/wwwroot/classes $fs/usr/share/awstats
Hans-G?nter@24339 36 cp -a $src/wwwroot/css $fs/usr/share/awstats
Hans-G?nter@24339 37 cp -a $src/wwwroot/icon $fs/usr/share/awstats
Hans-G?nter@24339 38 cp -a $src/wwwroot/js $fs/usr/share/awstats
Hans-G?nter@24339 39 cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats
Hans-G?nter@24339 40 cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats
Hans-G?nter@24339 41 cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats
al@14789 42
Hans-G?nter@24339 43 cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin
Hans-G?nter@24339 44 cp -a $src/wwwroot/cgi-bin/awstats.model.conf \
Hans-G?nter@24339 45 $fs/etc/awstats
al@14789 46
Hans-G?nter@24339 47 cp $stuff/* $fs/usr/share/awstats/extras
pascal@5205 48
pascal@5205 49 # Add a link using google map
pascal@5205 50 sed -i 's|Full Whois Field"|Full Whois Field <a href=\\"http://en.utrace.de/?query=".$HostResolved."\\">?</a>"|' \
pascal@5205 51 $fs/usr/share/awstats/plugins/hostinfo.pm
pascal@5959 52
al@14789 53 # Avoid alias conflicts
Hans-G?nter@24339 54 for i in classes css icon
Hans-G?nter@24339 55 do
pascal@5959 56 sed -i "s| /$i| /awstats$i|" \
pascal@5959 57 $fs/usr/share/awstats/extras/awstats-apache.conf
pascal@5959 58 sed -i "s|\"/$i|\"/awstats$i|" \
pascal@5959 59 $fs/usr/share/awstats/extras/awstats-lighttpd.conf
pascal@5959 60 done
pascal@5959 61 sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \
pascal@5959 62 $fs/etc/awstats/awstats.model.conf
pascal@5959 63 sed -i 's/classes/awstatsclasses/' \
pascal@5959 64 $fs/usr/share/awstats/plugins/graphapplet.pm
al@14789 65
Hans-G?nter@24339 66 chown -R root:root $fs
al@14789 67 find $fs -type f -exec chmod a-x \{\} \;
Hans-G?nter@24339 68
Hans-G?nter@24339 69 chmod a+x $fs/usr/share/awstats/classes/src/Makefile.pl
Hans-G?nter@24339 70 chmod a+x $fs/usr/share/awstats/extras/update
Hans-G?nter@24339 71 chmod a+x $fs/var/www/cgi-bin/awstats.pl
erjo@2649 72 }
erjo@2649 73
erjo@2649 74 post_install()
erjo@2649 75 {
erjo@2649 76 # Set lighttpd or apache config
Hans-G?nter@24339 77 if [ -f "$1/etc/apache/httpd.conf" ]
Hans-G?nter@24339 78 then
Hans-G?nter@24339 79 if [ ! -f "$1/etc/apache/conf.d/awstats.conf" ]
Hans-G?nter@24339 80 then
pascal@18730 81 cp "$1/usr/share/awstats/extras/awstats-apache.conf" \
pascal@18730 82 "$1/etc/apache/conf.d/awstats.conf"
erjo@2649 83 fi
Hans-G?nter@24339 84 if [ -z "$1" ]
Hans-G?nter@24339 85 then
erjo@2649 86 # Start Web server if necessary.
Hans-G?nter@24339 87 if [ -f /var/run/apache/httpd.pid ]
Hans-G?nter@24339 88 then
erjo@2649 89 /etc/init.d/apache restart
erjo@2649 90 fi
erjo@2649 91 fi
erjo@2649 92 fi
erjo@2649 93
Hans-G?nter@24339 94 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]
Hans-G?nter@24339 95 then
Hans-G?nter@24339 96 if [ ! -f "$1/etc/lighttpd/awstats.conf" ]
Hans-G?nter@24339 97 then
pascal@18730 98 cp "$1/usr/share/awstats/extras/awstats-lighttpd.conf" \
pascal@18730 99 "$1/etc/lighttpd/awstats.conf"
erjo@2649 100 fi
erjo@2649 101 # Start Web server if necessary.
Hans-G?nter@24339 102 if [ -f /var/run/lighttpd.pid ]
Hans-G?nter@24339 103 then
erjo@2649 104 /etc/init.d/lighttpd restart
erjo@2649 105 fi
erjo@2649 106 fi
pascal@18707 107 [ "$quiet" ] || cat <<EOT
al@18667 108
pascal@5959 109 You should add in your crontab something like;
pascal@5959 110
pascal@5959 111 0 0 * * * /usr/share/awstats/extras/update
pascal@5959 112 EOT
erjo@2649 113 }
erjo@2649 114
erjo@2649 115 post_remove()
erjo@2649 116 {
erjo@2649 117 echo "Remove orphan dirctories."
Hans-G?nter@24339 118 [ -d /usr/share/awstats ] &&
Hans-G?nter@24339 119 rm -rf /usr/share/awstats
al@14789 120
al@18667 121 # FIXME
erjo@2649 122 echo "All database and configuratoin files will be removed"
Hans-G?nter@24339 123 echo -n "Please confirm removing (y/N) : "
Hans-G?nter@24339 124 read answer
al@14789 125
al@18667 126 case $answer in
Hans-G?nter@24339 127 (y|Y)
al@14789 128 rm -rf /var/lib/awstats
al@14789 129 rm -rf /etc/awstats
al@14789 130 ;;
Hans-G?nter@24339 131 (*)
al@14789 132 ;;
erjo@2649 133 esac
erjo@2649 134 }