diff --git a/gpgme.spec b/gpgme.spec index 25ce4f5..cdce69b 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,5 +1,10 @@ +%bcond_without python2 +%bcond_without python3 +%bcond_without platform_python %bcond_without check +%global platform_py_dir %{_builddir}/platpy-%{name}-%{version}-%{release} + # trim changelog included in binary rpms %global _changelog_trimtime %(date +%s -d "1 year ago") @@ -11,12 +16,13 @@ Name: gpgme Summary: GnuPG Made Easy - high level crypto API Version: 1.9.0 -Release: 5%{?dist} +Release: 6%{?dist} License: LGPLv2+ URL: https://gnupg.org/related_software/gpgme/ Source0: ftp://ftp.gnupg.org/gcrypt/gpgme/gpgme-%{version}.tar.bz2 Source2: gpgme-multilib.h +Source3: platform-python.patch ## upstream patches Patch0001: 0001-qt-pass-fmt-to-gpgrt_asprintf.patch @@ -113,6 +119,7 @@ BuildRequires: cmake %description -n q%{name}-devel %{summary}. +%if %{with python2} %package -n python2-gpg Summary: %{name} bindings for Python 2 %{?python_provide:%python_provide python2-gpg} @@ -121,7 +128,9 @@ Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description -n python2-gpg %{summary}. +%endif +%if %{with python3} %package -n python3-gpg Summary: %{name} bindings for Python 3 %{?python_provide:%python_provide python3-gpg} @@ -130,6 +139,17 @@ Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description -n python3-gpg %{summary}. +%endif + +%if %{with platform_python} +%package -n platform-python-gpg +Summary: %{name} bindings for Platform Python +BuildRequires: platform-python-devel +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description -n platform-python-gpg +%{summary}. +%endif %prep %autosetup -p1 @@ -142,11 +162,35 @@ sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpgme-config.in find -type f -name Makefile\* -exec sed -i -e 's|GPG = gpg|GPG = gpg2|' {} ';' %build + +%if %{with platform_python} +rm -rf %{platform_py_dir} +cp -a . %{platform_py_dir} +pushd %platform_py_dir +patch -p1 < %SOURCE3 +./autogen.sh +( + export PYTHON=platform-python + export PATH=$PATH:%{_libexecdir} + %configure --disable-static --disable-silent-rules --enable-languages=python3 +) +%make_build +popd +%endif + ./autogen.sh %configure --disable-static --disable-silent-rules --enable-languages=cpp,qt,python %make_build %install + +%if %{with platform_python} +pushd %platform_py_dir +%make_install +popd +rm -vf %{buildroot}%{platform_python_sitelib}/gpg/install_files.txt +%endif + %make_install # unpackaged files @@ -175,8 +219,14 @@ rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt %if %{with check} %check -# https://bugs.gnupg.org/gnupg/issue3024 -make check || : + +%if %{with platform_python} +pushd %platform_py_dir +make check +popd +%endif + +make check %endif %post -p /sbin/ldconfig @@ -226,17 +276,32 @@ fi %{_libdir}/libq%{name}.so %{_libdir}/cmake/QGpgme/ +%if %{with python2} %files -n python2-gpg %doc lang/python/README %{python2_sitearch}/gpg-*.egg-info %{python2_sitearch}/gpg/ +%endif +%if %{with python3} %files -n python3-gpg %doc lang/python/README %{python3_sitearch}/gpg-*.egg-info %{python3_sitearch}/gpg/ +%endif + +%if %{with platform_python} +%files -n platform-python-gpg +%doc lang/python/README +%{platform_python_sitearch}/gpg-*.egg-info +%{platform_python_sitearch}/gpg/ +%endif + %changelog +* Thu Aug 10 2017 Petr Viktorin - 1.9.0-6 +- Add subpackage for platform-python (https://fedoraproject.org/wiki/Changes/Platform_Python_Stack) + * Mon Aug 07 2017 Igor Gnatenko - 1.9.0-5 - Remove BuildRequires: pth-devel, it is not needed for long time diff --git a/platform-python.patch b/platform-python.patch new file mode 100644 index 0000000..43c0504 --- /dev/null +++ b/platform-python.patch @@ -0,0 +1,21 @@ +diff -U3 -r gpgme-1.9.0-orig/m4/python.m4 gpgme-1.9.0/m4/python.m4 +--- gpgme-1.9.0-orig/m4/python.m4 2017-03-24 15:20:32.000000000 +0100 ++++ gpgme-1.9.0/m4/python.m4 2017-08-10 14:20:58.041841020 +0200 +@@ -32,15 +32,13 @@ + # cause an error if the version of python installed on the system + # doesn't meet the requirement. MINIMUM-VERSION should consist of + # numbers and dots only. ++ + AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 2.0 are not + dnl supported. (2.0 was released on October 16, 2000). + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], +-[python2 python2.7 dnl +- python dnl +- python3 python3.0 python3.1 python3.2 python3.3 dnl +- python3.4 python3.5 python3.6 python3.7 python3.8]) ++[platform-python]) + + AC_ARG_VAR([PYTHON], [the Python interpreter]) +