From e12485c59408d11b43024a6da5b729708ac86187 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 07:09:41 +0100 Subject: [PATCH] install configuration files, systemd service, man pages [release 1.3.0-2mamba;Fri Feb 12 2021] --- minidlna.service | 16 ++++++++++++++++ minidlna.spec | 43 ++++++++++++++++++++++++++++++++++++++++++- minidlna.sysusers | 1 + minidlna.tmpfiles | 5 +++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 minidlna.service create mode 100644 minidlna.sysusers create mode 100644 minidlna.tmpfiles diff --git a/minidlna.service b/minidlna.service new file mode 100644 index 0000000..fca14f5 --- /dev/null +++ b/minidlna.service @@ -0,0 +1,16 @@ +[Unit] +Description=minidlna server +After=network.target + +[Service] +Type=simple +User=minidlna +Group=minidlna +ExecStart=/usr/sbin/minidlnad -S +ProtectSystem=full +ProtectHome=on +PrivateDevices=on +NoNewPrivileges=on + +[Install] +WantedBy=multi-user.target diff --git a/minidlna.spec b/minidlna.spec index 9004aa9..5e5616b 100644 --- a/minidlna.spec +++ b/minidlna.spec @@ -1,6 +1,6 @@ Name: minidlna Version: 1.3.0 -Release: 1mamba +Release: 2mamba Summary: A simple media server software, with the aim of being fully compliant with DLNA/UPnP-AV clients Group: Applications/Multimedia Vendor: openmamba @@ -8,9 +8,14 @@ Distribution: openmamba Packager: Silvan Calarco URL: https://sourceforge.net/projects/minidlna/ Source: https://downloads.sourceforge.net/project/minidlna/minidlna/%{version}/minidlna-%{version}.tar.gz +Source1: minidlna.service +Source2: minidlna.sysusers +Source3: minidlna.tmpfiles License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel +BuildRequires: ldconfig +BuildRequires: libavcodec-ffmpeg-devel BuildRequires: libavformat-ffmpeg-devel BuildRequires: libavutil-ffmpeg-devel BuildRequires: libexif-devel @@ -20,7 +25,9 @@ BuildRequires: libjpeg-devel BuildRequires: libogg-devel BuildRequires: libsqlite-devel BuildRequires: libvorbis-devel +BuildRequires: libz-devel ## AUTOBUILDREQ-END +%systemd_requires BuildRoot: %{_tmppath}/%{name}-%{version}-root %description @@ -33,23 +40,57 @@ ReadyMedia (formerly known as MiniDLNA) is a simple media server software, with %build %configure + %make %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %makeinstall +install -Dm644 minidlna.conf %{buildroot}%{_sysconfdir}/minidlna.conf +install -Dm0644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/minidlna.conf +install -Dm0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/minidlna.conf +install -Dm0644 %{SOURCE1} %{buildroot}%{_unitdir}/minidlna.service +install -Dm644 minidlna.conf.5 %{buildroot}%{_mandir}/man5/minidlna.conf.5 +install -Dm644 minidlnad.8 %{buildroot}%{_mandir}/man8/minidlnad.8 + %find_lang %{name} || touch %{name}.lang +%pre +%sysusers_create_package minidlna %{SOURCE2} +%tmpfiles_create_package minidlna %{SOURCE3} +: + +%post +%systemd_post minidlna +: + +%preun +%systemd_preun minidlna +: + +%postun +%systemd_postun_with_restart minidlna +: + %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %files -f %{name}.lang %defattr(-,root,root) +%config(noreplace) %{_sysconfdir}/minidlna.conf %{_sbindir}/minidlnad +%{_unitdir}/minidlna.service +%{_sysusersdir}/minidlna.conf +%{_tmpfilesdir}/minidlna.conf +%{_mandir}/man5/minidlna.conf.5* +%{_mandir}/man8/minidlnad.8* %doc AUTHORS COPYING %changelog +* Fri Feb 12 2021 Silvan Calarco 1.3.0-2mamba +- install configuration files, systemd service, man pages + * Sat Nov 28 2020 Automatic Build System 1.3.0-1mamba - automatic version update by autodist diff --git a/minidlna.sysusers b/minidlna.sysusers new file mode 100644 index 0000000..9fd884b --- /dev/null +++ b/minidlna.sysusers @@ -0,0 +1 @@ +u minidlna - "minidlna server" /var/cache/minidlna diff --git a/minidlna.tmpfiles b/minidlna.tmpfiles new file mode 100644 index 0000000..663222f --- /dev/null +++ b/minidlna.tmpfiles @@ -0,0 +1,5 @@ +# systemd tmpfile settings for minidlna +# See tmpfiles.d(5) for details + +d /run/minidlna 0755 minidlna minidlna - +d /var/cache/minidlna 0755 minidlna minidlna -