From 271f11d17350acc09e631b914ede7a1afd6d4a2e Mon Sep 17 00:00:00 2001 From: Pete Walter Date: Dec 01 2017 11:03:38 +0000 Subject: Sync the spec file conditionals with the epel7 branch again ... and revert unwanted portions from commit d1eab5b68c51d506b47b2f5b1014c871fbb8ed8a. --- diff --git a/python-pygit2.spec b/python-pygit2.spec index 98dc2f6..cbcf236 100644 --- a/python-pygit2.spec +++ b/python-pygit2.spec @@ -1,7 +1,5 @@ -%if 0%{?rhel} && 0%{?rhel} <= 7 -%bcond_with python3 -%else -%bcond_without python3 +%if 0%{?fedora} +%global with_python3 1 %endif %global pkgname pygit2 @@ -24,6 +22,7 @@ BuildRequires: openssl-devel pygit2 is a set of Python bindings to the libgit2 library, which implements the core of Git. + %package -n python2-%{pkgname} Summary: Python 2.x bindings for libgit2 %{?python_provide:%python_provide python2-%{pkgname}} @@ -41,7 +40,8 @@ the core of Git. Python 2 version. -%if %{with python3} + +%if 0%{?with_python3} %package -n python3-%{pkgname} Summary: Python 3.x bindings for libgit2 %{?python_provide:%python_provide python3-%{pkgname}} @@ -60,27 +60,33 @@ the core of Git. Python 3 version. %endif + %package doc Summary: Documentation for %{name} BuildArch: noarch -BuildRequires: %{_bindir}/sphinx-build +BuildRequires: python-sphinx %description doc Documentation for %{name}. + %prep %autosetup -n %{pkgname}-%{version} -p1 + %build %py2_build make -C docs html -%if %{with python3} + +%if 0%{?with_python3} %py3_build %endif + %install %py2_install -%if %{with python3} + +%if 0%{?with_python3} %py3_install %endif @@ -89,12 +95,15 @@ find %{_builddir} -name '.buildinfo' -delete # Correct the permissions. find %{buildroot} -name '*.so' -exec chmod 755 {} ';' + %check %{__python2} setup.py test -%if %{with python3} + +%if 0%{?with_python3} %{__python3} setup.py test %endif + %files -n python2-%{pkgname} %doc README.rst TODO.txt %license COPYING @@ -102,7 +111,7 @@ find %{buildroot} -name '*.so' -exec chmod 755 {} ';' %{python2_sitearch}/%{pkgname} %{python2_sitearch}/_%{pkgname}.so -%if %{with python3} +%if 0%{?with_python3} %files -n python3-%{pkgname} %doc README.rst TODO.txt %license COPYING @@ -115,6 +124,7 @@ find %{buildroot} -name '*.so' -exec chmod 755 {} ';' %license COPYING %doc docs/_build/html/* + %changelog * Mon Nov 20 2017 Igor Gnatenko - 0.26.1-3 - Fixup python3 conditionals @@ -122,7 +132,7 @@ find %{buildroot} -name '*.so' -exec chmod 755 {} ';' * Mon Nov 20 2017 Pete Walter - 0.26.1-2 - Add back Python 3 conditionals -* Mon Nov 20 2017 Igor Gnatenko - 0.26.1-1 +* Mon Nov 20 2017 Pete Walter - 0.26.1-1 - Update to 0.26.1 * Thu Aug 03 2017 Fedora Release Engineering - 0.26.0-3