summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
Diffstat (limited to 'network')
-rw-r--r--network/awstats/README26
-rw-r--r--network/awstats/awstats.SlackBuild86
-rw-r--r--network/awstats/awstats.info8
-rw-r--r--network/awstats/doinst.sh22
-rw-r--r--network/awstats/patches/awstats_configure.pl.patch55
-rw-r--r--network/awstats/patches/httpd-awstats.conf.patch39
-rw-r--r--network/awstats/slack-desc19
7 files changed, 255 insertions, 0 deletions
diff --git a/network/awstats/README b/network/awstats/README
new file mode 100644
index 0000000000..d790a9a2db
--- /dev/null
+++ b/network/awstats/README
@@ -0,0 +1,26 @@
+AWStats is a free, powerful and featureful tool that generates advanced web
+streaming, ftp or mail server statistics, graphically. AWStats works as a
+CGI or from command line and shows you all possible information your log
+contains, in few graphical web pages. It can analyze log files from all
+major server tools like Apache log files and a lot of other web, proxy,
+wap, streaming servers, mail servers and some ftp servers.
+
+There's an automated script (awstats_configure.pl) to prepare the httpd
+config file located in DOCROOT/awstats/tools/ - however, you should not
+need/want to run it; instead, everything should work well if you make the
+changes listed below.
+
+Edit /etc/httpd/httpd.conf (this is a required change to use AWStats):
+Comment this out: CustomLog "/var/log/httpd/access_log" common
+Uncomment this: CustomLog "/var/log/httpd/access_log" combined
+
+Short How-to for using AWStats as CGI:
+
+Add the following include line /etc/httpd/httpd.conf:
+Include /etc/httpd/extra/httpd-awstats.conf
+
+Then restart httpd: "/etc/rc.d/rc.httpd restart"
+
+A sample config file will be placed in /etc/awstats; please read it and
+make the necessary changes for your system. To run awstats, please refer
+to the documentation in the package.
diff --git a/network/awstats/awstats.SlackBuild b/network/awstats/awstats.SlackBuild
new file mode 100644
index 0000000000..8e8a53db4b
--- /dev/null
+++ b/network/awstats/awstats.SlackBuild
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+# Slackware Package Build Script for awstats
+# Home Page http://awstats.sourceforge.net/
+
+# Copyright (c) 2009, Nishant Limbachia (nishant@mnspace.net)
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of script must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Modified by the SlackBuilds.org project.
+
+PRGNAM=awstats
+VERSION=6.9
+ARCH=${ARCH:-noarch}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+DOCROOT=${DOCROOT:-/var/www/htdocs}
+
+AWUSER=${AWUSER:-root}
+AWGROUP=${AWGROUP:-apache}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -eu
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Patch httpd_conf file supplied by awstats to correct paths
+sed s:@DOCROOT@:$DOCROOT: $CWD/patches/httpd-awstats.conf.patch | patch -p0
+# Patch awstats_configure.pl file -- see patch header for details
+sed s:@DOCROOT@:$DOCROOT: $CWD/patches/awstats_configure.pl.patch | patch -p0
+
+mkdir -p $PKG/$DOCROOT/awstats $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKG/etc/awstats $PKG/etc/httpd/extra
+mkdir -m 0770 -p $PKG/var/lib/awstats
+
+cp -a README.TXT docs/* $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a tools wwwroot $PKG/$DOCROOT/awstats
+install -m 0644 wwwroot/cgi-bin/awstats.model.conf $PKG/etc/awstats
+cat tools/httpd_conf >> $PKG/etc/httpd/extra/httpd-awstats.conf.new
+
+# Create a symlink
+mkdir -p $PKG/usr/bin
+ln -sf ${DOCROOT}/awstats/wwwroot/cgi-bin/awstats.pl $PKG/usr/bin/awstats.pl
+
+# Change ownership and perms
+chown -R $AWUSER:$AWGROUP $PKG/$DOCROOT/$PRGNAM $PKG/var/lib/awstats
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
diff --git a/network/awstats/awstats.info b/network/awstats/awstats.info
new file mode 100644
index 0000000000..8787737260
--- /dev/null
+++ b/network/awstats/awstats.info
@@ -0,0 +1,8 @@
+PRGNAM="awstats"
+VERSION="6.9"
+HOMEPAGE="http://awstats.sourceforge.net/"
+DOWNLOAD="http://downloads.sourceforge.net/awstats/awstats-6.9.tar.gz"
+MD5SUM="fc19dbb8449eccf3300efb30ca3376cb"
+MAINTAINER="Nishant Limbachia"
+EMAIL="nishant@mnspace.net"
+APPROVED="dsomero,rworkman"
diff --git a/network/awstats/doinst.sh b/network/awstats/doinst.sh
new file mode 100644
index 0000000000..98ec8af0f0
--- /dev/null
+++ b/network/awstats/doinst.sh
@@ -0,0 +1,22 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+# Keep same perms on rc.heimdal:
+if [ -e etc/httpd/extra/httpd-awstats.conf.new ]; then
+ cp -a etc/httpd/extra/httpd-awstats.conf.new etc/httpd/extra/httpd-awstats.conf.new.incoming
+ cat etc/httpd/extra/httpd-awstats.conf.new > etc/httpd/extra/httpd-awstats.conf.new.incoming
+ mv etc/httpd/extra/httpd-awstats.conf.new.incoming etc/httpd/extra/httpd-awstats.conf.new
+fi
+
+config etc/httpd/extra/httpd-awstats.conf.new
+
diff --git a/network/awstats/patches/awstats_configure.pl.patch b/network/awstats/patches/awstats_configure.pl.patch
new file mode 100644
index 0000000000..2f1e51f5c3
--- /dev/null
+++ b/network/awstats/patches/awstats_configure.pl.patch
@@ -0,0 +1,55 @@
+By Nishant Limbachia <nishant@mnspace.net>
+
+Patch awstats_configure.pl file in case somebody runs it.
+Following things are patched:
+1. Use correct paths
+2. Stop awstats_configure.pl to get the current working directory
+ on first run (use standard path instead)
+3. Added support to restart httpd server for Slackware
+
+--- tools/awstats_configure.pl.orig 2009-01-27 13:23:05.000000000 -0600
++++ tools/awstats_configure.pl 2009-01-27 13:36:46.000000000 -0600
+@@ -28,16 +28,14 @@
+ $AWSTATS_MODEL_CONFIG
+ $AWSTATS_DIRDATA_PATH
+ /;
+-$AWSTATS_PATH='';
+-$AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon';
+-$AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css';
+-$AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes';
+-$AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin';
++$AWSTATS_PATH='@DOCROOT@/awstats';
++$AWSTATS_ICON_PATH='$AWSTATS_PATH/wwwroot/icon';
++$AWSTATS_CSS_PATH='$AWSTATS_PATH/wwwroot/css';
++$AWSTATS_CLASSES_PATH='$AWSTATS_PATH/wwwroot/classes';
++$AWSTATS_CGI_PATH='$AWSTATS_PATH/wwwroot/cgi-bin';
+ $AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used only when configure ran on linux
+ $AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used only when configure ran on linux
+
+-
+-
+ #-------------------------------------------------------
+ # Defines
+ #-------------------------------------------------------
+@@ -306,7 +304,7 @@
+ print "\n-----> Running OS detected: $OSLib{$OS}\n";
+
+ if ($OS eq 'linux') {
+- $AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//;
++ $AWSTATS_PATH =~ s/[\r\n]//;
+ $AWSTATS_PATH=~s/tools[\\\/]?$//;
+ $AWSTATS_PATH=~s/[\\\/]$//;
+ if ($AWSTATS_PATH ne '/usr/local/awstats') {
+@@ -662,6 +660,12 @@
+ print "\n-----> Restart Web server with '$command'\n";
+ my $ret=`$command`;
+ print "$ret";
++ } if (-f "/etc/slackware-version") {
++ # We are on Slackware :)
++ my $command="/etc/rc.d/rc.httpd restart";
++ print "\n-----> Restart Web server with '$command'\n";
++ my $ret=`$command`;
++ print "$ret";
+ } elsif (-x "/sbin/service") {
+ # We are not on debian
+ my $command="/sbin/service httpd restart";
diff --git a/network/awstats/patches/httpd-awstats.conf.patch b/network/awstats/patches/httpd-awstats.conf.patch
new file mode 100644
index 0000000000..da4edd5de2
--- /dev/null
+++ b/network/awstats/patches/httpd-awstats.conf.patch
@@ -0,0 +1,39 @@
+By Nishant Limbachia <nishant@mnspace.net>
+1. Fixup paths for SlackBuilds.org
+2. Tighten default access mode
+
+--- tools/httpd_conf.orig 2009-01-27 10:41:54.000000000 -0600
++++ tools/httpd_conf 2009-01-27 15:04:31.000000000 -0600
+@@ -1,23 +1,19 @@
+ #
+-# Content of this file, with correct values, can be automatically added to
+-# your Apache server by using the AWStats configure.pl tool.
+-#
+-
+-#
+ # Directives to add to your Apache conf file to allow use of AWStats as a CGI.
+-# Note that path "/usr/local/awstats/" must reflect your AWStats install path.
+ #
+-Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
+-Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
+-Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
+-ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
++
++Alias /awstatsclasses "@DOCROOT@/awstats/wwwroot/classes/"
++Alias /awstatscss "@DOCROOT@/awstats/wwwroot/css/"
++Alias /awstatsicons "@DOCROOT@/awstats/wwwroot/icon/"
++ScriptAlias /awstats/ "@DOCROOT@/awstats/wwwroot/cgi-bin/"
+
+ #
+ # This is to permit URL access to scripts/files in AWStats directory.
+ #
+-<Directory "/usr/local/awstats/wwwroot">
++<Directory "@DOCROOT@/awstats/wwwroot">
+ Options None
+ AllowOverride None
+- Order allow,deny
+- Allow from all
++ Order deny,allow
++ Deny from all
++ Allow from localhost
+ </Directory>
diff --git a/network/awstats/slack-desc b/network/awstats/slack-desc
new file mode 100644
index 0000000000..d7c36e5d30
--- /dev/null
+++ b/network/awstats/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+awstats: awstats (log analyzer)
+awstats:
+awstats: AWStats is a free powerful and featureful tool that generates
+awstats: advanced web streaming, ftp, or mail server statistics graphically.
+awstats: AWStats works as a CGI or from command line and shows you all
+awstats: possible information your log contains, in few graphical web pages.
+awstats: It can analyze log files from all major server tools like Apache
+awstats: log files and a lot of other web, proxy, wap, streaming servers,
+awstats: mail servers, and some ftp servers.
+awstats:
+awstats: