#
# Conditional build:
%bcond_without apidocs # build without apidocs
-%bcond_without systemd # use systemd for session tracking instead of ConsoleKit (fallback to ConsoleKit on runtime)
+%bcond_without consolekit # ConsoleKit fallback
+%bcond_without systemd # use systemd-login for session tracking (fallback to ConsoleKit on runtime)
+%bcond_with elogind # use elogind instead of systemd-login
+%if %{with elogind}
+%undefine with_systemd
+%endif
Summary: A framework for defining policy for system-wide components
Summary(pl.UTF-8): Szkielet do definiowania polityki dla komponentów systemowych
Name: polkit
-Version: 0.112
-Release: 3
+Version: 0.119
+Release: 2
License: LGPL v2+
Group: Libraries
-Source0: http://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz
-# Source0-md5: b0f2fa00a55f47c6a5d88e9b73f80127
+Source0: https://gitlab.freedesktop.org/polkit/polkit/-/archive/%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 16b0ec658efae724378c7f75233d4120
Patch0: systemd-fallback.patch
-Patch1: js187.patch
-URL: http://www.freedesktop.org/wiki/Software/polkit
+URL: https://www.freedesktop.org/wiki/Software/polkit
BuildRequires: autoconf >= 2.60
BuildRequires: automake >= 1:1.7
BuildRequires: docbook-dtd412-xml
BuildRequires: docbook-style-xsl
+%{?with_elogind:BuildRequires: elogind-devel}
BuildRequires: expat-devel >= 1:1.95.8
BuildRequires: gettext-tools
BuildRequires: glib2-devel >= 1:2.32.0
+%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
+BuildRequires: glibc-localedb-all
+%endif
BuildRequires: gobject-introspection-devel >= 0.6.2
%{?with_apidocs:BuildRequires: gtk-doc >= 1.3}
BuildRequires: gtk-doc-automake >= 1.3
BuildRequires: intltool >= 0.40.0
-BuildRequires: js187-devel
-BuildRequires: libtool
+BuildRequires: libstdc++-devel >= 6:4.7
+BuildRequires: libtool >= 2:1.5
BuildRequires: libxslt-progs
+BuildRequires: mozjs78-devel
BuildRequires: pam-devel >= 0.80
BuildRequires: pkgconfig
BuildRequires: python-modules
BuildRequires: rpmbuild(macros) >= 1.647
%{?with_systemd:BuildRequires: systemd-devel}
Requires: %{name}-libs = %{version}-%{release}
-%if %{without systemd}
+%if %{without systemd} && %{without elogind}
Requires: ConsoleKit >= 0.4.1
-%else
-Requires: systemd-units >= 38
%endif
Requires: dbus >= 1.1.2-5
+%if %{with systemd}
+Requires: systemd-units >= 38
+%endif
Obsoletes: PolicyKit
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Group: Documentation
Requires: gtk-doc-common
Obsoletes: PolicyKit-apidocs
+BuildArch: noarch
%description apidocs
PolicyKit API documentation.
%prep
%setup -q
-%{?with_systemd:%patch0 -p1}
-%patch1 -p1
+%if %{with consolekit} && (%{with systemd} || %{with elogind})
+%patch0 -p1
+%endif
%build
%{?with_apidocs:%{__gtkdocize}}
%configure \
%{__enable_disable apidocs gtk-doc} \
--disable-silent-rules \
+ --disable-test \
+ %{__enable_disable elogind libelogind} \
%{__enable_disable systemd libsystemd-login} \
--with-html-dir=%{_gtkdocdir} \
--with-pam-include=system-auth \
--with-pam-module-dir=/%{_lib}/security \
--with-polkitd-user=polkitd
+LC_ALL=C.UTF-8 \
%{__make} -j1
%install
%dir %{_sysconfdir}/polkit-1
%attr(700,polkitd,root) %dir %{_sysconfdir}/polkit-1/rules.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/polkit-1/rules.d/50-default.rules
-/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
/etc/pam.d/polkit-1
%dir %{_datadir}/polkit-1
%{_datadir}/polkit-1/actions
%attr(700,polkitd,root) %dir %{_datadir}/polkit-1/rules.d
%{_datadir}/dbus-1/system-services/org.freedesktop.PolicyKit1.service
+%{_datadir}/dbus-1/system.d/org.freedesktop.PolicyKit1.conf
%{?with_systemd:%{systemdunitdir}/polkit.service}
%{_mandir}/man1/pkaction.1*
%{_mandir}/man1/pkcheck.1*
%{_pkgconfigdir}/polkit-gobject-1.pc
%{_datadir}/gir-1.0/Polkit-1.0.gir
%{_datadir}/gir-1.0/PolkitAgent-1.0.gir
+%{_datadir}/gettext/its/polkit.its
+%{_datadir}/gettext/its/polkit.loc
%files static
%defattr(644,root,root,755)