--- /dev/null
+#!/bin/sh
+#
+# dss Start/Stop MPEG-4 streaming server
+#
+# chkconfig: 345 13 87
+#
+# description: An MPEG-4 video and audio streaming server. \
+# Enable this if you wish to run an internet TV station.
+#
+# processname: DarwinStreamingServer
+# config:
+# pidfile: DarwinStreamingServer.pid
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+ msg_network_down "Darwin Streaming Server"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/dss ] && . /etc/sysconfig/dss
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/dss ]; then
+ msg_already_running "Darwin Streaming Server"
+ return
+ fi
+
+ msg_starting "Darwin Streaming Server"
+ daemon /usr/sbin/DarwinStreamingServer
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dss
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/dss ]; then
+ msg_not_running "Darwin Streaming Server"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "Darwin Streaming Server"
+ killproc --pidfile /var/run/DarwinStreamingServer.pid DarwinStreamingServer
+ rm -f /var/lock/subsys/dss
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/dss ]; then
+ msg_not_running "Darwin Streaming Server"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status --pidfile /var/run/DarwinStreamingServer.pid dss DarwinStreamingServer
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
Summary: Darwin Streaming Server
Name: dss
Version: 6.0.3
-Release: 0.2
+Release: 0.3
License: Apple Public Source License
Group: Applications
Source0: http://dss.macosforge.org/downloads/DarwinStreamingSrvr%{version}-Source.tar
Patch1: %{name}-x86_64.patch
Patch2: optflags.patch
Patch3: compile.patch
+Source1: %{name}.init
URL: http://dss.macosforge.org/
+BuildRequires: rpmbuild(macros) >= 1.228
+Requires(post,preun): /sbin/chkconfig
+Requires: rc-scripts
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
s|/''usr/local/movies|%{_localstatedir}/lib/%{name}/movies|g
s|/''usr/local/sbin/StreamingServerModules|%{_libdir}/%{name}/|g
s|/''usr/local/|%{_prefix}/|g
- s|/etc/streaming|%{_sysconfdir}/%{name}|g
+ s|/''etc/streaming|%{_sysconfdir}/%{name}|g
s|/var/streaming/logs/|%{_localstatedir}/log/%{name}/|g
s|/var/streaming/|%{_localstatedir}/lib/%{name}/|g
' DSS_MakeRoot streamingserver.xml-POSIX \
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
./DSS_MakeRoot \
$RPM_BUILD_ROOT
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+
# Create our default admin user and remove Apple's
# Default login is root/pld -- please change it!
qtpasswd="\
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart
+
+%preun
+if [ "$1" = "0" ]; then
+ %service -q %{name} stop
+ /sbin/chkconfig --del %{name}
+fi
+
%files
%defattr(644,root,root,755)
%doc APPLE_LICENSE ReleaseNotes.txt
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/streamingloadtool.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/streamingserver.xml
+%attr(754,root,root) /etc/rc.d/init.d/dss
%attr(755,root,root) %{_bindir}/MP3Broadcaster
%attr(755,root,root) %{_bindir}/PlaylistBroadcaster
%attr(755,root,root) %{_bindir}/StreamingLoadTool