commit cf55a1081a108dd6ed90d1b0e943ab91c19e2a01
Author: Leigh Scott <leigh123linux(a)googlemail.com>
Date: Wed Jan 16 09:56:36 2019 +0000
Add firewalld sub-package
mpd.spec | 24 +++++++++++++++++++++++-
mpd.xml | 7 +++++++
2 files changed, 30 insertions(+), 1 deletion(-)
---
diff --git a/mpd.spec b/mpd.spec
index cb11ccb..a1f66df 100644
--- a/mpd.spec
+++ b/mpd.spec
@@ -17,7 +17,7 @@
Name: mpd
Epoch: 1
Version: 0.21.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: The Music Player Daemon
License: GPLv2+
URL:
https://www.musicpd.org
@@ -30,6 +30,7 @@ Source1: %{url}/download/mpd/0.21/mpd-%{version}.tar.xz.sig
#
http://bugs.musicpd.org/view.php?id=3814#bugnotes
Source2: mpd.logrotate
Source3: mpd.tmpfiles.d
+Source4: mpd.xml
Patch0: mpd-0.18-mpdconf.patch
Patch1: mpd-0.20-remove_NoNewPrivileges.patch
@@ -92,6 +93,7 @@ Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
+Requires: (%{name}-firewalld = %{?epoch}:%{version}-%{release} if firewalld)
%description
Music Player Daemon (MPD) is a flexible, powerful, server-side application for
@@ -103,6 +105,15 @@ GUI and command-line applications to choose from that act as a
front-end for
browsing and playing your MPD music collection.
+%package firewalld
+Summary: FirewallD metadata file for MPD
+Requires: firewalld-filesystem
+Requires(post): firewalld-filesystem
+
+%description firewalld
+This package contains FirewallD file for MPD.
+
+
%prep
%setup -q -n %{name}-%{version}
%patch0 -p0
@@ -132,6 +143,8 @@ install -p -D -m 0644 %{SOURCE2} \
install -p -D -m 0644 %{SOURCE3} \
%buildroot%{_prefix}/lib/tmpfiles.d/mpd.conf
+install -p -D -m 0644 %{SOURCE4} \
+ %buildroot%{_prefix}/lib/firewalld/services/mpd.xml
mkdir -p %{buildroot}/run
install -d -m 0755 %{buildroot}/%{mpd_rundir}
@@ -174,6 +187,9 @@ fi
%postun
%systemd_postun_with_restart mpd.service
+%post firewalld
+%firewalld_reload
+
%files
%doc AUTHORS README.md
@@ -199,8 +215,14 @@ fi
%ghost %{mpd_logfile}
%ghost %{mpd_statefile}
+%files firewalld
+%{_prefix}/lib/firewalld/services/mpd.xml
+
%changelog
+* Wed Jan 16 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1:0.21.4-2
+- Add firewalld sub-package
+
* Mon Jan 14 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1:0.21.4-1
- Update to 0.21.4
- Add changes for meson build
diff --git a/mpd.xml b/mpd.xml
new file mode 100644
index 0000000..7deda49
--- /dev/null
+++ b/mpd.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<service>
+ <short>mpd</short>
+ <description>Music Player Daemon (MPD) is a service to send audio to local or
remote clients. Enable this option if remote hosts need to receive output from a MPD
running on this machine.</description>
+ <port port="6600" protocol="tcp"/>
+ <port port="8000" protocol="tcp"/>
+</service>