Accepting request 482543 from GNOME:Next

1

OBS-URL: https://build.opensuse.org/request/show/482543
OBS-URL: https://build.opensuse.org/package/show/Application:Geo/geoclue2?expand=0&rev=58
This commit is contained in:
Martin Pluskal 2017-03-24 16:26:23 +00:00 committed by Git OBS Bridge
parent dfac9c3dbc
commit b26982af59
3 changed files with 35 additions and 6 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Mar 15 20:19:10 UTC 2017 - dimstar@opensuse.org
- Split out new package system-user-srvGeoClue: create a user that
can be required by different package (e.g. NetworkManager has a
rule based on the user account. With the user created separately,
NM can now require the user even without geoclue2 being
installed).
-------------------------------------------------------------------
Wed Mar 1 16:05:18 UTC 2017 - zaitor@opensuse.org

View File

@ -17,7 +17,6 @@
%define _name geoclue
%define dbus_user srvGeoClue
Name: geoclue2
Version: 2.4.5
Release: 0
@ -26,6 +25,7 @@ License: GPL-2.0+
Group: System/Libraries
Url: http://people.freedesktop.org/~zeenix/releases/
Source: http://www.freedesktop.org/software/geoclue/releases/2.4/%{_name}-%{version}.tar.xz
Source1: srvGeoClue.conf
Source99: geoclue2-rpmlintrc
# PATCH-FIX-UPSTREAM geoclue2-permit-gnome-maps.patch dimstar@opensuse.org -- Allow gnome-maps to access geoclue
Patch0: geoclue2-permit-gnome-maps.patch
@ -35,6 +35,7 @@ BuildRequires: gtk-doc
BuildRequires: intltool >= 0.40.0
BuildRequires: pkg-config
BuildRequires: systemd-rpm-macros
BuildRequires: sysuser-tools
BuildRequires: perl(XML::Parser)
BuildRequires: pkgconfig(avahi-client) >= 0.6.10
BuildRequires: pkgconfig(avahi-glib) >= 0.6.10
@ -48,6 +49,8 @@ BuildRequires: pkgconfig(mm-glib) >= 1.0
BuildRequires: pkgconfig(systemd)
# we require shadow for useradd
Requires(pre): shadow
# This daemon runs as srvGeoClue
Requires: user(srvGeoClue)
# Virtual provides for the dbus service
Provides: dbus(org.freedesktop.GeoClue2) = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -58,6 +61,14 @@ GeoClue is a software framework which can be used to enable geospatial
awareness in applications. GeoClue uses the D-Bus inter-process
communication mechanism to provide location information
%package -n system-user-srvGeoClue
Summary: System user for the geoclue service
Group: System/Libraries
%sysusers_requires
%description -n system-user-srvGeoClue
System user for use by the geoclue service
%package -n typelib-1_0-Geoclue-2_0
Summary: GeoLocation Framework --GObject Introspection
Group: System/Libraries
@ -87,21 +98,24 @@ communication mechanism to provide location information
%configure \
--disable-geoip-server \
--enable-introspection \
--with-dbus-service-user=%{dbus_user}
--with-dbus-service-user=srvGeoClue
make %{?_smp_mflags} V=1
%sysusers_generate_pre %{SOURCE1} srvGeoClue
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -d %{buildroot}%{_localstatedir}/lib/%{dbus_user}
install -d %{buildroot}%{_localstatedir}/lib/srvGeoClue
mkdir -p %{buildroot}%{_sysusersdir}
install -m 644 %{SOURCE1} %{buildroot}%{_sysusersdir}/system-user-srvGeoClue.conf
find %{buildroot} -type f -name "*.la" -delete -print
# Remove desktop file, we do not build the demos
find %{buildroot} -type f -name "geoclue-demo-agent.desktop" -delete -print
%pre
getent passwd %{dbus_user} > /dev/null || useradd -r -g nogroup -d %{_localstatedir}/lib/%{dbus_user} -s /sbin/nologin -c "User for GeoClue D-Bus service" %{dbus_user}
# note: do not use systemd macros for geoclue2.service, they are not meant for dbus unit files.
%pre -n system-user-srvGeoClue -f srvGeoClue.pre
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -129,9 +143,13 @@ getent passwd %{dbus_user} > /dev/null || useradd -r -g nogroup -d %{_localstate
%config %{_sysconfdir}/geoclue/geoclue.conf
%config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.GeoClue2.conf
%config %{_sysconfdir}/dbus-1/system.d/org.freedesktop.GeoClue2.Agent.conf
%attr(0700,%{dbus_user},root) %{_localstatedir}/lib/%{dbus_user}
%{_unitdir}/geoclue.service
%files -n system-user-srvGeoClue
%defattr(-,root,root)
%attr(0700,srvGeoClue,root) %{_localstatedir}/lib/srvGeoClue
%{_sysusersdir}/system-user-srvGeoClue.conf
%files -n typelib-1_0-Geoclue-2_0
%defattr(-,root,root)
%{_libdir}/girepository-1.0/Geoclue-2.0.typelib

2
srvGeoClue.conf Normal file
View File

@ -0,0 +1,2 @@
# Type Name ID GECOS [HOME]
u srvGeoClue - "User for GeoClue D-Bus service" /var/lib/srvGeoClue