gmediaserver/rc.gmediaserver

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 89
784543bb550b
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@75 1 #!@l_prefix@/bin/openpkg rc
michael@75 2 ##
michael@75 3 ## rc.gmediaserver -- runcommands
michael@75 4 ##
michael@75 5
michael@75 6 %config
michael@75 7 gmediaserver_enable="$openpkg_rc_def"
michael@75 8 gmediaserver_log_prolog="true"
michael@75 9 gmediaserver_log_epilog="true"
michael@75 10 gmediaserver_log_numfiles="10"
michael@75 11 gmediaserver_log_minsize="1M"
michael@75 12 gmediaserver_log_complevel="9"
michael@75 13 gmediaserver_name="GMediaServer"
michael@75 14 gmediaserver_fschar="ISO-8859-1"
michael@75 15 gmediaserver_devchar="ISO-8859-1"
michael@75 16 gmediaserver_logchar="ISO-8859-1"
michael@75 17 gmediaserver_profile="generic"
michael@89 18 gmediaserver_ftypes="ogg,mp3,wma,wav,pls,m3u,m4a,jpg,png,unknown"
michael@75 19 gmediaserver_expire="100"
michael@75 20 gmediaserver_iface="lo0"
michael@75 21 gmediaserver_port="49152"
michael@89 22 gmediaserver_dirs="@l_prefix@/share/gmediaserver"
michael@105 23 gmediaserver_cmdstart="echo 'route add -net 239.0.0.0 netmask 255.0.0.0 dev lo0'"
michael@105 24 gmediaserver_cmdstop="echo 'route del -net 239.0.0.0 netmask 255.0.0.0 dev lo0'"
michael@75 25
michael@75 26 %common
michael@75 27 gmediaserver_pidfile="@l_prefix@/var/gmediaserver/run/gmediaserver.pid"
michael@75 28 gmediaserver_logfile="@l_prefix@/var/gmediaserver/log/gmediaserver.log"
michael@75 29 gmediaserver_signal () {
michael@75 30 [ -f $gmediaserver_pidfile ] && kill -$1 `cat $gmediaserver_pidfile`
michael@75 31 }
michael@75 32
michael@75 33 %status -u @l_susr@ -o
michael@75 34 gmediaserver_usable="no"
michael@75 35 gmediaserver_active="no"
michael@75 36 rcService gmediaserver enable yes && \
michael@75 37 gmediaserver_usable="yes"
michael@75 38 rcService gmediaserver enable yes && \
michael@75 39 gmediaserver_signal 0 && gmediaserver_active="yes"
michael@75 40 echo "gmediaserver_enable=\"$gmediaserver_enable\""
michael@75 41 echo "gmediaserver_usable=\"$gmediaserver_usable\""
michael@75 42 echo "gmediaserver_active=\"$gmediaserver_active\""
michael@75 43
michael@75 44 %start -u @l_susr@
michael@75 45 rcService gmediaserver enable yes || exit 0
michael@75 46 rcService gmediaserver active yes && exit 0
michael@81 47 eval $gmediaserver_cmdstart
michael@75 48 @l_prefix@/bin/gmediaserver \
michael@75 49 --friendly-name=$gmediaserver_name \
michael@75 50 --fs-charset=$gmediaserver_fschar \
michael@75 51 --device-charset=$gmediaserver_devchar \
michael@75 52 --log-charset=$gmediaserver_logchar \
michael@75 53 --profile=$gmediaserver_profile \
michael@75 54 --file-types=$gmediaserver_ftypes \
michael@75 55 --expire-time=$gmediaserver_expire \
michael@75 56 --interface=$gmediaserver_iface \
michael@75 57 --port=$gmediaserver_port \
michael@75 58 --pid-file=$gmediaserver_pidfile \
michael@75 59 --output=$gmediaserver_logfile \
michael@75 60 --background \
michael@75 61 --timestamp \
michael@75 62 $gmediaserver_dirs
michael@75 63
michael@75 64 %stop -u @l_susr@
michael@75 65 rcService gmediaserver enable yes || exit 0
michael@75 66 rcService gmediaserver active no && exit 0
michael@75 67 gmediaserver_signal TERM
michael@81 68 eval $gmediaserver_cmdstop
michael@75 69
michael@75 70 %restart -u @l_susr@
michael@75 71 rcService gmediaserver enable yes || exit 0
michael@75 72 rcService gmediaserver active no && exit 0
michael@75 73 rc gmediaserver stop
michael@75 74 sleep 2
michael@75 75 rc gmediaserver start
michael@75 76
michael@75 77 %reload -u @l_susr@
michael@75 78 rcService gmediaserver enable yes || exit 0
michael@75 79 rcService gmediaserver active no && exit 0
michael@75 80 gmediaserver_signal USR1
michael@75 81
michael@75 82 %daily -u @l_susr@
michael@75 83 rcService gmediaserver enable yes || exit 0
michael@75 84 shtool rotate -f \
michael@75 85 -n ${gmediaserver_log_numfiles} -s ${gmediaserver_log_minsize} -d \
michael@75 86 -z ${gmediaserver_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
michael@75 87 -P "${gmediaserver_log_prolog}" \
michael@75 88 -E "${gmediaserver_log_epilog}; rc gmediaserver restart" \
michael@75 89 @l_prefix@/var/gmediaserver/log/gmediaserver.log \
michael@75 90 @l_prefix@/var/gmediaserver/log/arpsnmp.log

mercurial