postfix-mailgraph/postfix-mailgraph.spec

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
parent 235
8b7e29d77c37
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

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