Accepting request 519773 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/519773
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/polkit?expand=0&rev=58
This commit is contained in:
Dominique Leuenberger 2017-09-04 10:17:41 +00:00 committed by Git OBS Bridge
commit ba3f3705ac
3 changed files with 75 additions and 15 deletions

55
polkit-itstools.patch Normal file
View File

@ -0,0 +1,55 @@
From c78819245ff8a270f97c9f800773e727918be838 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 15 Jul 2016 11:12:35 -0400
Subject: Add gettext support for .policy files
gettext can extract strings from and merge them back into xml
file formats, with the help of .its files.
https://bugs.freedesktop.org/show_bug.cgi?id=96940
diff --git a/data/Makefile.am b/data/Makefile.am
index fe0f1d5..18693fe 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -36,6 +36,11 @@ pkgconfig_DATA = polkit-gobject-1.pc polkit-agent-1.pc
# ----------------------------------------------------------------------------------------------------
+itsdir = $(datadir)/gettext/its
+its_DATA = polkit.loc polkit.its
+
+# ----------------------------------------------------------------------------------------------------
+
systemdservice_in_files = polkit.service.in
if HAVE_SYSTEMD
diff --git a/data/polkit.its b/data/polkit.its
new file mode 100644
index 0000000..1312ecb
--- /dev/null
+++ b/data/polkit.its
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<its:rules xmlns:its="http://www.w3.org/2005/11/its"
+ version="2.0">
+ <its:translateRule selector="/action/description |
+ /action/message"
+ translate="yes"/>
+</its:rules>
diff --git a/data/polkit.loc b/data/polkit.loc
new file mode 100644
index 0000000..c7427ec
--- /dev/null
+++ b/data/polkit.loc
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<locatingRules>
+ <locatingRule name="polkit policy" pattern="*.policy">
+ <documentRule localName="policyconfig" target="polkit.its"/>
+ </locatingRule>
+</locatingRules>
--
cgit v0.10.2

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Aug 15 12:20:52 UTC 2017 - dimstar@opensuse.org
- Add polkit-itstools.patch: Add gettext support for .policy files.
-------------------------------------------------------------------
Tue Jun 13 15:25:58 UTC 2017 - lnussel@suse.de

View File

@ -17,15 +17,13 @@
%define with_systemd 1
Name: polkit
Version: 0.113
Release: 0
Summary: PolicyKit Authorization Framework
License: LGPL-2.1+
Group: System/Libraries
Version: 0.113
Release: 0
Url: http://www.freedesktop.org/wiki/Software/polkit/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: http://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz
Source1: http://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz.sign
Source2: %name.keyring
@ -38,6 +36,8 @@ Patch1: polkit-no-systemd.patch
Patch2: polkit-revert-session-magic.patch
# PATCH-FIX-OPENSUSE polkit-gettext.patch lnussel@suse.de -- allow fallback to gettext for polkit action translations
Patch3: polkit-gettext.patch
# PATCH-FEATURE-UPSTREAM polkit-itstools.patch dimstar@opensuse.org -- Add gettext support for .policy files, taken from git
Patch4: polkit-itstools.patch
# needed for patch1
BuildRequires: autoconf
# needed for patch1
@ -45,13 +45,17 @@ BuildRequires: automake
BuildRequires: glib2-devel >= 2.30.0
BuildRequires: gobject-introspection-devel >= 0.6.2
BuildRequires: gtk-doc
# gtk-doc drags indirectyly ruby in for one of the helpers. This in turn causes a build cycle.
#!BuildIgnore: ruby
BuildRequires: intltool
BuildRequires: libexpat-devel
# needed for patch1 and patch3
# needed for patch1, patch3 and patch4
BuildRequires: libtool
BuildRequires: pam-devel
# gtk-doc drags indirectyly ruby in for one of the helpers. This in turn causes a build cycle.
#!BuildIgnore: ruby
Requires: dbus-1
Requires: libpolkit0 = %{version}-%{release}
PreReq: permissions
PreReq: pwdutils
%if 0%{?with_systemd}
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libsystemd)
@ -62,16 +66,12 @@ BuildRequires: pkgconfig(mozjs-17.0)
%else
BuildRequires: pkgconfig(mozjs185)
%endif
PreReq: permissions pwdutils
%if ! %{with_systemd}
Requires: ConsoleKit
%endif
Requires: dbus-1
Requires: libpolkit0 = %{version}-%{release}
%if %{with_systemd}
%systemd_requires
%endif
# 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
@ -134,6 +134,7 @@ This package provides the GObject Introspection bindings for PolicyKit.
%endif
%patch2 -p1 -R
%patch3 -p1
%patch4 -p1
%build
export V=1
@ -158,14 +159,11 @@ make %{?_smp_mflags}
%install
%make_install
rm $RPM_BUILD_ROOT%{_libdir}/*.la
rm %{buildroot}%{_libdir}/*.la
# create $HOME for polkit user
install -d %{buildroot}%{_localstatedir}/lib/polkit
%find_lang polkit-1
%clean
rm -rf $RPM_BUILD_ROOT
%pre
getent group polkitd > /dev/null || groupadd -r polkitd
getent passwd polkitd > /dev/null || useradd -r -g polkitd -d %{_localstatedir}/lib/polkit -s /sbin/nologin -c "User for polkitd" polkitd
@ -253,6 +251,8 @@ exit 0
%{_bindir}/pk-example-frobnicate
%{_datadir}/gir-1.0/*.gir
%{_datadir}/polkit-1/actions/org.freedesktop.policykit.examples.pkexec.policy
%{_datadir}/gettext/its/polkit.its
%{_datadir}/gettext/its/polkit.loc
%files doc
%defattr(-,root,root,-)