diff --git a/dss/dss.spec b/dss/dss.spec index 51cd69c127..6b19a1ea14 100644 --- a/dss/dss.spec +++ b/dss/dss.spec @@ -37,7 +37,7 @@ Distribution: OpenPKG [EVAL] Group: Video License: APSL Version: %{V_opkg} -Release: 20030918 +Release: 20031021 # list of sources Source0: http://www.opensource.apple.com/projects/streaming/source/DSS-%{V_dss}.src.tar.gz @@ -88,7 +88,7 @@ AutoReqProv: no -e 's;"qtssAdmin", "streamingadmin";"qtssAdmin", "dssadmin";g' \ -e 's;#"pidfile", "/var/streaming/streamingadminserver.pid";"pidfile", "%{l_prefix}/var/dss/dssadmin.pid";g' \ -e 's;/usr/local/sbin/DarwinStreamingServer;%{l_prefix}/sbin/DarwinStreamingServer -c %{l_prefix}/etc/dss/streamingadmin.conf;g' \ - -e 's;/var/streaming/logs/streamingadminserver.log;%{l_prefix}/var/dss/logs/StreamingAdmin.log;g' \ + -e 's;/var/streaming/logs/streamingadminserver.log;%{l_prefix}/var/dss/log/StreamingAdmin.log;g' \ WebAdmin/src/streamingadminserver.pl %{l_shtool} subst \ -e 's;/etc/streaming/qtusers;%{l_prefix}/etc/dss/qtusers;g' \ @@ -100,17 +100,21 @@ AutoReqProv: no relayconfig.xml-Sample \ streamingadminserver.conf %{l_shtool} subst \ - -e 's;/Library/QuickTimeStreaming/Logs;%{l_prefix}/var/dss/logs;g' \ + -e 's;/Library/QuickTimeStreaming/Logs;%{l_prefix}/var/dss/log;g' \ -e 's;/Library/QuickTimeStreaming/Modules;%{l_prefix}/share/dss/modules;g' \ -e 's;/Library/QuickTimeStreaming/Movies;%{l_prefix}/share/dss/movies;g' \ -e 's;/Library/QuickTimeStreaming/Config/relayconfig.xml;%{l_prefix}/etc/dss/relayconfig.xml;g' \ -e 's;/Library/QuickTimeStreaming/Config/qtgroups;%{l_prefix}/etc/dss/qtgroups;g' \ -e 's;/Library/QuickTimeStreaming/Config/qtusers;%{l_prefix}/etc/dss/qtusers;g' \ + -e 's;\("error_logfile_name">\)Error;\1error;g' \ + -e 's;\("request_logfile_name">\)StreamingServer;\1streamingserver;g' \ + -e 's;\("http_logfile_name">\)Http;\1http;g' \ + -e 's;\("bind_ip_addr">\)0;\1127.0.0.1;g' \ streamingserver.xml %{l_shtool} subst \ -e 's;qtssAutoStart=1;qtssAutoStart=0;g' \ -e "s;host=foo.bar.com;host=$l_hostname;g" \ - -e 's;/Library/QuickTimeStreaming/Logs/streamingadminserver.log;%{l_prefix}/var/dss/logs/StreamingAdmin.log;g' \ + -e 's;/Library/QuickTimeStreaming/Logs/streamingadminserver.log;%{l_prefix}/var/dss/log/StreamingAdmin.log;g' \ -e 's;/Library/QuickTimeStreaming/AdminHtml;%{l_prefix}/var/dss/webadmin;g' \ -e 's;/Library/QuickTimeStreaming/Playlists;%{l_prefix}/share/dss/playlists;g' \ -e 's;/usr/sbin/QuickTimeStreamingServer;%{l_prefix}/sbin/DarwinStreamingServer -c %{l_prefix}/etc/dss/streamingserver.xml;g' \ @@ -233,7 +237,7 @@ AutoReqProv: no $RPM_BUILD_ROOT%{l_prefix}/share/dss/movies \ $RPM_BUILD_ROOT%{l_prefix}/share/dss/modules \ $RPM_BUILD_ROOT%{l_prefix}/share/dss/playlists \ - $RPM_BUILD_ROOT%{l_prefix}/var/dss/logs + $RPM_BUILD_ROOT%{l_prefix}/var/dss/log # install the server and administrative binaries %{l_shtool} install -s -c -m 755 \ @@ -293,12 +297,24 @@ AutoReqProv: no rm -rf $RPM_BUILD_ROOT %post + # after first time install, write default admin username and + # password to qtusers and add the new admin username to qtgroups if [ $1 -eq 1 ]; then - # after install, write default admin username and password to qtusers username='ghandi'; password='india' $RPM_INSTALL_PREFIX/bin/qtpasswd -p $password $username - - # add the new admin username to {l_prefix}/etc/dss/qtgroupsusers echo "admin: $username" >$RPM_INSTALL_PREFIX/etc/dss/qtgroups fi + # after upgrade, restart service + [ $1 -eq 2 ] || exit 0 + eval `%{l_rc} dss status 2>/dev/null` + [ ".$dss_active" = .yes ] && %{l_rc} dss restart + exit 0 + +%preun + # before erase, stop service and remove log files + [ $1 -eq 0 ] || exit 0 + %{l_rc} dss stop 2>/dev/null + rm -f $RPM_INSTALL_PREFIX/var/dss/log/* >/dev/null 2>&1 || true + exit 0 + diff --git a/dss/rc.dss b/dss/rc.dss index 10f94caf59..957c10e1ef 100644 --- a/dss/rc.dss +++ b/dss/rc.dss @@ -34,6 +34,7 @@ %start -u @l_susr@ rcService dss enable yes || exit 0 + rcService dss active yes && exit 0 @l_prefix@/sbin/DarwinStreamingServer -d >/dev/null 2>&1 & echo $! >$dss_daemon_pidfile if rcVarIsYes dss_admin; then @@ -45,12 +46,14 @@ %stop -u @l_susr@ rcService dss enable yes || exit 0 + rcService dss active no && exit 0 dss_signal TERM rm -f $dss_daemon_pidfile 2>/dev/null || true rm -f $dss_admin_pidfile 2>/dev/null || true %restart -u @l_susr@ rcService dss enable yes || exit 0 + rcService dss active no && exit 0 rc dss stop sleep 2 rc dss start