Make python3 conditional (switched off for RHEL-7; fixes #1131111).

This commit is contained in:
Slavek Kabrda 2015-01-05 13:39:59 +01:00
parent 1b1515bf64
commit 3f2c609792

View File

@ -1,10 +1,13 @@
# Created by pyp2rpm-1.0.1
%global pypi_name wheel %global pypi_name wheel
%global with_python3 1 %if 0%{?rhel} > 7 || 0%{?fedora} >= 16
%bcond_without python3
%else
%bcond_with python3
%endif
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 0.24.0 Version: 0.24.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: A built-package format for Python Summary: A built-package format for Python
License: MIT License: MIT
@ -26,7 +29,7 @@ BuildRequires: pytest
BuildRequires: python-jsonschema BuildRequires: python-jsonschema
BuildRequires: python-keyring BuildRequires: python-keyring
%if %{?with_python3} %if %{with python3}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
%endif # if with_python3 %endif # if with_python3
@ -39,7 +42,7 @@ A wheel is a ZIP-format archive with a specially formatted filename and the
.whl extension. It is designed to contain all the files for a PEP 376 .whl extension. It is designed to contain all the files for a PEP 376
compatible install in a way that is very close to the on-disk format. compatible install in a way that is very close to the on-disk format.
%if 0%{?with_python3} %if 0%{with python3}
%package -n python3-%{pypi_name} %package -n python3-%{pypi_name}
Summary: A built-package format for Python Summary: A built-package format for Python
@ -66,7 +69,7 @@ touch %{pypi_name}/test/headers.dist/header.h
# remove unneeded shebangs # remove unneeded shebangs
sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py
%if 0%{?with_python3} %if %{with python3}
rm -rf %{py3dir} rm -rf %{py3dir}
cp -a . %{py3dir} cp -a . %{py3dir}
%endif # with_python3 %endif # with_python3
@ -75,7 +78,7 @@ cp -a . %{py3dir}
%build %build
%{__python} setup.py build %{__python} setup.py build
%if 0%{?with_python3} %if %{with python3}
pushd %{py3dir} pushd %{py3dir}
%{__python3} setup.py build %{__python3} setup.py build
popd popd
@ -86,7 +89,7 @@ popd
# Must do the subpackages' install first because the scripts in /usr/bin are # Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install (and we want the python2 version # overwritten with every setup.py install (and we want the python2 version
# to be the default for now). # to be the default for now).
%if 0%{?with_python3} %if %{with python3}
pushd %{py3dir} pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot} %{__python3} setup.py install --skip-build --root %{buildroot}
popd popd
@ -116,7 +119,7 @@ popd
%{_bindir}/wheel %{_bindir}/wheel
%{python_sitelib}/%{pypi_name}* %{python_sitelib}/%{pypi_name}*
%exclude %{python_sitelib}/%{pypi_name}/test %exclude %{python_sitelib}/%{pypi_name}/test
%if 0%{?with_python3} %if %{with python3}
%files -n python3-%{pypi_name} %files -n python3-%{pypi_name}
%doc LICENSE.txt CHANGES.txt README.txt %doc LICENSE.txt CHANGES.txt README.txt
@ -127,6 +130,9 @@ popd
%changelog %changelog
* Sat Jan 03 2015 Matej Cepl <mcepl@redhat.com> - 0.24.0-2
- Make python3 conditional (switched off for RHEL-7; fixes #1131111).
* Mon Nov 10 2014 Slavek Kabrda <bkabrda@redhat.com> - 0.24.0-1 * Mon Nov 10 2014 Slavek Kabrda <bkabrda@redhat.com> - 0.24.0-1
- Update to 0.24.0 - Update to 0.24.0
- Remove patches merged upstream - Remove patches merged upstream