postfix-mailgraph/postfix-mailgraph.spec

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 235
8b7e29d77c37
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

michael@171 1 ##
michael@171 2 ## postfix-mailgraph.spec -- OpenPKG RPM Package Specification
michael@171 3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@171 4 ##
michael@171 5 ## Permission to use, copy, modify, and distribute this software for
michael@171 6 ## any purpose with or without fee is hereby granted, provided that
michael@171 7 ## the above copyright notice and this permission notice appear in all
michael@171 8 ## copies.
michael@171 9 ##
michael@171 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@171 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@171 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@171 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@171 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@171 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@171 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@171 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@171 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@171 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@171 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@171 21 ## SUCH DAMAGE.
michael@171 22 ##
michael@171 23
michael@171 24 # package information
michael@171 25 Name: postfix-mailgraph
michael@171 26 Summary: Postfix Mail Graphing
michael@171 27 URL: http://mailgraph.schweikert.ch/
michael@171 28 Vendor: David Schweikert
michael@171 29 Packager: OpenPKG Foundation e.V.
michael@171 30 Distribution: OpenPKG Community
michael@171 31 Class: EVAL
michael@171 32 Group: Mail
michael@171 33 License: GPL
michael@171 34 Version: 1.14
michael@236 35 Release: 20091102
michael@171 36
michael@171 37 # list of sources
michael@171 38 Source0: http://mailgraph.schweikert.ch/pub/mailgraph-%{version}.tar.gz
michael@171 39 Source1: rc.postfix-mailgraph
michael@171 40 Patch0: postfix-mailgraph.patch
michael@171 41
michael@171 42 # build information
michael@171 43 Prefix: %{l_prefix}
michael@171 44 BuildRoot: %{l_buildroot}
michael@171 45 BuildPreReq: OpenPKG, openpkg >= 20060823
michael@172 46 PreReq: OpenPKG, openpkg >= 20060823
michael@172 47 PreReq: postfix, perl, perl-sys
michael@172 48 PreReq: rrdtool, rrdtool::with_perl = yes
michael@171 49 AutoReq: no
michael@171 50 AutoReqProv: no
michael@171 51
michael@171 52 %description
michael@171 53 Mailgraph is a very simple mail statistics RRDtool frontend for the
michael@171 54 Postfix MTA that produces daily, weekly, monthly and yearly graphs
michael@171 55 of received/sent and bounced/rejected mail.
michael@171 56
michael@171 57 %track
michael@171 58 prog postfix-mailgraph = {
michael@171 59 version = %{version}
michael@171 60 url = http://mailgraph.schweikert.ch/pub/
michael@171 61 regex = mailgraph-(__VER__)\.tar\.gz
michael@171 62 }
michael@171 63
michael@171 64 %prep
michael@171 65 %setup -q -n mailgraph-%{version}
michael@171 66 %patch -p0
michael@171 67
michael@171 68 %build
michael@171 69
michael@171 70 %install
michael@171 71 rm -rf $RPM_BUILD_ROOT
michael@171 72 %{l_shtool} mkdir -f -p -m 755 \
michael@171 73 $RPM_BUILD_ROOT%{l_prefix}/sbin \
michael@171 74 $RPM_BUILD_ROOT%{l_prefix}/cgi \
michael@171 75 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@171 76 $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/rrd \
michael@171 77 $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/img \
michael@171 78 $RPM_BUILD_ROOT%{l_prefix}/var/postfix-mailgraph/run
michael@171 79 %{l_shtool} install -c -m 755 \
michael@171 80 -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
michael@171 81 -e 's;/var/log/mailgraph\.log;%{l_prefix}/var/postfix-mailgraph/run/mailgraph.log;' \
michael@171 82 -e 's;/var/run/mailgraph\.pid;%{l_prefix}/var/postfix-mailgraph/run/mailgraph.pid;' \
michael@171 83 -e 's;/var/log/syslog;%{l_prefix}/var/postfix/log/postfix.log;' \
michael@171 84 -e 's;/var/log;%{l_prefix}/var/postfix-mailgraph/rrd;' \
michael@171 85 mailgraph.pl $RPM_BUILD_ROOT%{l_prefix}/sbin/mailgraph
michael@171 86 %{l_shtool} install -c -m 755 \
michael@171 87 -e 's;#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \
michael@171 88 -e 's;mailgraph\.cgi;mailgraph;' \
michael@171 89 -e 's;mailgraph\.rrd;%{l_prefix}/var/postfix-mailgraph/rrd/mailgraph.rrd;' \
michael@171 90 -e 's;mailgraph_virus\.rrd;%{l_prefix}/var/postfix-mailgraph/rrd/mailgraph_virus.rrd;' \
michael@171 91 -e 's;/tmp/mailgraph;%{l_prefix}/var/postfix-mailgraph/img;' \
michael@171 92 mailgraph.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/mailgraph
michael@171 93 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@171 94 %{SOURCE rc.postfix-mailgraph} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@171 95 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@171 96 %{l_files_std} \
michael@171 97 '%attr(755,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/postfix-mailgraph/img'
michael@171 98
michael@171 99 %files -f files
michael@171 100
michael@171 101 %clean
michael@171 102 rm -rf $RPM_BUILD_ROOT
michael@171 103
michael@236 104 %post
michael@236 105 # after upgrade, restart service
michael@236 106 [ $1 -eq 2 ] || exit 0
michael@236 107 eval `%{l_rc} postfix-mailgraph status 2>/dev/null`
michael@236 108 [ ".$postfix_mailgraph_active" = .yes ] && %{l_rc} postfix-mailgraph restart
michael@236 109 exit 0
michael@236 110
michael@236 111 %preun
michael@236 112 # before erase, stop service and remove log files
michael@236 113 [ $1 -eq 0 ] || exit 0
michael@236 114 %{l_rc} postfix-mailgraph stop 2>/dev/null
michael@236 115 rm -f $RPM_INSTALL_PREFIX/var/postfix-mailgraph/run/*.log* >/dev/null 2>&1 || true
michael@236 116 rm -f $RPM_INSTALL_PREFIX/var/postfix-mailgraph/run/*.pid >/dev/null 2>&1 || true
michael@236 117 exit 0
michael@236 118

mercurial