From d1a17d3c0e40889540fd7050a81f1e4295536716ce3d28b789e2e1376636ac37 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Mon, 27 Feb 2012 23:11:26 +0000 Subject: [PATCH] Accepting request 107166 from home:vuntz:branches:GNOME:Factory Fix systemd-related packaging OBS-URL: https://build.opensuse.org/request/show/107166 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/colord?expand=0&rev=32 --- colord.changes | 8 ++++++++ colord.spec | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/colord.changes b/colord.changes index 41fc4f8..1624e81 100644 --- a/colord.changes +++ b/colord.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Feb 27 13:24:10 UTC 2012 - vuntz@opensuse.org + +- Fix systemd-related packaging: + + Use %{?systemd_requires}. + + Call %service_{add,del}_* macros in scriptlets for + colord.service. + ------------------------------------------------------------------- Thu Feb 23 07:51:54 UTC 2012 - vuntz@opensuse.org diff --git a/colord.spec b/colord.spec index 5e62eed..24ce9c0 100644 --- a/colord.spec +++ b/colord.spec @@ -45,6 +45,7 @@ Requires(pre): pwdutils Requires: shared-color-profiles Recommends: %{name}-lang BuildRoot: %{_tmppath}/%{name}-%{version}-build +%{?systemd_requires} %description colord is a system activated daemon that maps devices to color profiles. @@ -110,12 +111,23 @@ popd %find_lang %{name} %pre +%service_add_pre colord.service +# Create colord user getent group colord >/dev/null || groupadd -r colord getent passwd colord >/dev/null || useradd -r -g colord -d %{_localstatedir}/lib/colord -s /sbin/nologin -c "user for colord" colord # Fix ownership of /var/lib/colord from first packages (in 12.1) test ! -d %{_localstatedir}/lib/colord || chown -R colord:colord %{_localstatedir}/lib/colord exit 0 +%post +%service_add_post colord.service + +%preun +%service_del_preun colord.service + +%postun +%service_del_postun colord.service + %post -n libcolord1 -p /sbin/ldconfig %postun -n libcolord1 -p /sbin/ldconfig @@ -123,7 +135,7 @@ exit 0 %files %defattr(-,root,root) %doc AUTHORS ChangeLog COPYING NEWS README -/lib/systemd/system/colord.service +%{_unitdir}/colord.service /lib/udev/rules.d/*.rules %attr(755,colord,colord) %dir %{_localstatedir}/lib/colord %config(noreplace) %{_sysconfdir}/%{name}.conf