asterisk/rc.asterisk

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 310
73d852a30c9a
child 347
10bd406e1c51
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@202 1 #!@l_prefix@/bin/openpkg rc
michael@202 2 ##
michael@202 3 ## rc.asterisk -- Run-Commands
michael@202 4 ##
michael@202 5
michael@202 6 %config
michael@202 7 asterisk_enable="$openpkg_rc_def"
michael@310 8 asterisk_nice="-5"
michael@202 9 asterisk_flags=""
michael@202 10 asterisk_log_prolog="true"
michael@202 11 asterisk_log_epilog="true"
michael@202 12 asterisk_log_numfiles="10"
michael@202 13 asterisk_log_minsize="1M"
michael@202 14 asterisk_log_complevel="9"
michael@202 15
michael@202 16 %status -u @l_susr@ -o
michael@202 17 asterisk_usable="unknown"
michael@202 18 asterisk_active="no"
michael@202 19 rcService asterisk enable yes && \
michael@202 20 @l_prefix@/sbin/asterisk -rx "show version" >/dev/null 2>&1 && \
michael@202 21 asterisk_active="yes"
michael@202 22 echo "asterisk_enable=\"$asterisk_enable\""
michael@202 23 echo "asterisk_usable=\"$asterisk_usable\""
michael@202 24 echo "asterisk_active=\"$asterisk_active\""
michael@202 25
michael@202 26 %start -u @l_susr@
michael@202 27 rcService asterisk enable yes || exit 0
michael@202 28 rcService asterisk active yes && exit 0
michael@310 29 nice -n $asterisk_nice @l_prefix@/sbin/asterisk ${asterisk_flags}
michael@202 30
michael@202 31 %stop -u @l_susr@
michael@202 32 rcService asterisk enable yes || exit 0
michael@202 33 rcService asterisk active no && exit 0
michael@311 34 ( @l_prefix@/sbin/asterisk -rx "core stop gracefully" &
michael@202 35 sleep 2
michael@311 36 @l_prefix@/sbin/asterisk -rx "core stop now" &
michael@202 37 ) >/dev/null 2>&1 || true
michael@202 38
michael@202 39 %restart -u @l_susr@
michael@202 40 rcService asterisk enable yes || exit 0
michael@202 41 rcService asterisk active no && exit 0
michael@311 42 @l_prefix@/sbin/asterisk -rx "core restart now"
michael@202 43
michael@202 44 %reload -u @l_susr@
michael@202 45 rcService asterisk enable yes || exit 0
michael@202 46 rcService asterisk active no && exit 0
michael@202 47 @l_prefix@/sbin/asterisk -rx "reload"
michael@202 48
michael@202 49 %daily -u @l_susr@
michael@202 50 rcService asterisk enable yes || exit 0
michael@202 51 shtool rotate -f \
michael@202 52 -n ${asterisk_log_numfiles} -s ${asterisk_log_minsize} -d \
michael@202 53 -z ${asterisk_log_complevel} -m 664 -o @l_rusr@ -g @l_rgrp@ \
michael@202 54 -P "${asterisk_log_prolog}" \
michael@202 55 -E "${asterisk_log_epilog}; rc asterisk reload" \
michael@202 56 @l_prefix@/var/asterisk/log/asterisk.log
michael@202 57

mercurial