summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2011-12-06 13:47:25 +0000
committerRichard Hughes <richard@hughsie.com>2011-12-06 16:26:54 +0000
commitc7e5a8b0f15cd43e788ea9da145c4265a51b6899 (patch)
tree03562ee513e77c991382a43503b9ed9d1d4bc654 /contrib
parent78b6dc7dbf865df6b0d30526293591fe5773029a (diff)
downloadcolord-c7e5a8b0f15cd43e788ea9da145c4265a51b6899.tar.gz
Add org.freedesktop.policykit.owner annotations to .policy file
We only add those annotations when the daemon is configured to run as non-root. Signed-off-by: Richard Hughes <richard@hughsie.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/colord.spec.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/contrib/colord.spec.in b/contrib/colord.spec.in
index bc0ba7f..e46c7d1 100644
--- a/contrib/colord.spec.in
+++ b/contrib/colord.spec.in
@@ -16,7 +16,7 @@ BuildRequires: intltool
BuildRequires: lcms2-devel
BuildRequires: libgudev1-devel
BuildRequires: libusb1-devel
-BuildRequires: polkit-devel
+BuildRequires: polkit-devel >= 0.103
BuildRequires: sane-backends-devel
BuildRequires: sqlite-devel
BuildRequires: gobject-introspection-devel
@@ -25,6 +25,7 @@ BuildRequires: libgusb-devel
Requires: shared-color-profiles
Requires: color-filesystem
+Requires(pre): shadow-utils
%description
colord is a low level system activated daemon that maps color devices
@@ -42,6 +43,7 @@ Files for development with %{name}.
%build
%configure \
+ --with-daemon-user=colord \
--disable-static \
--disable-rpath \
--disable-dependency-tracking
@@ -61,6 +63,13 @@ touch $RPM_BUILD_ROOT%{_localstatedir}/lib/colord/storage.db
%find_lang %{name}
+%pre
+getent group colord >/dev/null || groupadd -r colord
+getent passwd colord >/dev/null || \
+ useradd -r -g colord -d /var/lib/colord -s /sbin/nologin \
+ -c "User for colord" colord
+exit 0
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@@ -69,7 +78,7 @@ touch $RPM_BUILD_ROOT%{_localstatedir}/lib/colord/storage.db
%defattr(-,root,root,-)
%doc README AUTHORS NEWS COPYING
%{_libexecdir}/colord
-%dir %{_localstatedir}/lib/colord
+%attr(755,colord,colord) %dir %{_localstatedir}/lib/colord
%{_bindir}/*
%{_sysconfdir}/dbus-1/system.d/org.freedesktop.ColorManager.conf
%{_datadir}/dbus-1/interfaces/org.freedesktop.ColorManager*.xml