Switch macros to bcond's and make Python 2 optional
To facilitate building the Python 2 and Python 3 modules.
This commit is contained in:
parent
2889c61d29
commit
61ba8589f4
@ -1,10 +1,15 @@
|
|||||||
|
# Note that the only function of bootstrap is that it disables the test suite:
|
||||||
|
# bcond_with bootstrap = tests enabled
|
||||||
%bcond_with bootstrap
|
%bcond_with bootstrap
|
||||||
|
|
||||||
|
%bcond_without python2
|
||||||
|
%bcond_without python3
|
||||||
|
|
||||||
%global pypi_name wheel
|
%global pypi_name wheel
|
||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 0.30.0a0
|
Version: 0.30.0a0
|
||||||
Release: 7%{?dist}
|
Release: 8%{?dist}
|
||||||
Summary: A built-package format for Python
|
Summary: A built-package format for Python
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
@ -30,6 +35,7 @@ compatible install in a way that is very close to the on-disk format.
|
|||||||
|
|
||||||
%description %{_description}
|
%description %{_description}
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-%{pypi_name}
|
%package -n python2-%{pypi_name}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
@ -45,7 +51,10 @@ BuildRequires: python-jsonschema
|
|||||||
%description -n python2-%{pypi_name} %{_description}
|
%description -n python2-%{pypi_name} %{_description}
|
||||||
|
|
||||||
Python 2 version.
|
Python 2 version.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%package -n python3-%{pypi_name}
|
%package -n python3-%{pypi_name}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
@ -61,6 +70,8 @@ BuildRequires: python3-jsonschema
|
|||||||
%description -n python3-%{pypi_name} %{_description}
|
%description -n python3-%{pypi_name} %{_description}
|
||||||
|
|
||||||
Python 3 version.
|
Python 3 version.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{pypi_name}-%{version}
|
%setup -q -n %{pypi_name}-%{version}
|
||||||
@ -68,27 +79,42 @@ Python 3 version.
|
|||||||
sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py
|
sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if %{with python2}
|
||||||
%py2_build
|
%py2_build
|
||||||
|
%endif
|
||||||
|
%if %{with python3}
|
||||||
%py3_build
|
%py3_build
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py2_install
|
%if %{with python3}
|
||||||
mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python2_version}}
|
|
||||||
ln -s %{pypi_name}-%{python2_version} %{buildroot}%{_bindir}/%{pypi_name}-2
|
|
||||||
%py3_install
|
%py3_install
|
||||||
mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}}
|
mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python3_version}}
|
||||||
ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3
|
ln -s %{pypi_name}-%{python3_version} %{buildroot}%{_bindir}/%{pypi_name}-3
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
|
%py2_install
|
||||||
|
mv %{buildroot}%{_bindir}/%{pypi_name}{,-%{python2_version}}
|
||||||
|
ln -s %{pypi_name}-%{python2_version} %{buildroot}%{_bindir}/%{pypi_name}-2
|
||||||
ln -s %{pypi_name}-2 %{buildroot}%{_bindir}/%{pypi_name}
|
ln -s %{pypi_name}-2 %{buildroot}%{_bindir}/%{pypi_name}
|
||||||
|
%endif
|
||||||
|
|
||||||
%if ! %{with bootstrap}
|
%if ! %{with bootstrap}
|
||||||
%check
|
%check
|
||||||
rm setup.cfg
|
rm setup.cfg
|
||||||
|
%if %{with python2}
|
||||||
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-2 -v --ignore build
|
PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-2 -v --ignore build
|
||||||
|
%endif
|
||||||
|
%if %{with python3}
|
||||||
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -v --ignore build
|
PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -v --ignore build
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-%{pypi_name}
|
%files -n python2-%{pypi_name}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc CHANGES.txt README.txt
|
%doc CHANGES.txt README.txt
|
||||||
@ -97,7 +123,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -v --ignore build
|
|||||||
%{_bindir}/%{pypi_name}-%{python2_version}
|
%{_bindir}/%{pypi_name}-%{python2_version}
|
||||||
%{python2_sitelib}/%{pypi_name}*
|
%{python2_sitelib}/%{pypi_name}*
|
||||||
%exclude %{python2_sitelib}/%{pypi_name}/test
|
%exclude %{python2_sitelib}/%{pypi_name}/test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%files -n python3-%{pypi_name}
|
%files -n python3-%{pypi_name}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc CHANGES.txt README.txt
|
%doc CHANGES.txt README.txt
|
||||||
@ -105,8 +133,13 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-3 -v --ignore build
|
|||||||
%{_bindir}/%{pypi_name}-%{python3_version}
|
%{_bindir}/%{pypi_name}-%{python3_version}
|
||||||
%{python3_sitelib}/%{pypi_name}*
|
%{python3_sitelib}/%{pypi_name}*
|
||||||
%exclude %{python3_sitelib}/%{pypi_name}/test
|
%exclude %{python3_sitelib}/%{pypi_name}/test
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 29 2017 Tomas Orsava <torsava@redhat.com> - 0.30.0a0-8
|
||||||
|
- Switch macros to bcond's and make Python 2 optional to facilitate building
|
||||||
|
the Python 2 and Python 3 modules
|
||||||
|
|
||||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0a0-7
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.30.0a0-7
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user