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
#
2022-01-25 19:16:00 +01:00
# Copyright (c) 2022 SUSE LLC
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.
2020-07-31 14:03:13 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2009-07-30 18:07:53 +02:00
#
2012-02-09 18:05:33 +01:00
2022-08-17 13:30:42 +02:00
%define _polkit_rulesdir %{_datadir}/polkit-1/rules.d
%define glib_br_version 2.30.0
%define run_tests 1
2009-07-30 18:07:53 +02:00
Name : polkit
2022-08-17 13:30:42 +02:00
Version : 121
2017-08-30 23:08:18 +02:00
Release : 0
2009-07-30 18:07:53 +02:00
Summary : PolicyKit Authorization Framework
2018-02-28 22:45:09 +01:00
License : LGPL-2.1-or-later
2012-01-04 21:57:24 +01:00
Group : System/Libraries
2020-07-31 14:03:13 +02:00
URL : https://www.freedesktop.org/wiki/Software/polkit/
Source0 : https://www.freedesktop.org/software/polkit/releases/%{name} -%{version} .tar.gz
Source1 : https://www.freedesktop.org/software/polkit/releases/%{name} -%{version} .tar.gz.sign
2018-02-28 22:45:09 +01:00
Source2 : %{name} .keyring
2021-07-19 08:47:41 +02:00
Source3 : system-user-polkitd.conf
2010-08-26 11:13:54 +02:00
Source99 : baselibs.conf
2022-08-17 13:30:42 +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.
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
2017-06-14 09:42:13 +02:00
# PATCH-FIX-OPENSUSE polkit-gettext.patch lnussel@suse.de -- allow fallback to gettext for polkit action translations
2022-08-17 13:30:42 +02:00
# polkit-use-gettext-as-fallback.patch
2018-04-10 10:51:08 +02:00
Patch1 : polkit-gettext.patch
2019-10-08 14:46:03 +02:00
# PATCH-FIX-OPENSUSE polkit-keyinit.patch meissner@ -- bsc#1144053 Please add "pam_keyinit.so" to the /etc/pam.d/polkit-1 configuration file
Patch3 : polkit-keyinit.patch
2022-08-17 13:30:42 +02:00
# PATCH-FIX-OPENSUSE polkit-adjust-libexec-path.patch -- Adjust path to polkit-agent-helper-1 (bsc#1180474)
2021-01-04 11:16:58 +01:00
Patch4 : polkit-adjust-libexec-path.patch
2022-08-17 13:30:42 +02:00
# PATCH-FIX-UPSTREAM polkit-fix-pam-prefix.patch luc14n0@opensuse.org -- Make
# intended use of pam_prefix meson option rather than hard-coded path
Patch5 : polkit-fix-pam-prefix.patch
2022-11-09 16:54:16 +01:00
# Read actions also from /etc/polkit-1/actions
Patch6 : polkit-actions-in-etc.patch
2022-08-17 13:30:42 +02:00
2018-04-10 10:51:08 +02:00
BuildRequires : gcc-c++
2022-08-17 13:30:42 +02:00
BuildRequires : gettext
2009-07-30 18:07:53 +02:00
BuildRequires : gtk-doc
2010-08-26 11:13:54 +02:00
BuildRequires : libexpat-devel
2022-08-17 13:30:42 +02:00
BuildRequires : meson >= 0.50
2010-08-26 11:13:54 +02:00
BuildRequires : pam-devel
2021-12-07 11:14:49 +01:00
BuildRequires : pkgconfig
2018-04-10 10:51:08 +02:00
BuildRequires : systemd-rpm-macros
2021-07-19 08:47:41 +02:00
BuildRequires : sysuser-tools
2022-01-26 13:54:22 +01:00
BuildRequires : pkgconfig(duktape) >= 2.2.0
2022-08-17 13:30:42 +02:00
BuildRequires : pkgconfig(gio-unix-2.0) >= %{glib_br_version}
BuildRequires : pkgconfig(glib-2.0) >= %{glib_br_version}
BuildRequires : pkgconfig(gmodule-2.0) >= %{glib_br_version}
2018-04-10 10:51:08 +02:00
BuildRequires : pkgconfig(gobject-introspection-1.0) >= 0.6.2
BuildRequires : pkgconfig(libsystemd)
BuildRequires : pkgconfig(systemd)
2022-08-17 13:30:42 +02:00
%if 0%{?run_tests}
#################################################################
# python3-dbus-python and python3-python-dbusmock are needed for
# test-polkitbackendjsauthority test:
BuildRequires : python3-dbus-python
BuildRequires : python3-python-dbusmock
#################################################################
%endif
2017-08-30 23:08:18 +02:00
# gtk-doc drags indirectyly ruby in for one of the helpers. This in turn causes a build cycle.
#!BuildIgnore: ruby
2022-08-17 13:30:42 +02:00
2017-08-30 23:08:18 +02:00
Requires : dbus-1
2021-10-20 18:17:29 +02:00
Requires : libpolkit-agent-1-0 = %{version} -%{release}
Requires : libpolkit-gobject-1-0 = %{version} -%{release}
2021-12-06 14:57:16 +01:00
Requires(post) : permissions
2021-12-07 11:14:49 +01:00
%sysusers_requires
2019-05-10 16:54:03 +02:00
%systemd_ordering
2011-04-26 19:03:02 +02:00
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++
2018-02-28 22:45:09 +01:00
Requires : %{name} = %{version} -%{release}
2021-10-20 18:17:29 +02:00
Requires : libpolkit-agent-1-0 = %{version}
Requires : libpolkit-gobject-1-0 = %{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.
2022-07-18 11:49:15 +02:00
%package -n pkexec
2022-08-17 13:30:42 +02:00
Summary : Pkexec component of polkit
2022-07-18 11:49:15 +02:00
Group : System/Libraries
Requires : %{name} = %{version} -%{release}
2022-08-17 13:30:42 +02:00
Requires(post) : permissions
2022-08-03 14:34:34 +02:00
Provides : polkit:/usr/bin/pkexec
2022-07-18 11:49:15 +02:00
%description -n pkexec
This package contains the pkexec setuid root binary part of polkit.
2009-07-30 18:07:53 +02:00
%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
BuildArch : noarch
2009-07-30 18:07:53 +02:00
%description doc
Development documentation for PolicyKit Authorization Framework.
2021-10-20 18:17:29 +02:00
%package -n libpolkit-agent-1-0
Summary : PolicyKit Authorization Framework -- Agent Library
2010-08-26 11:13:54 +02:00
Group : System/Libraries
2012-11-16 03:04:03 +01:00
Requires : %{name} >= %{version}
2021-12-07 11:14:49 +01:00
Obsoletes : libpolkit0 < %{version} -%{release}
2009-07-30 18:07:53 +02:00
2021-10-20 18:17:29 +02:00
%description -n libpolkit-agent-1-0
2009-07-30 18:07:53 +02:00
PolicyKit is a toolkit for defining and handling authorizations.
It is used for allowing unprivileged processes to speak to privileged
processes.
2021-10-20 18:17:29 +02:00
This package contains the agent library only.
%package -n libpolkit-gobject-1-0
Summary : PolicyKit Authorization Framework -- GObject Library
Group : System/Libraries
Requires : %{name} >= %{version}
2021-12-07 11:14:49 +01:00
Obsoletes : libpolkit0 < %{version} -%{release}
2021-10-20 18:17:29 +02:00
%description -n libpolkit-gobject-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 contains the gobject library only.
2009-07-30 18:07:53 +02:00
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
2022-08-17 13:30:42 +02:00
%autosetup -p1 -n polkit-v.%{version}
2009-07-30 18:07:53 +02:00
%build
2022-08-17 13:30:42 +02:00
%meson \
-D session_tracking=libsystemd-login \
-D systemdsystemunitdir=" %{_unitdir} " \
-D os_type=suse \
-D pam_module_dir=" %{_pam_moduledir} " \
-D pam_prefix=" %{_pam_vendordir} " \
-D examples=true \
-D tests=true \
-D gtk_doc=true \
-D man=true \
-D js_engine=duktape \
%{nil}
%meson_build
2021-07-19 08:47:41 +02:00
%sysusers_generate_pre %{SOURCE3} polkit system-user-polkitd.conf
2009-07-30 18:07:53 +02:00
2022-08-17 13:30:42 +02:00
%if 0%{?run_tests}
%check
%meson_test
%endif
2009-07-30 18:07:53 +02:00
%install
2020-12-29 08:54:33 +01:00
# install explicitly into libexec. upstream has some unflexible logic for
2021-01-04 11:16:58 +01:00
# this executable at the moment, but there is a PR# open to fix this:
2020-12-29 08:54:33 +01:00
# https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/63
# once this has been resolved upstream and we update to a new release we can
2021-01-04 11:16:58 +01:00
# remove this and also patch4 above.
2022-08-17 13:30:42 +02:00
#
# Additional note: Upstream turned down the MR above, preferring to stick to
# using ${prefix}/lib/polkit-1 and non-distro-configurable.
%meson_install
%find_lang polkit-1
2012-09-25 17:49:47 +02:00
# create $HOME for polkit user
install -d %{buildroot} %{_localstatedir} /lib/polkit
2022-08-17 13:30:42 +02:00
# We use /usr/share as prefix for the rules.d directory
mv %{buildroot} %{_sysconfdir} /polkit-1/rules.d/50-default.rules \
%{buildroot} %{_polkit_rulesdir} /50-default.rules
# Install the polkitd user creation file:
2021-07-19 08:47:41 +02:00
mkdir -p %{buildroot} %{_sysusersdir}
install -m0644 %{SOURCE3} %{buildroot} %{_sysusersdir} /
2009-07-30 18:07:53 +02:00
2022-11-09 16:54:16 +01:00
# create actions dir in /etc
mkdir %{buildroot} /%{_sysconfdir} /polkit-1/actions
2021-07-19 08:47:41 +02:00
%pre -f polkit.pre
2012-11-15 11:48:44 +01:00
%service_add_pre polkit.service
2012-09-21 23:03:29 +02:00
2012-11-15 11:48:44 +01:00
%preun
%service_del_preun polkit.service
%postun
%service_del_postun polkit.service
2022-07-18 11:49:15 +02:00
%post -n pkexec
2011-05-06 23:12:17 +02:00
%set_permissions %{_bindir} /pkexec
2022-07-18 11:49:15 +02:00
%post
2021-01-04 11:16:58 +01:00
%set_permissions %{_libexecdir} /polkit-1/polkit-agent-helper-1
2012-11-15 11:48:44 +01:00
%service_add_post polkit.service
2011-05-06 23:12:17 +02:00
2022-07-18 11:49:15 +02:00
%verify script -n pkexec
2009-08-13 23:33:53 +02:00
%verify _permissions -e %{_bindir} /pkexec
2022-07-18 11:49:15 +02:00
%verify script
2021-06-09 09:12:21 +02:00
%verify _permissions -e %{_libexecdir} /polkit-1/polkit-agent-helper-1
2009-07-30 18:07:53 +02:00
2021-10-20 18:17:29 +02:00
%post -n libpolkit-agent-1-0 -p /sbin/ldconfig
%postun -n libpolkit-agent-1-0 -p /sbin/ldconfig
%post -n libpolkit-gobject-1-0 -p /sbin/ldconfig
%postun -n libpolkit-gobject-1-0 -p /sbin/ldconfig
2009-07-30 18:07:53 +02:00
2021-10-20 18:17:29 +02:00
%files -n libpolkit-agent-1-0
2012-09-21 23:03:29 +02:00
%{_libdir} /libpolkit-agent-1.so.*
2021-10-20 18:17:29 +02:00
%files -n libpolkit-gobject-1-0
2012-09-21 23:03:29 +02:00
%{_libdir} /libpolkit-gobject-1.so.*
2012-01-09 11:07:22 +01:00
%files -n typelib-1_0-Polkit-1_0
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
2022-08-17 13:30:42 +02:00
%doc NEWS.md README.md
2018-02-28 22:45:09 +01:00
%license COPYING
2012-09-21 23:03:29 +02:00
%{_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
2021-03-15 13:53:01 +01:00
%dir %{_datadir} /dbus-1/system.d
%{_datadir} /dbus-1/system.d/org.freedesktop.PolicyKit1.conf
2009-07-30 18:07:53 +02:00
%dir %{_datadir} /polkit-1
2022-08-17 13:30:42 +02:00
%{_datadir} /polkit-1/policyconfig-1.dtd
2009-07-30 18:07:53 +02:00
%dir %{_datadir} /polkit-1/actions
%{_datadir} /polkit-1/actions/org.freedesktop.policykit.policy
2022-08-17 13:30:42 +02:00
%attr (0700,polkitd,root) %dir %{_polkit_rulesdir}
%attr (0600,polkitd,root) %{_polkit_rulesdir} /50-default.rules
2022-08-08 10:14:05 +02:00
%{_pam_vendordir} /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
2022-11-09 16:54:16 +01:00
%dir %{_sysconfdir} /polkit-1/actions
2009-07-30 18:07:53 +02:00
%{_bindir} /pkaction
%{_bindir} /pkcheck
2012-09-21 23:03:29 +02:00
%{_bindir} /pkttyagent
2020-12-29 08:54:33 +01:00
%dir %{_libexecdir} /polkit-1
%{_libexecdir} /polkit-1/polkitd
%verify (not mode) %attr (4755,root,root) %{_libexecdir} /polkit-1/polkit-agent-helper-1
2012-09-25 17:49:47 +02:00
# $HOME for polkit user
%dir %{_localstatedir} /lib/polkit
2021-07-19 08:47:41 +02:00
%{_sysusersdir} /system-user-polkitd.conf
2016-06-08 13:19:35 +02:00
%{_unitdir} /polkit.service
2009-07-30 18:07:53 +02:00
%files devel
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
2017-08-30 23:08:18 +02:00
%{_datadir} /gettext/its/polkit.its
%{_datadir} /gettext/its/polkit.loc
2009-07-30 18:07:53 +02:00
2022-07-18 11:49:15 +02:00
%files -n pkexec
%{_mandir} /man1/pkexec.1%{?ext_man}
%verify (not mode) %attr (4755,root,root) %{_bindir} /pkexec
2009-07-30 18:07:53 +02:00
%files doc
2012-09-21 23:03:29 +02:00
%doc %{_datadir} /gtk-doc/html/polkit-1/
2009-07-30 18:07:53 +02:00
%changelog