Build only the py3 package on Fedora

This commit is contained in:
Pierre-Yves Chibon 2016-02-08 16:50:36 +01:00
parent 17c60f4694
commit 56271b06c4

View File

@ -1,6 +1,10 @@
%global srcname hypothesis %global srcname hypothesis
%global sum A library for property based testing %global sum A library for property based testing
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{srcname} Name: python-%{srcname}
Version: 1.11.2 Version: 1.11.2
Release: 3%{?dist} Release: 3%{?dist}
@ -55,6 +59,7 @@ to integrate seamlessly into your existing Python unit testing work
flow. flow.
%if 0%{?with_python3}
%package -n python3-%{srcname} %package -n python3-%{srcname}
Summary: %{sum} Summary: %{sum}
%{?python_provide:%python_provide python3-%{srcname}} %{?python_provide:%python_provide python3-%{srcname}}
@ -73,6 +78,7 @@ larger range of examples than you would ever want to write by
hand. Its based on the Haskell library, Quickcheck, and is designed hand. Its based on the Haskell library, Quickcheck, and is designed
to integrate seamlessly into your existing Python unit testing work to integrate seamlessly into your existing Python unit testing work
flow. flow.
%endif
%prep %prep
@ -90,13 +96,17 @@ rm -rf tests/nocover
%build %build
%py2_build %py2_build
%if 0%{?with_python3}
%py3_build %py3_build
%endif
(cd docs && READTHEDOCS=True make man) (cd docs && READTHEDOCS=True make man)
%install %install
%py2_install %py2_install
%if 0%{?with_python3}
%py3_install %py3_install
%endif
%{__install} -Dp -m 644 docs/_build/man/hypothesis.1 \ %{__install} -Dp -m 644 docs/_build/man/hypothesis.1 \
$RPM_BUILD_ROOT%{_mandir}/man1/hypothesis.1 $RPM_BUILD_ROOT%{_mandir}/man1/hypothesis.1
@ -115,12 +125,13 @@ rm -rf tests/py2
%{python2_sitelib}/* %{python2_sitelib}/*
%{_mandir}/man1/hypothesis.1* %{_mandir}/man1/hypothesis.1*
%if 0%{?with_python3}
%files -n python3-%{srcname} %files -n python3-%{srcname}
%license LICENSE.txt %license LICENSE.txt
%doc README.rst %doc README.rst
%{python3_sitelib}/* %{python3_sitelib}/*
%{_mandir}/man1/hypothesis.1* %{_mandir}/man1/hypothesis.1*
%endif
%changelog %changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.2-3 * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.11.2-3