# SliTaz package receipt. PACKAGE="awstats" VERSION="7.8" CATEGORY="network" TAGS="log analysis web mail ftp" SHORT_DESC="Log file analyzer." MAINTAINER="erjo@slitaz.org" LICENSE="GPL" WEB_SITE="https://www.awstats.org/" TARBALL="$PACKAGE-$VERSION.tar.gz" WGET_URL="${WEB_SITE}files/$TARBALL" SUGGESTED="perl-geo-ipfree perl-net-xwhois" DEPENDS="perl" # What is the latest version available today? current_version() { wget -O - $WEB_SITE 2>/dev/null | \ sed '/^Last stable/!d;s|.*||;s|<.*||;q' } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/share/awstats/extras mkdir -p $fs/var/www/cgi-bin mkdir -p $fs/var/lib/awstats mkdir -p $fs/etc/awstats mkdir -p $install/usr/share cp -a $src/docs $install/usr/share/doc cp -a $src/wwwroot/classes $fs/usr/share/awstats cp -a $src/wwwroot/css $fs/usr/share/awstats cp -a $src/wwwroot/icon $fs/usr/share/awstats cp -a $src/wwwroot/js $fs/usr/share/awstats cp -a $src/wwwroot/cgi-bin/lang $fs/usr/share/awstats cp -a $src/wwwroot/cgi-bin/lib $fs/usr/share/awstats cp -a $src/wwwroot/cgi-bin/plugins $fs/usr/share/awstats cp -a $src/wwwroot/cgi-bin/awstats.pl $fs/var/www/cgi-bin cp -a $src/wwwroot/cgi-bin/awstats.model.conf \ $fs/etc/awstats cp $stuff/* $fs/usr/share/awstats/extras # Add a link using google map sed -i 's|Full Whois Field"|Full Whois Field ?"|' \ $fs/usr/share/awstats/plugins/hostinfo.pm # Avoid alias conflicts for i in classes css icon do sed -i "s| /$i| /awstats$i|" \ $fs/usr/share/awstats/extras/awstats-apache.conf sed -i "s|\"/$i|\"/awstats$i|" \ $fs/usr/share/awstats/extras/awstats-lighttpd.conf done sed -i -e '/\/css\//d' -e 's|DirIcons="/icon"|DirIcons="/awstatsicon"|' \ $fs/etc/awstats/awstats.model.conf sed -i 's/classes/awstatsclasses/' \ $fs/usr/share/awstats/plugins/graphapplet.pm chown -R root:root $fs find $fs -type f -exec chmod a-x \{\} \; chmod a+x $fs/usr/share/awstats/classes/src/Makefile.pl chmod a+x $fs/usr/share/awstats/extras/update chmod a+x $fs/var/www/cgi-bin/awstats.pl } post_install() { # Set lighttpd or apache config if [ -f "$1/etc/apache/httpd.conf" ] then if [ ! -f "$1/etc/apache/conf.d/awstats.conf" ] then cp "$1/usr/share/awstats/extras/awstats-apache.conf" \ "$1/etc/apache/conf.d/awstats.conf" fi if [ -z "$1" ] then # Start Web server if necessary. if [ -f /var/run/apache/httpd.pid ] then /etc/init.d/apache restart fi fi fi if [ -f "$1/etc/lighttpd/lighttpd.conf" ] then if [ ! -f "$1/etc/lighttpd/awstats.conf" ] then cp "$1/usr/share/awstats/extras/awstats-lighttpd.conf" \ "$1/etc/lighttpd/awstats.conf" fi # Start Web server if necessary. if [ -f /var/run/lighttpd.pid ] then /etc/init.d/lighttpd restart fi fi [ "$quiet" ] || cat <