2009-07-30 18:07:53 +02:00
#
2011-04-15 16:12:10 +02:00
# spec file for package polkit
2009-07-30 18:07:53 +02:00
#
2014-12-30 12:34:25 +01:00
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
2009-07-30 18:07:53 +02:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
2012-02-09 18:05:33 +01:00
2012-11-15 11:48:44 +01:00
%define with_systemd 1
%if 0%{with_systemd}
%define systemdsystemunitdir %(pkg-config --variable systemdsystemunitdir systemd)
%endif
2012-01-04 22:05:01 +01:00
2009-07-30 18:07:53 +02:00
Name : polkit
Summary : PolicyKit Authorization Framework
2011-12-06 18:52:22 +01:00
License : LGPL-2.1+
2012-01-04 21:57:24 +01:00
Group : System/Libraries
2013-09-19 04:38:37 +02:00
Version : 0.112
2012-01-04 21:57:24 +01:00
Release : 0
2013-09-27 10:51:58 +02:00
Url : http://www.freedesktop.org/wiki/Software/polkit/
2009-07-30 18:07:53 +02:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
2012-09-21 23:03:29 +02:00
Source0 : http://www.freedesktop.org/software/polkit/releases/%{name} -%{version} .tar.gz
2014-12-30 12:34:25 +01:00
Source1 : http://www.freedesktop.org/software/polkit/releases/%{name} -%{version} .tar.gz.sign
Source2 : %name.keyring
2010-08-26 11:13:54 +02:00
Source99 : baselibs.conf
2012-01-04 21:57:24 +01:00
# PATCH-FIX-OPENSUSE polkit-no-wheel-group.patch vuntz@opensuse.org -- In openSUSE, there's no special meaning for the wheel group, so we shouldn't allow it to be admin
Patch0 : polkit-no-wheel-group.patch
2013-01-15 10:23:57 +01:00
# PATCH-FIX-UPSTREAM polkit-no-systemd.patch bnc#782395 fdo#55377 vuntz@opensuse.org -- Do not reference non-existing polkit.service file for systemd (only applied if not built with systemd support)
2013-06-15 09:47:13 +02:00
Patch1 : polkit-no-systemd.patch
2012-02-24 13:54:59 +01:00
# needed for patch1
BuildRequires : autoconf
# needed for patch1
BuildRequires : automake
2012-09-21 23:03:29 +02:00
BuildRequires : glib2-devel >= 2.30.0
2011-03-09 15:03:42 +01:00
BuildRequires : gobject-introspection-devel >= 0.6.2
2009-07-30 18:07:53 +02:00
BuildRequires : gtk-doc
2011-08-12 20:03:34 +02:00
# gtk-doc drags indirectyly ruby in for one of the helpers. This in turn causes a build cycle.
#!BuildIgnore: ruby
2009-07-30 18:07:53 +02:00
BuildRequires : intltool
2010-08-26 11:13:54 +02:00
BuildRequires : libexpat-devel
2012-11-16 03:04:03 +01:00
# needed for patch1 and patch3
2012-02-24 13:54:59 +01:00
BuildRequires : libtool
2010-08-26 11:13:54 +02:00
BuildRequires : pam-devel
2012-01-04 23:08:35 +01:00
%if 0%{?with_systemd}
2012-01-04 22:05:01 +01:00
BuildRequires : systemd-devel
2012-01-04 23:08:35 +01:00
%endif
2013-07-05 14:29:07 +02:00
%if 0%{?suse_version} >= 1310
BuildRequires : pkgconfig(mozjs-17.0)
%else
2012-09-21 23:03:29 +02:00
BuildRequires : pkgconfig(mozjs185)
2013-07-05 14:29:07 +02:00
%endif
2012-11-09 18:52:25 +01:00
PreReq : permissions pwdutils
2012-11-16 03:04:03 +01:00
%if ! %{with_systemd}
2009-07-30 18:07:53 +02:00
Requires : ConsoleKit
2012-11-16 03:04:03 +01:00
%endif
2009-07-30 18:07:53 +02:00
Requires : dbus-1
Requires : libpolkit0 = %{version} -%{release}
2012-11-15 11:48:44 +01:00
%if %{with_systemd}
%systemd_requires
%endif
2009-07-30 18:07:53 +02:00
2011-04-26 19:03:02 +02:00
# Upstream First - Policy:
# Never add any patches to this package without the upstream commit id
# in the patch. Any patches added here without a very good reason to make
# an exception will be silently removed with the next version update.
2009-07-30 18:07:53 +02:00
%description
PolicyKit is a toolkit for defining and handling authorizations.
It is used for allowing unprivileged processes to speak to privileged
processes.
%package devel
Summary : Development files for PolicyKit
2010-08-26 11:13:54 +02:00
Group : Development/Libraries/C and C++
2009-07-30 18:07:53 +02:00
Requires : %name = %{version} -%{release}
2012-01-09 11:07:22 +01:00
Requires : libpolkit0 = %{version}
2009-07-30 18:07:53 +02:00
Requires : pkgconfig
2012-06-14 09:36:01 +02:00
Requires : typelib-1_0-Polkit-1_0 = %{version}
2009-07-30 18:07:53 +02:00
%description devel
Development files for PolicyKit Authorization Framework.
%package doc
Summary : Development documentation for PolicyKit
2010-08-26 11:13:54 +02:00
Group : Development/Libraries/C and C++
2010-01-18 13:07:53 +01:00
%if 0%{?suse_version} >= 1120
BuildArch : noarch
%endif
2009-07-30 18:07:53 +02:00
%description doc
Development documentation for PolicyKit Authorization Framework.
%package -n libpolkit0
2012-01-09 11:07:22 +01:00
Summary : PolicyKit Authorization Framework -- Libraries
2010-08-26 11:13:54 +02:00
Group : System/Libraries
2012-11-16 03:04:03 +01:00
Requires : %{name} >= %{version}
2009-07-30 18:07:53 +02:00
%description -n libpolkit0
PolicyKit is a toolkit for defining and handling authorizations.
It is used for allowing unprivileged processes to speak to privileged
processes.
This package contains the libraries only.
2012-01-09 11:07:22 +01:00
%package -n typelib-1_0-Polkit-1_0
Summary : PolicyKit Authorization Framework -- Introspection bindings
Group : System/Libraries
%description -n typelib-1_0-Polkit-1_0
PolicyKit is a toolkit for defining and handling authorizations.
It is used for allowing unprivileged processes to speak to privileged
processes.
This package provides the GObject Introspection bindings for PolicyKit.
2009-07-30 18:07:53 +02:00
%prep
%setup -q
2011-11-02 17:05:54 +01:00
%patch0 -p1
2012-09-27 11:04:21 +02:00
%if !(0%{?with_systemd})
2013-06-15 09:47:13 +02:00
%patch1 -p1
2012-09-27 11:04:21 +02:00
%endif
2009-07-30 18:07:53 +02:00
%build
2010-04-16 01:31:12 +02:00
export V=1
2013-01-15 10:22:38 +01:00
# needed for patch1
2012-02-24 13:54:59 +01:00
autoreconf -fi
export SUID_CFLAGS=" - f P I E "
2012-08-22 20:26:50 +02:00
export SUID_LDFLAGS=" - z n o w - p i e "
2009-07-30 18:07:53 +02:00
%configure \
--with-os-type=suse \
--enable-gtk-doc \
2012-02-24 13:54:59 +01:00
--with-pic \
2009-07-30 18:07:53 +02:00
--disable-static \
2010-08-26 11:13:54 +02:00
--enable-introspection \
2010-01-18 13:07:53 +01:00
--enable-examples \
2012-09-21 23:03:29 +02:00
%if 0%{?with_systemd}
--enable-libsystemd-login \
%else
--disable-libsystemd-login \
%endif
--libexecdir=%{_libexecdir} /polkit-1
2012-02-24 13:54:59 +01:00
make %{?_smp_mflags}
2009-07-30 18:07:53 +02:00
%install
2012-09-21 23:03:29 +02:00
%make_install
rm $RPM_BUILD_ROOT %{_libdir} /*.la
2012-09-25 17:49:47 +02:00
# create $HOME for polkit user
install -d %{buildroot} %{_localstatedir} /lib/polkit
2009-07-30 18:07:53 +02:00
%find_lang polkit-1
%clean
rm -rf $RPM_BUILD_ROOT
2012-09-21 23:03:29 +02:00
%pre
getent group polkitd > /dev/null || groupadd -r polkitd
2012-09-25 17:49:47 +02:00
getent passwd polkitd > /dev/null || useradd -r -g polkitd -d %{_localstatedir} /lib/polkit -s /sbin/nologin -c " U s e r f o r p o l k i t d " polkitd
2012-11-15 11:48:44 +01:00
%if %{with_systemd}
%service_add_pre polkit.service
%endif
2012-09-21 23:03:29 +02:00
exit 0
2012-11-15 11:48:44 +01:00
%if %{with_systemd}
%preun
%service_del_preun polkit.service
%postun
%service_del_postun polkit.service
%endif
2009-07-30 18:07:53 +02:00
%post
2011-05-06 23:12:17 +02:00
%set_permissions %{_bindir} /pkexec
%set_permissions %{_prefix} /lib/polkit-1/polkit-agent-helper-1
2012-11-15 11:48:44 +01:00
%if %{with_systemd}
%service_add_post polkit.service
%endif
2011-05-06 23:12:17 +02:00
2009-07-30 18:07:53 +02:00
%verify script
2009-08-13 23:33:53 +02:00
%verify _permissions -e %{_bindir} /pkexec
2009-07-30 18:07:53 +02:00
%verify _permissions -e %{_prefix} /lib/polkit-1/polkit-agent-helper-1
%post -n libpolkit0 -p /sbin/ldconfig
%postun -n libpolkit0 -p /sbin/ldconfig
%files -n libpolkit0
%defattr (-,root,root,-)
2012-09-21 23:03:29 +02:00
%{_libdir} /libpolkit-agent-1.so.*
%{_libdir} /libpolkit-gobject-1.so.*
2012-01-09 11:07:22 +01:00
%files -n typelib-1_0-Polkit-1_0
%defattr (-,root,root,-)
2010-08-26 11:13:54 +02:00
%{_libdir} /girepository-1.0/Polkit-1.0.typelib
2011-04-15 16:12:10 +02:00
%{_libdir} /girepository-1.0/PolkitAgent-1.0.typelib
2009-07-30 18:07:53 +02:00
%files -f polkit-1.lang
%defattr (-,root,root,-)
%doc COPYING
2012-09-21 23:03:29 +02:00
%{_mandir} /man1/pkexec.1%{?ext_man}
%{_mandir} /man1/pkaction.1%{?ext_man}
%{_mandir} /man1/pkcheck.1%{?ext_man}
%{_mandir} /man1/pkttyagent.1%{?ext_man}
%{_mandir} /man8/polkitd.8%{?ext_man}
%{_mandir} /man8/polkit.8%{?ext_man}
2010-11-11 13:26:16 +01:00
%dir %{_datadir} /dbus-1
2012-09-21 23:03:29 +02:00
%dir %{_datadir} /dbus-1/system-services
%{_datadir} /dbus-1/system-services/org.freedesktop.PolicyKit1.service
2009-07-30 18:07:53 +02:00
%dir %{_datadir} /polkit-1
%dir %{_datadir} /polkit-1/actions
%{_datadir} /polkit-1/actions/org.freedesktop.policykit.policy
2012-09-27 11:04:21 +02:00
%attr (0700,polkitd,root) %dir %{_datadir} /polkit-1/rules.d
2010-11-11 13:26:16 +01:00
%dir %{_sysconfdir} /dbus-1
%dir %{_sysconfdir} /dbus-1/system.d
2013-01-09 15:30:23 +01:00
%config %{_sysconfdir} /dbus-1/system.d/org.freedesktop.PolicyKit1.conf
%config %{_sysconfdir} /pam.d/polkit-1
2010-08-26 11:13:54 +02:00
%dir %{_sysconfdir} /polkit-1
2012-09-27 11:04:21 +02:00
%attr (0700,polkitd,root) %dir %{_sysconfdir} /polkit-1/rules.d
2013-01-09 15:30:23 +01:00
%config %{_sysconfdir} /polkit-1/rules.d/50-default.rules
2009-07-30 18:07:53 +02:00
%{_bindir} /pkaction
%{_bindir} /pkcheck
2009-08-13 23:33:53 +02:00
%verify (not mode) %attr (4755,root,root) %{_bindir} /pkexec
2012-09-21 23:03:29 +02:00
%{_bindir} /pkttyagent
%dir %{_libexecdir} /polkit-1
%{_libexecdir} /polkit-1/polkitd
2009-08-13 23:33:53 +02:00
%verify (not mode) %attr (4755,root,root) %{_prefix} /lib/polkit-1/polkit-agent-helper-1
2012-09-25 17:49:47 +02:00
# $HOME for polkit user
%dir %{_localstatedir} /lib/polkit
2012-11-15 11:48:44 +01:00
%if %{with_systemd}
%{systemdsystemunitdir} /polkit.service
%endif
2009-07-30 18:07:53 +02:00
%files devel
%defattr (-,root,root,-)
2012-09-21 23:03:29 +02:00
%{_libdir} /libpolkit-agent-1.so
%{_libdir} /libpolkit-gobject-1.so
%{_libdir} /pkgconfig/polkit-agent-1.pc
%{_libdir} /pkgconfig/polkit-gobject-1.pc
%{_includedir} /polkit-1/
2009-07-30 18:07:53 +02:00
%{_bindir} /pk-example-frobnicate
2010-08-26 11:13:54 +02:00
%{_datadir} /gir-1.0/*.gir
2009-07-30 18:07:53 +02:00
%{_datadir} /polkit-1/actions/org.freedesktop.policykit.examples.pkexec.policy
%files doc
%defattr (-,root,root,-)
2011-03-09 15:03:42 +01:00
%doc NEWS
2012-09-21 23:03:29 +02:00
%doc %{_datadir} /gtk-doc/html/polkit-1/
2009-07-30 18:07:53 +02:00
%changelog