dovecot/rc.dovecot

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 148
f6edc24e328f
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@148 1 #!@l_prefix@/bin/openpkg rc
michael@148 2 ##
michael@148 3 ## rc.dovecot -- Run-Commands
michael@148 4 ##
michael@148 5
michael@148 6 %config
michael@148 7 dovecot_enable="$openpkg_rc_def"
michael@148 8 dovecot_log_prolog="true"
michael@148 9 dovecot_log_epilog="true"
michael@148 10 dovecot_log_numfiles="10"
michael@148 11 dovecot_log_minsize="1M"
michael@148 12 dovecot_log_complevel="9"
michael@148 13 dovecot_deliver_log_prolog="true"
michael@148 14 dovecot_deliver_log_epilog="true"
michael@148 15 dovecot_deliver_log_numfiles="10"
michael@148 16 dovecot_deliver_log_minsize="1M"
michael@148 17 dovecot_deliver_log_complevel="9"
michael@148 18
michael@148 19 %common
michael@148 20 dovecot_pidfile="@l_prefix@/var/dovecot/run/master.pid"
michael@148 21 dovecot_signal () {
michael@148 22 [ -f $dovecot_pidfile ] && kill -$1 `cat $dovecot_pidfile`
michael@148 23 }
michael@148 24
michael@148 25 %status -u @l_susr@ -o
michael@148 26 dovecot_usable="unknown"
michael@148 27 dovecot_active="no"
michael@148 28 rcService dovecot enable yes && \
michael@148 29 dovecot_signal 0 && dovecot_active="yes"
michael@148 30 echo "dovecot_enable=\"$dovecot_enable\""
michael@148 31 echo "dovecot_usable=\"$dovecot_usable\""
michael@148 32 echo "dovecot_active=\"$dovecot_active\""
michael@148 33
michael@148 34 %start -u @l_susr@
michael@148 35 rcService dovecot enable yes || exit 0
michael@148 36 rcService dovecot active yes && exit 0
michael@148 37 @l_prefix@/sbin/dovecot
michael@148 38
michael@148 39 %stop -u @l_susr@
michael@148 40 rcService dovecot enable yes || exit 0
michael@148 41 rcService dovecot active no && exit 0
michael@148 42 dovecot_signal TERM
michael@148 43 sleep 2
michael@148 44 rm -f $dovecot_pidfile >/dev/null 2>&1 || true
michael@148 45
michael@148 46 %restart -u @l_susr@
michael@148 47 rcService dovecot enable yes || exit 0
michael@148 48 rcService dovecot active no && exit 0
michael@148 49 rc dovecot stop start
michael@148 50
michael@148 51 %reload -u @l_susr@
michael@148 52 rcService dovecot enable yes || exit 0
michael@148 53 rcService dovecot active no && exit 0
michael@148 54 dovecot_signal HUP
michael@148 55
michael@148 56 %daily -u @l_susr@
michael@148 57 rcService dovecot enable yes || exit 0
michael@148 58 rcTmp -i
michael@148 59 hintfile=`rcTmp -f -n hint`
michael@148 60 shtool rotate -f \
michael@148 61 -n ${dovecot_log_numfiles} -s ${dovecot_log_minsize} -d \
michael@148 62 -z ${dovecot_log_complevel} -m 600 -o @l_susr@ -g @l_sgrp@ \
michael@148 63 -P "${dovecot_log_prolog}" \
michael@148 64 -E "${dovecot_log_epilog}; echo 1 >$hintfile" \
michael@148 65 @l_prefix@/var/dovecot/log/dovecot.log
michael@148 66 if [ -s $hintfile ]; then
michael@148 67 dovecot_signal USR1
michael@148 68 fi
michael@148 69 rcTmp -k
michael@148 70 shtool rotate -f \
michael@148 71 -n ${dovecot_deliver_log_numfiles} -s ${dovecot_deliver_log_minsize} -d \
michael@148 72 -z ${dovecot_deliver_log_complevel} -m 600 -o @l_rusr@ -g @l_rgrp@ \
michael@148 73 -P "${dovecot_deliver_log_prolog}" \
michael@148 74 -E "${dovecot_deliver_log_epilog}" \
michael@148 75 @l_prefix@/var/dovecot/log/deliver.log
michael@148 76

mercurial