--- srg-1.3.6.orig/debian/srg.cron.daily +++ srg-1.3.6/debian/srg.cron.daily @@ -0,0 +1,53 @@ +#!/bin/bash +# +# Debian cron script to generate daily SRG reports. Based on the example +# shipped with the SRG package. +# +# You can configure this cronjob by modifying /etc/default/srg +# +# Author: Matt Brown +# Version: $Id: srg.cron.daily 313 2008-01-20 00:54:28Z matt $ + +# Path to SRG binary +SRG=/usr/bin/srg + +# Utility to use for sending mail +MAIL_UTIL=/usr/bin/mail + +# Log Files - Space separated list of logfiles to process +# eg. LOGS="access1.log access2.log access3.log" +LOGS="/var/log/squid/access.log" + +# Get the date range +YESTERDAY=$(date --date "1 day ago" +%Y-%m-%d) + +# Check that the SRG binary exists and is executable +test -x $SRG || exit 0 + +# Read configuration +. /etc/default/srg +if [ -z "$CONFIGFILE" ]; then + # Something is wrong with the configuration. + exit 1 +fi + +# Check that at least one of the specified logfiles exists +found=0 +for log in $LOGS; do + if [ -e $log ]; then + found=1 + fi +done +if [ "$found" -eq "0" ]; then + exit 0 +fi + +# Generate the srg reports +if [ -z $MAILUSER ]; then + $SRG -C $CONFIGFILE -m $DAILY_REPORT_RETAIN_DAYS \ + -f $YESTERDAY -t $YESTERDAY -o $REPORTBASE/daily $LOGS +else + $SRG -M -C $CONFIGFILE -m $DAILY_REPORT_RETAIN_DAYS \ + -f $YESTERDAY -t $YESTERDAY -o $REPORTBASE/daily \ + $LOGS | $MAIL_UTIL -s 'Squid Traffic Report' $MAILUSER +fi --- srg-1.3.6.orig/debian/srg.default +++ srg-1.3.6/debian/srg.default @@ -0,0 +1,22 @@ +# SRG - Default settings +# +# This script is sourced by the Debian SRG cronscripts and can be used to +# control several aspects of their operation as documented below. +# +# Author: Matt Brown +# Version: $Id: srg.default 313 2008-01-20 00:54:28Z matt $ + +# Top level directory for output reports +REPORTBASE=/var/www/srg_reports + +# Configuration file location +CONFIGFILE=/etc/srg/srg.conf + +# If you would like a summary report emailed to you each night, specify +# your email address here +# eg. MAILUSER="srg-daily@yourdomain.com" +MAILUSER="" + +# Number of days to keep daily SRG reports for. Reports older than this many +# days will be automatically removed. +DAILY_REPORT_RETAIN_DAYS="31" --- srg-1.3.6.orig/debian/dirs +++ srg-1.3.6/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +etc/default --- srg-1.3.6.orig/debian/srg.postinst +++ srg-1.3.6/debian/srg.postinst @@ -0,0 +1,31 @@ +#! /bin/sh +# postinst script for SRG +# +# Author: Matt Brown +# Version: $Id:$ +# Released under the GPL v2 + +set -e + +# conffile handling thanks to http://www.dpkg.org/ConffileHandling + +# Move a conffile without triggering a dpkg question +mv_conffile() { + OLDCONFFILE="$1" + NEWCONFFILE="$2" + + if [ -e "$OLDCONFFILE" ]; then + echo "Preserving user changes to $NEWCONFFILE ..." + mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new + mv -f "$OLDCONFFILE" "$NEWCONFFILE" + fi +} + +case "$1" in +configure) + if dpkg --compare-versions "$2" le "1.3.3-2"; then + mv_conffile "/etc/srg/ip2user.txt" "/etc/srg/ip2user" + fi +esac + +#DEBHELPER# --- srg-1.3.6.orig/debian/README.Debian +++ srg-1.3.6/debian/README.Debian @@ -0,0 +1,25 @@ +srg for Debian +-------------- + +The SRG package currently provides a minimal level of interaction with the +squid proxy. In cron.daily there exists a script that will generate reports +for the previous days squid traffic as recorded in /var/log/squid/access.log. +These reports will be output to /var/www/srg_reports/daily. + +By default SRG generates output in /var/www/srg_reports which it assumes is +accessible at http://your-server/srg_reports/. If this is not the case you +will need to edit /etc/srg/srg.conf to modify the output directory and URL. + +SRG will keep 31 days of daily reports in the output directly by default. If +you want to change this number you can do so in /etc/default/srg. + +If you do not supply a header.php, footer.php and style.css in the output +directory, SRG will create these the first time it is run. The default +header.php installed by SRG will read the configuration file in +/etc/srg/srg.conf to determine the page title and the correct URL to load +the stylesheet from. + +IMPORTANT: Make sure you read the notice at the top of header.php before you +modify it or your changes may be overwritten + + -- Matt Brown Thu, 12 May 2005 09:20:34 +1200 --- srg-1.3.6.orig/debian/copyright +++ srg-1.3.6/debian/copyright @@ -0,0 +1,22 @@ +This is srg, written and maintained by Matt Brown +on Sun, 26 Sep 2004 01:54:28 +1200. + +The original source can always be found at: + http://www.crc.net.nz/software/srg.php + +Copyright (C) 2004 University of Waikato + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License with + the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL; + if not, write to the Free Software Foundation, Inc., 51 Franklin St, + Fifth Floor, Boston, MA 02110-1301 USA --- srg-1.3.6.orig/debian/compat +++ srg-1.3.6/debian/compat @@ -0,0 +1 @@ +5 --- srg-1.3.6.orig/debian/control +++ srg-1.3.6/debian/control @@ -0,0 +1,18 @@ +Source: srg +Section: admin +Priority: optional +Maintainer: Matt Brown +Build-Depends: debhelper (>= 5), flex +Standards-Version: 3.8.2 +Homepage: http://www.crc.net.nz/software/srg.php + +Package: srg +Architecture: any +Depends: ${shlibs:Depends} +Recommends: apache2, php5, squid +Description: Fast, Flexible and Detailed log analysis for the Squid Proxy + SRG provides fast and flexible analysis of squid proxy log files while + retaining a high level of detail, including down to the exact URLs visited + by users and the times at which they were visited. SRG also contains support + for generating PHP reports that can be integrated with your existing + authentication system to provide granular access to report output. --- srg-1.3.6.orig/debian/srg.examples +++ srg-1.3.6/debian/srg.examples @@ -0,0 +1 @@ +examples/* --- srg-1.3.6.orig/debian/changelog +++ srg-1.3.6/debian/changelog @@ -0,0 +1,93 @@ +srg (1.3.6-1build1) precise; urgency=low + + * No-change rebuild to drop spurious libsfgcc1 dependency on armhf. + + -- Adam Conrad Fri, 02 Dec 2011 21:24:00 -0700 + +srg (1.3.6-1) unstable; urgency=low + + * New upstream release + * Fixes syntax error in example configuration file. (Closes: #538798) + * Updated Standards-Version to 3.8.2 (no changes required). + + -- Matt Brown Wed, 05 Aug 2009 11:33:16 +0100 + +srg (1.3.5-1) unstable; urgency=low + + * New upstream release. (Closes: #460592) + * Update Standards-Version to 3.7.3 (no changes required). + * Add Homepage pseudo-header to control file. + * Created /etc/default/srg config file to allow for easy manipulation of + cronjob parameters. (Closes: #451368) + + -- Matt Brown Sun, 20 Jan 2008 00:57:09 +0000 + +srg (1.3.4-4) unstable; urgency=low + + * Updated Recommends to newer Apache and PHP packages. (Closes: #429566) + * Clarify default output path behaviour. (Closes: #397557) + * Update standards version and fix lintian warnings. + + -- Matt Brown Sun, 14 Oct 2007 16:42:59 +0100 + +srg (1.3.4-3) unstable; urgency=low + + * Updated maintainer address to mattb@debian.org + + -- Matt Brown Mon, 23 Oct 2006 22:23:54 +1300 + +srg (1.3.4-2) unstable; urgency=low + + * Added maintainer scripts to handle /etc/srg/ip2user.txt conffile which + moved to /etc/srg/ip2user in the 1.3.4-1 release. (Closes: #339976) + * General package tidy-ups + - Now users debhelper compat level 5 + - Now lintian / linda clean + + -- Matt Brown Sat, 3 Dec 2005 12:06:31 +1300 + +srg (1.3.4-1) unstable; urgency=low + + * New upstream release + * Adds initial integration with default Debian squid configuration via + /etc/cron.daily/srg + * Rebuilt for c++ transition + + -- Matt Brown Fri, 7 Oct 2005 21:58:43 +1300 + +srg (1.3.3-2) unstable; urgency=low + + * Closes: #302042: FTBFS: Missing Build-Depends on 'flex' + + -- Matt Brown Wed, 30 Mar 2005 11:33:35 +1200 + +srg (1.3.3-1) unstable; urgency=low + + * Fixed header.php so configuration data is not kept /usr/share/srg + * Ready for initial upload to unstable (Closes: #297530) + + -- Matt Brown Tue, 08 Mar 2005 20:13:24 +1300 + +srg (1.3.2-1) unstable; urgency=low + + * New version of SRG + * Now supports autoconf/automake configuration + * Update debian/ to support Debian policy + + -- Matt Brown Tue, 01 Mar 2005 21:54:32 +1300 + +srg (1.2-1) unstable; urgency=low + + * Update for new version + + -- Matt Brown Wed, 29 Sep 2004 22:41:14 +1200 + +srg (1.1) unstable; urgency=low + + * Initial Release. + + -- Matt Brown Sun, 26 Sep 2004 01:54:28 +1200 + +Local variables: +mode: debian-changelog +End: --- srg-1.3.6.orig/debian/srg.preinst +++ srg-1.3.6/debian/srg.preinst @@ -0,0 +1,33 @@ +#! /bin/sh +# preinst script for SRG +# +# Author: Matt Brown +# Version: $Id:$ +# Released under the GPL v2 + +set -e + +# conffile handling thanks to http://wiki.debian.org/DpkgConffileHandling + +# Prepare to move a conffile without triggering a dpkg question +prep_mv_conffile() { + PKGNAME="$1" + CONFFILE="$2" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" = "$old_md5sum" ]; then + rm -f "$CONFFILE" + fi + fi +} + +case "$1" in +install|upgrade) + if dpkg --compare-versions "$2" le "1.3.3-2"; then + prep_mv_conffile srg "/etc/srg/ip2user.txt" + fi +esac + +#DEBHELPER# --- srg-1.3.6.orig/debian/rules +++ srg-1.3.6/debian/rules @@ -0,0 +1,80 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + + ./configure --prefix=/usr --sysconfdir=/etc + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install DESTDIR=$(CURDIR)/debian/srg + + rm -rf $(CURDIR)/debian/srg/usr/man + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + + dh_installdocs + dh_installexamples -a -X.svn + cp debian/srg/usr/share/doc/srg/examples/srg.conf \ + debian/srg/etc/srg/srg.conf + cp debian/srg.default debian/srg/etc/default/srg + dh_installchangelogs -a ChangeLog + dh_installman doc/srg.man + dh_installcron + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure