wok-6.x annotate awstats/receipt @ rev 22716

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