[packages/mopidy] add mopidy system user
glen
glen at pld-linux.org
Tue Sep 20 17:20:25 CEST 2016
commit bf282cac1eee28d2951f6d07621efe9004ac8dc1
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Sep 20 18:03:20 2016 +0300
add mopidy system user
mopidy.spec | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
---
diff --git a/mopidy.spec b/mopidy.spec
index fad0a95..92a4b44 100644
--- a/mopidy.spec
+++ b/mopidy.spec
@@ -3,7 +3,7 @@
Summary: Music server with MPD and Spotify support
Name: mopidy
Version: 2.0.0
-Release: 0.2
+Release: 0.3
License: Apache v2.0
Group: Development/Libraries
Source0: https://github.com/mopidy/mopidy/archive/v%{version}/%{name}-%{version}.tar.gz
@@ -21,6 +21,14 @@ Requires: python-pygobject
Requires: python-pykka
Requires: python-requests
Requires: python-tornado
+Provides: group(mopidy)
+Provides: user(mopidy)
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -53,6 +61,16 @@ cp %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
%clean
rm -rf $RPM_BUILD_ROOT
+%pre
+%groupadd -g 332 %{name}
+%useradd -u 332 -d /var/lib/%{name} -g %{name} -c "System user to run mopidy service" %{name}
+
+%postun
+if [ "$1" = "0" ]; then
+ %userremove %{name}
+ %groupremove %{name}
+fi
+
%files
%defattr(644,root,root,755)
%dir %{_sysconfdir}/%{name}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/mopidy.git/commitdiff/ea65d6d09dd38c02c378e57b9b0b68da7130aa11
More information about the pld-cvs-commit
mailing list