--- queuegraph-1.1.1.orig/queuegraph/count.sh +++ queuegraph-1.1.1/queuegraph/count.sh @@ -12,12 +12,12 @@ # 2003/04/14 Ralf Hildebrandz # Change this to the location where your RRD is stored: -cd /etc/postfix -PATH=/usr/local/rrdtool-1.0.48/bin:/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/bin:/usr/sbin: +cd /var/lib/queuegraph +PATH=/usr/bin:/usr/sbin: #set -x qdir=`postconf -h queue_directory` active=`find $qdir/incoming $qdir/active $qdir/maildrop -type f -print | wc -l | awk '{print $1}'` deferred=`find $qdir/deferred -type f -print | wc -l | awk '{print $1}'` #printf "active: %d\ndeferred: %d\n" $active $deferred -rrdtool update /etc/postfix/mailqueues.rrd "N:$active:$deferred" +rrdtool update /var/lib/queuegraph/queuegraph.rrd "N:$active:$deferred" --- queuegraph-1.1.1.orig/queuegraph.cgi +++ queuegraph-1.1.1/queuegraph.cgi @@ -16,10 +16,9 @@ my $points_per_sample = 3; my $ypoints = 160; my $ypoints_err = 80; -my $rrd = '/etc/postfix/mailqueues.rrd'; # path to where the RRD database is -my $tmp_dir = '/tmp/queuegraph'; # temporary directory where to store the images +my $rrd = '/var/lib/queuegraph/queuegraph.rrd'; # path to the RRD database +my $tmp_dir = '/var/cache/queuegraph'; # tmp directory where to store the images my $rrdtool_1_0 = ($RRDs::VERSION < 1.199908); - my @graphs = ( { title => 'Day Graph', seconds => 3600*24, }, { title => 'Week Graph', seconds => 3600*24*7, }, @@ -92,7 +91,9 @@ print "

Postfix Queue Statistics for $host

\n"; for my $n (0..$#graphs) { + print '
'; print "

$graphs[$n]{title}

\n"; + print "
\n"; print "

\"queuegraph\"\n"; } --- queuegraph-1.1.1.orig/debian/dirs +++ queuegraph-1.1.1/debian/dirs @@ -0,0 +1,4 @@ +usr/share/queuegraph +usr/lib/cgi-bin +var/lib/queuegraph +var/cache/queuegraph --- queuegraph-1.1.1.orig/debian/control +++ queuegraph-1.1.1/debian/control @@ -0,0 +1,18 @@ +Source: queuegraph +Section: admin +Priority: extra +Maintainer: Conall O'Brien +Build-Depends: debhelper (>= 4.0.0) +Standards-Version: 3.7.2 + +Package: queuegraph +Architecture: all +Depends: postfix, perl, rrdtool, librrds-perl +Recommends: apache2 | httpd-cgi +Suggests: mailgraph +Description: a RRDtool frontend for Postfix queue-statistics + Queuegraph is a simple mail statistics RRDtool frontend for Postfix + that produces daily, weekly, monthly and yearly graphs of Postfix's + active, deferred, incoming and bounce queues. + . + Homepage: http://www.stahl.bau.tu-bs.de/~hildeb/postfix/queuegraph/ --- queuegraph-1.1.1.orig/debian/changelog +++ queuegraph-1.1.1/debian/changelog @@ -0,0 +1,44 @@ +queuegraph (1.1.1-3) unstable; urgency=low + + * Ensure www-user is the owner of /var/cache/queuegraph (Closes: #398854) + + -- Conall O'Brien Fri, 17 Nov 2006 11:35:43 +0000 + +queuegraph (1.1.1-2) unstable; urgency=low + + * Missing dependancy (Closes: #388760) + + -- Conall O'Brien Fri, 22 Sep 2006 14:27:39 +0100 + +queuegraph (1.1.1-1) unstable; urgency=low + + * Complete repackage of upstream 1.1 source, to allow for better management + of patches to upstream + + * Moved /var/tmp/queuegraph to /var/cache/queuegraph to prevent symlink + attacks + + -- Conall O'Brien Thu, 21 Sep 2006 22:38:08 +0100 + +queuegraph (1.1.0-3) unstable; urgency=low + + * Beautify queuegraph, so it looks similar to mailgraph (Closes: #387160) + + -- Conall O'Brien Wed, 13 Sep 2006 00:32:00 +0100 + +queuegraph (1.1.0-2) unstable; urgency=low + + * Addressed minor goofs in postinst script (Closes: #386843) + + * Added "set -e" to postinst and postrm + + * Added check for preexisting rrd DB in postinst + + -- Conall O'Brien Sun, 10 Sep 2006 17:37:21 +0100 + +queuegraph (1.1.0-1) unstable; urgency=low + + * Initial package of 1.1 upstream release - closes #325173. + + -- Conall O'Brien Fri, 01 Sep 2006 09:07:48 +0100 + --- queuegraph-1.1.1.orig/debian/compat +++ queuegraph-1.1.1/debian/compat @@ -0,0 +1 @@ +4 --- queuegraph-1.1.1.orig/debian/postinst +++ queuegraph-1.1.1/debian/postinst @@ -0,0 +1,47 @@ +#!/bin/sh + +set -e + +DATADIR=/var/lib/queuegraph +CACHEDIR=/var/cache/queuegraph +CGIDIR=/usr/lib/cgi-bin + +case "$1" in + configure) + + mkdir -p $DATADIR $CACHEDIR + chown root:root $DATADIR + chown www-data:www-data $CACHEDIR + + chown root:root $CGIDIR/queuegraph.cgi + + if [ -f $DATADIR/queuegraph.rrd ]; then + echo "RRD database already exists, skipping creation" + else + rrdtool create $DATADIR/queuegraph.rrd --step 60 \ + DS:active:GAUGE:900:0:U \ + DS:deferred:GAUGE:900:0:U \ + RRA:AVERAGE:0.5:1:20160 \ + RRA:AVERAGE:0.5:30:2016 \ + RRA:AVERAGE:0.5:60:105120 \ + RRA:MAX:0.5:1:1440 \ + RRA:MAX:0.5:30:2016 \ + RRA:MAX:0.5:60:105120 + chmod 644 $DATADIR/queuegraph.rrd + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument $1" >&2 + exit 1 + ;; + +esac + +exit 0 + +#DEBHELPER# --- queuegraph-1.1.1.orig/debian/copyright +++ queuegraph-1.1.1/debian/copyright @@ -0,0 +1,29 @@ +This package was debianized by Conall O'Brien on +Fri, 01 Sep 2006 09:07:48 +0100. + +It was downloaded from +http://www.stahl.bau.tu-bs.de/~hildeb/postfix/queuegraph/ + +The Debian packaging is (C) 2006 Conall O'Brien + +Copyright 2002-2005 Ralf Hildebrandt + +License: + + This package 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 package 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 + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 59 Temple Place - Suite 330, Boston, MA, 02110-1301, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- queuegraph-1.1.1.orig/debian/cron.d +++ queuegraph-1.1.1/debian/cron.d @@ -0,0 +1,4 @@ +# +# Regular cron jobs for the queuegraph package +# +* * * * * root test -x /usr/share/queuegraph/count.sh && /usr/share/queuegraph/count.sh >/dev/null 2>&1 --- queuegraph-1.1.1.orig/debian/postrm +++ queuegraph-1.1.1/debian/postrm @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +DATADIR=/var/lib/queuegraph +CACHEDIR=/var/cache/queuegraph +CGIDIR=/var/lib/cgi-bin + +case "$1" in + purge) + + rm -rf $DATADIR $CACHEDIR + + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + ;; + + *) + echo "postinst called with unknown argument $1" >&2 + exit 1 + ;; + +esac + +exit 0 + +#DEBHELPER# --- queuegraph-1.1.1.orig/debian/install +++ queuegraph-1.1.1/debian/install @@ -0,0 +1,2 @@ +queuegraph.cgi usr/lib/cgi-bin +queuegraph/count.sh usr/share/queuegraph --- queuegraph-1.1.1.orig/debian/rules +++ queuegraph-1.1.1/debian/rules @@ -0,0 +1,49 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# +# (c) 2006 Conall O'Brien + +clean: + dh_testdir + dh_testroot + dh_clean + rm -f build-stamp configure-stamp + +configure: configure-stamp + +configure-stamp: + dh_testdir + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + touch build-stamp + +install: + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + dh_install + +binary: binary-indep + +binary-indep: install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installcron + dh_installdocs + dh_compress + dh_fixperms + dh_perl + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-arch: build install + +.PHONY: build clean binary-indep binary-arch binary install configure