python-wheel/python-wheel.spec

151 lines
3.8 KiB
RPMSpec
Raw Normal View History

2013-12-03 09:16:56 +00:00
%global pypi_name wheel
%if 0%{?rhel} > 7 || 0%{?fedora} >= 16
%bcond_without python3
%else
%bcond_with python3
%if 0%{?rhel} < 7
%global rhel6 1
%endif
%endif
2013-12-03 09:16:56 +00:00
Name: python-%{pypi_name}
Version: 0.24.0
Release: 3%{?dist}
2013-12-03 09:16:56 +00:00
Summary: A built-package format for Python
License: MIT
URL: http://bitbucket.org/dholth/wheel/
Source0: https://pypi.python.org/packages/source/w/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
2013-12-03 09:16:56 +00:00
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: pytest
BuildRequires: python-jsonschema
BuildRequires: python-keyring
%if 0%{?rhel6}
BuildRequires: python-argparse
Requires: python-argparse
%endif
%if %{with python3}
2013-12-03 09:16:56 +00:00
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif # if with_python3
%description
A built-package format for Python.
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}
2013-12-03 09:16:56 +00:00
%package -n python3-%{pypi_name}
Summary: A built-package format for Python
%description -n python3-%{pypi_name}
A built-package format for Python.
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.
This is package contains Python 3 version of the package.
%endif # with_python3
%prep
%setup -q -n %{pypi_name}-%{version}
# remove unneeded shebangs
sed -ie '1d' %{pypi_name}/{egg2wheel,wininst2wheel}.py
%if %{with python3}
2013-12-03 09:16:56 +00:00
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build
%{__python} setup.py build
%if %{with python3}
2013-12-03 09:16:56 +00:00
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3
%install
# 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 %{with python3}
2013-12-03 09:16:56 +00:00
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
pushd %{buildroot}%{_bindir}
for f in $(ls); do mv $f python3-$f; done
popd
%endif # with_python3
%{__python} setup.py install --skip-build --root %{buildroot}
%check
# remove setup.cfg that makes pytest require pytest-cov (unnecessary dep)
rm setup.cfg
PYTHONPATH=$(pwd) py.test --ignore build %{?rhel6:-k 'not test_keygen'}
2013-12-03 09:16:56 +00:00
# no test for Python 3, no python3-jsonschema yet
%if 0
pushd %{py3dir}
rm setup.cfg
PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore build
2013-12-03 09:16:56 +00:00
popd
%endif # with_python3
%files
%doc LICENSE.txt CHANGES.txt README.txt
%{_bindir}/wheel
%{python_sitelib}/%{pypi_name}*
%exclude %{python_sitelib}/%{pypi_name}/test
%if %{with python3}
2013-12-03 09:16:56 +00:00
%files -n python3-%{pypi_name}
%doc LICENSE.txt CHANGES.txt README.txt
%{_bindir}/python3-wheel
%{python3_sitelib}/%{pypi_name}*
%exclude %{python3_sitelib}/%{pypi_name}/test
%endif # with_python3
%changelog
* Tue Jan 13 2015 Slavek Kabrda <bkabrda@redhat.com> - 0.24.0-3
- Make spec buildable in EPEL 6, too.
- Remove additional sources added to upstream tarball.
* 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
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2014-04-25 09:09:42 +00:00
* Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 0.22.0-3
- Another rebuild with python 3.4
2014-04-18 10:36:08 +00:00
* Fri Apr 18 2014 Matej Stuchlik <mstuchli@redhat.com> - 0.22.0-2
- Rebuild with python 3.4
2013-12-03 09:16:56 +00:00
* Thu Nov 28 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 0.22.0-1
- Initial package.