From 5bed7fb4323019e08631915c13399abaa755d756725e48c7abf130b1b196b5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 8 Jan 2018 10:31:58 +0000 Subject: [PATCH] - Tweak up the python conditional to allow us finegraining and selecting only py2 or py3 if needed OBS-URL: https://build.opensuse.org/package/show/Base:System/gpgme?expand=0&rev=92 --- gpgme.changes | 6 ++++++ gpgme.spec | 24 +++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/gpgme.changes b/gpgme.changes index 04002ca..519017d 100644 --- a/gpgme.changes +++ b/gpgme.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 8 10:17:39 UTC 2018 - tchvatal@suse.com + +- Tweak up the python conditional to allow us finegraining and + selecting only py2 or py3 if needed + ------------------------------------------------------------------- Tue Dec 12 16:44:59 UTC 2017 - astieger@suse.com diff --git a/gpgme.spec b/gpgme.spec index b31df38..5fe1bb3 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,7 +1,7 @@ # # spec file for package gpgme # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,9 +18,8 @@ # Enable Qt bindings on TW and 42.3 (needed for KDE PIM) %define with_qt 0%{?suse_version} >= 1330 || 0%{?sle_version} >= 120300 -# Only enable Python bindings with TW, or tests will fail with an older gpg -# https://bugs.gnupg.org/gnupg/issue3008 -%define with_python 0%{?suse_version} >= 1330 +%bcond_without python2 +%bcond_without python3 Name: gpgme Version: 1.10.0 Release: 0 @@ -42,8 +41,10 @@ BuildRequires: pkgconfig BuildRequires: swig Requires(post): %{install_info_prereq} Requires(preun): %{install_info_prereq} -%if 0%{?with_python} +%if %{with python2} BuildRequires: python2-devel >= 2.7 +%endif +%if %{with python3} BuildRequires: python3-devel >= 3.4 %endif %if 0%{with_qt} @@ -118,7 +119,6 @@ management. This subpackage contains the headers needed for building applications making use of libgpgmepp. -%if 0%{?with_python} %package -n python2-gpg Summary: Python 2 bindings for GPGME, a library for accessing GnuPG Group: Development/Languages/Python @@ -144,7 +144,6 @@ encryption, decryption, signing, signature verification, and key management. This package contains the bindings to use the library from Python 3 applications. -%endif %package -n libqgpgme7 Summary: Programmatic Qt library interface to GnuPG @@ -181,7 +180,7 @@ This package contains the bindings to use the library in Qt C++ applications. build_timestamp=$(date -u +%{Y}-%{m}-%{dT}%{H}:%{M}+0000 -r %{SOURCE99}) languages="cl cpp" -%if 0%{?with_python} +%if %{with python2} || %{with python3} languages="${languages} python" %endif @@ -202,11 +201,12 @@ make %{?_smp_mflags} find %{buildroot} -type f -name "*.la" -delete -print chmod -x %{buildroot}%{_libdir}/cmake/Gpgmepp/*.cmake -%if 0%{?with_python} +%if %{with python2} find %{buildroot}%{python_sitearch}/gpg-*.egg-info -delete -print find %{buildroot}%{python_sitearch}/gpg -type f -name "*.pyc" -delete -print rm -vf %{buildroot}%{python_sitelib}/gpg/install_files.txt - +%endif +%if %{with python3} find %{buildroot}%{python3_sitearch}/gpg-*.egg-info -delete -print rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt find %{buildroot}%{python3_sitearch}/gpg -type f -name "*.pyc" -delete -print @@ -258,10 +258,12 @@ make %{?_smp_mflags} check %dir %{_libdir}/cmake/Gpgmepp %{_libdir}/cmake/Gpgmepp/GpgmeppConfig*.cmake -%if 0%{?with_python} +%if %{with python2} %files -n python2-gpg %{python_sitearch}/gpg +%endif +%if %{with python3} %files -n python3-gpg %{python3_sitearch}/gpg %endif