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