Sun, 19 Apr 2009 14:07:25 +0200
Import package vendor original specs for necessary manipulations.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/postfix-mailgraph/postfix-mailgraph.patch Sun Apr 19 14:07:25 2009 +0200 1.3 @@ -0,0 +1,47 @@ 1.4 +Index: mailgraph.cgi 1.5 +--- mailgraph.cgi.orig 2007-08-29 11:06:01 +0200 1.6 ++++ mailgraph.cgi 2007-08-29 19:05:41 +0200 1.7 +@@ -160,7 +160,7 @@ 1.8 + <html> 1.9 + <head> 1.10 + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 1.11 +-<title>Mail statistics for $host</title> 1.12 ++<title>Postfix Mail statistics for $host</title> 1.13 + <meta http-equiv="Refresh" content="300" /> 1.14 + <meta http-equiv="Pragma" content="no-cache" /> 1.15 + <link rel="stylesheet" href="mailgraph.css" type="text/css" /> 1.16 +@@ -168,7 +168,7 @@ 1.17 + <body> 1.18 + HEADER 1.19 + 1.20 +- print "<h1>Mail statistics for $host</h1>\n"; 1.21 ++ print "<h1>Postfix Mail statistics for $host</h1>\n"; 1.22 + 1.23 + print "<ul id=\"jump\">\n"; 1.24 + for my $n (0..$#graphs) { 1.25 +@@ -183,13 +183,6 @@ 1.26 + } 1.27 + 1.28 + print <<FOOTER; 1.29 +-<hr/> 1.30 +-<table><tr><td> 1.31 +-<a href="http://mailgraph.schweikert.ch/">Mailgraph</a> $VERSION 1.32 +-by <a href="http://david.schweikert.ch/">David Schweikert</a></td> 1.33 +-<td align="right"> 1.34 +-<a href="http://oss.oetiker.ch/rrdtool/"><img src="http://oss.oetiker.ch/rrdtool/.pics/rrdtool.gif" alt="" width="120" height="34"/></a> 1.35 +-</td></tr></table> 1.36 + </body></html> 1.37 + FOOTER 1.38 + } 1.39 +Index: mailgraph.pl 1.40 +--- mailgraph.pl.orig 2007-08-29 11:06:01 +0200 1.41 ++++ mailgraph.pl 2007-08-29 19:03:59 +0200 1.42 +@@ -211,6 +211,8 @@ 1.43 + \s 1.44 + ([-\w\.\@:]+) # host -- 6 1.45 + \s+ 1.46 ++ <[^>]+> # OSSP fsl log level 1.47 ++ \s+ 1.48 + (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD 1.49 + (.*) # text -- 7 1.50 + $/x or do
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/postfix-mailgraph/postfix-mailgraph.spec Sun Apr 19 14:07:25 2009 +0200 2.3 @@ -0,0 +1,101 @@ 2.4 +## 2.5 +## postfix-mailgraph.spec -- OpenPKG RPM Package Specification 2.6 +## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## 2.8 +## Permission to use, copy, modify, and distribute this software for 2.9 +## any purpose with or without fee is hereby granted, provided that 2.10 +## the above copyright notice and this permission notice appear in all 2.11 +## copies. 2.12 +## 2.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 2.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2.24 +## SUCH DAMAGE. 2.25 +## 2.26 + 2.27 +# package information 2.28 +Name: postfix-mailgraph 2.29 +Summary: Postfix Mail Graphing 2.30 +URL: http://mailgraph.schweikert.ch/ 2.31 +Vendor: David Schweikert 2.32 +Packager: OpenPKG Foundation e.V. 2.33 +Distribution: OpenPKG Community 2.34 +Class: EVAL 2.35 +Group: Mail 2.36 +License: GPL 2.37 +Version: 1.14 2.38 +Release: 20080101 2.39 + 2.40 +# list of sources 2.41 +Source0: http://mailgraph.schweikert.ch/pub/mailgraph-%{version}.tar.gz 2.42 +Source1: rc.postfix-mailgraph 2.43 +Patch0: postfix-mailgraph.patch 2.44 + 2.45 +# build information 2.46 +Prefix: %{l_prefix} 2.47 +BuildRoot: %{l_buildroot} 2.48 +BuildPreReq: OpenPKG, openpkg >= 20060823 2.49 +PreReq: OpenPKG, openpkg >= 20060823, perl, perl-sys, rrdtool, postfix 2.50 +AutoReq: no 2.51 +AutoReqProv: no 2.52 + 2.53 +%description 2.54 + Mailgraph is a very simple mail statistics RRDtool frontend for the 2.55 + Postfix MTA that produces daily, weekly, monthly and yearly graphs 2.56 + of received/sent and bounced/rejected mail. 2.57 + 2.58 +%track 2.59 + prog postfix-mailgraph = { 2.60 + version = %{version} 2.61 + url = http://mailgraph.schweikert.ch/pub/ 2.62 + regex = mailgraph-(__VER__)\.tar\.gz 2.63 + } 2.64 + 2.65 +%prep 2.66 + %setup -q -n mailgraph-%{version} 2.67 + %patch -p0 2.68 + 2.69 +%build 2.70 + 2.71 +%install 2.72 + rm -rf $RPM_BUILD_ROOT 2.73 + %{l_shtool} mkdir -f -p -m 755 \ 2.74 + $RPM_BUILD_ROOT%{l_prefix}/sbin \ 2.75 + $RPM_BUILD_ROOT%{l_prefix}/cgi \ 2.76 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 2.77 + $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/rrd \ 2.78 + $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/img \ 2.79 + $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/run 2.80 + %{l_shtool} install -c -m 755 \ 2.81 + -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \ 2.82 + -e 's;/var/log/mailgraph\.log;%{l_prefix}/var/postfix-mailgraph/run/mailgraph.log;' \ 2.83 + -e 's;/var/run/mailgraph\.pid;%{l_prefix}/var/postfix-mailgraph/run/mailgraph.pid;' \ 2.84 + -e 's;/var/log/syslog;%{l_prefix}/var/postfix/log/postfix.log;' \ 2.85 + -e 's;/var/log;%{l_prefix}/var/postfix-mailgraph/rrd;' \ 2.86 + mailgraph.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/mailgraph 2.87 + %{l_shtool} install -c -m 755 \ 2.88 + -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \ 2.89 + -e 's;mailgraph\.cgi;mailgraph;' \ 2.90 + -e 's;mailgraph\.rrd;%{l_prefix}/var/postfix-mailgraph/rrd/mailgraph.rrd;' \ 2.91 + -e 's;mailgraph_virus\.rrd;%{l_prefix}/var/postfix-mailgraph/rrd/mailgraph_virus.rrd;' \ 2.92 + -e 's;/tmp/mailgraph;%{l_prefix}/var/postfix-mailgraph/img;' \ 2.93 + mailgraph.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/mailgraph 2.94 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 2.95 + %{SOURCE rc.postfix-mailgraph} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 2.96 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 2.97 + %{l_files_std} \ 2.98 + '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/postfix-mailgraph/img' 2.99 + 2.100 +%files -f files 2.101 + 2.102 +%clean 2.103 + rm -rf $RPM_BUILD_ROOT 2.104 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/postfix-mailgraph/rc.postfix-mailgraph Sun Apr 19 14:07:25 2009 +0200 3.3 @@ -0,0 +1,41 @@ 3.4 +#!@l_prefix@/bin/openpkg rc 3.5 +## 3.6 +## rc.postfix-mailgraph -- Run-Commands 3.7 +## 3.8 + 3.9 +%config 3.10 + postfix_mailgraph_enable="$openpkg_rc_def" 3.11 + 3.12 +%common 3.13 + postfix_mailgraph_pidfile="@l_prefix@/var/postfix-mailgraph/run/mailgraph.pid" 3.14 + postfix_mailgraph_signal () { 3.15 + [ -f $postfix_mailgraph_pidfile ] \ 3.16 + && kill -$1 `cat $postfix_mailgraph_pidfile` 3.17 + } 3.18 + 3.19 +%status -u @l_susr@ -o 3.20 + postfix_mailgraph_usable="unknown" 3.21 + postfix_mailgraph_active="no" 3.22 + rcService postfix-mailgraph enable yes && \ 3.23 + postfix_mailgraph_signal 0 && postfix_mailgraph_active="yes" 3.24 + echo "postfix_mailgraph_enable=\"$postfix_mailgraph_enable\"" 3.25 + echo "postfix_mailgraph_usable=\"$postfix_mailgraph_usable\"" 3.26 + echo "postfix_mailgraph_active=\"$postfix_mailgraph_active\"" 3.27 + 3.28 +%start -u @l_susr@ 3.29 + rcService postfix-mailgraph enable yes || exit 0 3.30 + rcService postfix-mailgraph active yes && exit 0 3.31 + @l_prefix@/sbin/mailgraph --daemon 3.32 + 3.33 +%stop -u @l_susr@ 3.34 + rcService postfix-mailgraph enable yes || exit 0 3.35 + rcService postfix-mailgraph active no && exit 0 3.36 + postfix_mailgraph_signal TERM 3.37 + 3.38 +%restart -u @l_susr@ 3.39 + rcService postfix-mailgraph enable yes || exit 0 3.40 + rcService postfix-mailgraph active no && exit 0 3.41 + postfix_mailgraph_signal TERM 3.42 + sleep 2 3.43 + @l_prefix@/sbin/mailgraph --daemon 3.44 +