gmediaserver/rc.gmediaserver

Fri, 16 Jan 2009 10:58:21 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2009 10:58:21 +0100
changeset 92
645923d1e875
parent 81
ec457953d795
child 105
23b323528569
permissions
-rw-r--r--

Correct and improve code logic, buildconf, and packaging. In particular:
1. Use descriptive variable names <var>libs instead of just <var>.
2. Although Nokia states in all Qt builds that 'NOTE: When linking
against OpenSSL, you can override the default library names
through OPENSSL_LIBS.' and even gives an example, their own
configuration logic rejects such an attempt. Correct this by
hard coding the OpenSSL library string in the configure script.
3. Consistently use the whitespace substitution [\t ] throughout.
4. Patch the buggy INCPATH of SQL plugin Qmake project files.
5. Add the 'x11' configuration variable to the qtconfig Qmake
project using the src/gui/gui.pro file as a model. This is
needed for qtconfig although not in other tools, because
the qtconfig buildconf indirectly includes qt_x11_p.h which
is dependent on X11 headers.
6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow'
on platforms for which the config.tests/unix/[3dnow|sse2] succeed
although unsopported at run time by testing for the x86-64
instruction set at build time and regulating hardware capabilities.
7. Correctly install the desinger plugin by explicitly building it.
8. Remove custom plugin installation logic which is unnecessary.
9. Correct removal of temporary paths from shared object files.

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@81 23 gmediaserver_cmdstart="echo 'route add -net 239.0.0.0 netmask 255.0.0.0 dev eth0'"
michael@81 24 gmediaserver_cmdstop="echo 'route del -net 239.0.0.0 netmask 255.0.0.0 dev eth0'"
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