packages: minidlna/minidlna.spec, minidlna/minidlna.init (NEW) - rel 1; ini...
arekm
arekm at pld-linux.org
Thu Sep 1 20:58:13 CEST 2011
Author: arekm Date: Thu Sep 1 18:58:13 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 1; init script from Przemyslaw Plewa
---- Files affected:
packages/minidlna:
minidlna.spec (1.2 -> 1.3) , minidlna.init (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/minidlna/minidlna.spec
diff -u packages/minidlna/minidlna.spec:1.2 packages/minidlna/minidlna.spec:1.3
--- packages/minidlna/minidlna.spec:1.2 Thu Sep 1 14:13:12 2011
+++ packages/minidlna/minidlna.spec Thu Sep 1 20:58:08 2011
@@ -3,11 +3,12 @@
Summary(pl.UTF-8): DLNA server software
Name: minidlna
Version: 1.0.22
-Release: 0.1
+Release: 1
License: GPL
Group: Networking/Daemons
Source0: http://downloads.sourceforge.net/minidlna/%{name}_%{version}_src.tar.gz
# Source0-md5: 3de2f6b54f43bb998dfad3c8fa75cef3
+Source1: %{name}.init
URL: http://sourceforge.net/projects/minidlna/
BuildRequires: ffmpeg-devel
BuildRequires: flac-devel
@@ -32,16 +33,23 @@
%prep
%setup -q
+sed -i -e 's#-O3#$(OPTFLAGS)#g' Makefile
%build
-%{__make}
+%{__make} \
+ CC="%{__cc}" \
+ OPTFLAGS="%{rpmcflags} %{rpmcppflags}"
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+
%post
/sbin/chkconfig --add %{name}
%service %{name} restart
@@ -58,8 +66,7 @@
%files
%defattr(644,root,root,755)
%doc NEWS README TODO
-#%attr(754,root,root) /etc/rc.d/init.d/%{name}
-#%attr(754,root,root) %{_sysconfdir}/init.d/minidlna
+%attr(754,root,root) /etc/rc.d/init.d/minidlna
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/minidlna.conf
%attr(755,root,root) %{_sbindir}/minidlna
@@ -70,6 +77,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.3 2011/09/01 18:58:08 arekm
+- rel 1; init script from Przemyslaw Plewa
+
Revision 1.2 2011/09/01 12:13:12 arekm
- up to 1.0.22
================================================================
Index: packages/minidlna/minidlna.init
diff -u /dev/null packages/minidlna/minidlna.init:1.1
--- /dev/null Thu Sep 1 20:58:13 2011
+++ packages/minidlna/minidlna.init Thu Sep 1 20:58:08 2011
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+# minidlna This shell script takes care of starting and stopping minidlna
+#
+# chkconfig: 345 85 15
+#
+# description: MiniDLNA (aka ReadyDLNA) is server software with the aim of being
+# fully compliant with DLNA/UPnP-AV clients.
+#
+# processname: minidlna
+# config: /etc/minidlna.conf
+# pidfile: /var/run/minidlna.pid
+#
+
+
+# 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 "minidlna"
+ exit 1
+ fi
+else
+ exit 0
+fi
+
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/minidlna ] && . /etc/sysconfig/minidlna
+
+pidfile="/var/run/minidlna.pid"
+
+
+start() {
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/minidlna ]; then
+ msg_already_running "minidlna"
+ return
+ fi
+
+ msg_starting "minidlna"
+ daemon /usr/sbin/minidlna
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/minidlna
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/minidlna ]; then
+ msg_not_running "minidlna"
+ return
+ fi
+
+ # Stop daemons.
+ msg_stopping "minidlna"
+ killproc minidlna
+ rm -f /var/lock/subsys/minidlna
+}
+
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/minidlna ]; then
+ msg_not_running "minidlna"
+ 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
+ ;;
+# use this one if program doesn't support reloading without restart
+ force-reload)
+ condrestart 7
+ ;;
+ status)
+ status minidlna
+ RETVAL=$?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+
+exit $RETVAL
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/minidlna/minidlna.spec?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list