spamassassin/rc.spamassassin

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 191
d980506f80fc
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@191 1 #!@l_prefix@/bin/openpkg rc
michael@191 2 ##
michael@191 3 ## rc.spamassassin -- Run-Commands
michael@191 4 ##
michael@191 5
michael@191 6 %config
michael@191 7 spamassassin_enable="$openpkg_rc_def"
michael@191 8 spamassassin_bind="127.0.0.1"
michael@191 9 spamassassin_port="783"
michael@192 10 spamassassin_flags="-x -u @l_rusr@ -A 127. --local --virtual-config-dir=@l_prefix@/var/spamassassin/spool/%u"
michael@191 11 spamassassin_stop_delay="2"
michael@191 12 spamassassin_log_prolog="true"
michael@191 13 spamassassin_log_epilog="true"
michael@191 14 spamassassin_log_numfiles="10"
michael@191 15 spamassassin_log_minsize="1M"
michael@191 16 spamassassin_log_complevel="9"
michael@191 17
michael@191 18 %common
michael@191 19 spamassassin_etcdir="@l_prefix@/etc/spamassassin"
michael@191 20 spamassassin_pidfile="@l_prefix@/var/spamassassin/spamassassin.pid"
michael@191 21 spamassassin_logfile="@l_prefix@/var/spamassassin/spamassassin.log"
michael@191 22 spamassassin_signal () {
michael@191 23 [ -f $spamassassin_pidfile ] && kill -$1 `cat $spamassassin_pidfile`
michael@191 24 }
michael@191 25
michael@191 26 %status -u @l_susr@ -o
michael@191 27 spamassassin_usable="unknown"
michael@191 28 spamassassin_active="no"
michael@191 29 rcService spamassassin enable yes && \
michael@191 30 spamassassin_signal 0 && spamassassin_active="yes"
michael@191 31 echo "spamassassin_enable=\"$spamassassin_enable\""
michael@191 32 echo "spamassassin_usable=\"$spamassassin_usable\""
michael@191 33 echo "spamassassin_active=\"$spamassassin_active\""
michael@191 34
michael@191 35 %start -p 400 -u @l_susr@
michael@191 36 rcService spamassassin enable yes || exit 0
michael@191 37 rcService spamassassin active yes && exit 0
michael@191 38 @l_prefix@/bin/spamd \
michael@191 39 --daemonize \
michael@191 40 --siteconfigpath="${spamassassin_etcdir}" \
michael@191 41 --pidfile="${spamassassin_pidfile}" \
michael@191 42 --syslog="${spamassassin_logfile}" \
michael@191 43 --listen-ip="${spamassassin_bind}" \
michael@191 44 --port="${spamassassin_port}" \
michael@191 45 ${spamassassin_flags}
michael@191 46
michael@191 47 %stop -p 400 -u @l_susr@
michael@191 48 rcService spamassassin enable yes || exit 0
michael@191 49 rcService spamassassin active no && exit 0
michael@191 50 spamassassin_signal TERM
michael@191 51 sleep "$spamassassin_stop_delay"
michael@191 52
michael@191 53 %restart -p 600 -u @l_susr@
michael@191 54 rcService spamassassin enable yes || exit 0
michael@191 55 rcService spamassassin active no && exit 0
michael@191 56 rc spamassassin stop
michael@191 57 rc spamassassin start
michael@191 58
michael@191 59 %daily -u @l_susr@
michael@191 60 rcService spamassassin enable yes || exit 0
michael@191 61 shtool rotate -f \
michael@191 62 -n ${spamassassin_log_numfiles} -s ${spamassassin_log_minsize} -d \
michael@191 63 -z ${spamassassin_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
michael@191 64 -P "${spamassassin_log_prolog}" \
michael@191 65 -E "${spamassassin_log_epilog}; rc spamassassin restart" \
michael@191 66 $spamassassin_logfile
michael@191 67

mercurial