--- /dev/null
+--- minidlna-1.0.25/minidlna.conf.wiget 2012-11-18 11:12:19.015994831 +0100
++++ minidlna-1.0.25/minidlna.conf 2012-11-18 11:19:02.359311611 +0100
+@@ -11,16 +11,16 @@ port=8200
+ # + "A" for audio (eg. media_dir=A,/home/jmaggard/Music)
+ # + "V" for video (eg. media_dir=V,/home/jmaggard/Videos)
+ # + "P" for images (eg. media_dir=P,/home/jmaggard/Pictures)
+-media_dir=/opt
++#media_dir=/opt
+
+ # set this if you want to customize the name that shows up on your clients
+ #friendly_name=My DLNA Server
+
+ # set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache
+-#db_dir=/var/cache/minidlna
++db_dir=/var/cache/minidlna
+
+ # set this if you would like to specify the directory where you want MiniDLNA to store its log file
+-#log_dir=/var/log
++log_dir=/var/log/minidlna
+
+ # set this to change the verbosity of the information that is logged
+ # each section can use a different level: off, fatal, error, warn, info, or debug
+# TODO:
+# logrotate
+#
Summary: DLNA server software
Summary(pl.UTF-8): Oprogramowanie serwerowe DLNA
Name: minidlna
Version: 1.0.25
-Release: 3
+Release: 4
License: GPL v2
Group: Networking/Daemons
Source0: http://downloads.sourceforge.net/minidlna/%{name}_%{version}_src.tar.gz
# Source0-md5: d966256baf2f9b068b9de871ab5dade5
Source1: %{name}.init
+Source2: %{name}.service
+Source3: %{name}.tmpfiles
# https://gitorious.org/debian-pkg/minidlna/blobs/raw/master/debian/minidlna.1
Source4: %{name}.1
# https://gitorious.org/debian-pkg/minidlna/blobs/raw/master/debian/minidlna.conf.5
Source5: %{name}.conf.5
Patch0: %{name}-ffmpeg10.patch
+Patch1: config.patch
URL: http://sourceforge.net/projects/minidlna/
# libavcodec libavformat libavutil
BuildRequires: ffmpeg-devel
BuildRequires: flac-devel
BuildRequires: gettext-devel
-BuildRequires: libdlna-devel >= 0.2.1
BuildRequires: libexif-devel
BuildRequires: libid3tag-devel
BuildRequires: libjpeg-devel
BuildRequires: libvorbis-devel
BuildRequires: rpmbuild(macros) >= 1.228
BuildRequires: sed >= 4.0
-BuildRequires: sqlite3-devel
+BuildRequires: sqlite3-devel >= 3.5.1
Requires(post,preun): /sbin/chkconfig
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%{__sed} -i -e 's#-g -O3#$(OPTFLAGS)#g' Makefile
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_mandir}/man{1,5}}
+install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_mandir}/man{1,5}} \
+ $RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{systemdunitdir}} \
+ $RPM_BUILD_ROOT/var/{log,run,cache}/%{name}
%{__make} -j1 install \
DESTDIR=$RPM_BUILD_ROOT
%{__make} -j1 install-conf \
DESTDIR=$RPM_BUILD_ROOT
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
# Install man pages
install %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man1/
%find_lang %{name}
+%pre
+%groupadd -g 284 minidlna
+%useradd -u 284 -r -d / -s /bin/false -g minidlna minidlna
+
%post
/sbin/chkconfig --add %{name}
-%service %{name} restart
+%systemd_post %{name}.service
%preun
if [ "$1" = "0" ]; then
%service -q %{name} stop
/sbin/chkconfig --del %{name}
fi
+%systemd_preun %{name}.service
+
+%postun
+if [ "$1" = "0" ]; then
+ %userremove minidlna
+ %groupremove minidlna
+fi
+%systemd_reload
+
+%triggerpostun -- %{name} < 1.0.25-3
+%systemd_trigger %{name}.service
%clean
rm -rf $RPM_BUILD_ROOT
%defattr(644,root,root,755)
%doc LICENCE.miniupnpd NEWS README TODO
%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(640,root,minidlna) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/minidlna.conf
%attr(755,root,root) %{_sbindir}/minidlna
+%{systemdtmpfilesdir}/%{name}.conf
+%{systemdunitdir}/%{name}.service
+%dir %attr(755,minidlna,minidlna) /var/run/%{name}
+%dir %attr(755,minidlna,minidlna) /var/cache/%{name}
+%dir %attr(755,minidlna,minidlna) /var/log/%{name}
%{_mandir}/man1/*
%{_mandir}/man5/*