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 with_python3 1
%if 0%{?rhel} > 7 || 0%{?fedora} >= 16
%bcond_without python3
%else
%bcond_with python3
%endif
Name: python-%{pypi_name}
Version: 0.24.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A built-package format for Python
License: MIT
@ -18,15 +21,15 @@ Source0: https://pypi.python.org/packages/source/w/%{pypi_name}/%{pypi_na
Source1: https://bitbucket.org/dholth/wheel/src/099352e/wheel/test/test-1.0-py2.py3-none-win32.whl
Source2: https://bitbucket.org/dholth/wheel/raw/099352e/wheel/test/pydist-schema.json
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: pytest
BuildRequires: python-jsonschema
BuildRequires: python-keyring
%if %{?with_python3}
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%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
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}
Summary: A built-package format for Python
@ -66,7 +69,7 @@ touch %{pypi_name}/test/headers.dist/header.h
# remove unneeded shebangs
sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py
%if 0%{?with_python3}
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
@ -75,7 +78,7 @@ cp -a . %{py3dir}
%build
%{__python} setup.py build
%if 0%{?with_python3}
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
@ -86,7 +89,7 @@ popd
# 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
# to be the default for now).
%if 0%{?with_python3}
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
@ -116,7 +119,7 @@ popd
%{_bindir}/wheel
%{python_sitelib}/%{pypi_name}*
%exclude %{python_sitelib}/%{pypi_name}/test
%if 0%{?with_python3}
%if %{with python3}
%files -n python3-%{pypi_name}
%doc LICENSE.txt CHANGES.txt README.txt
@ -127,6 +130,9 @@ popd
%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
- Update to 0.24.0
- Remove patches merged upstream