| |
@@ -1,12 +1,12 @@
|
| |
- %if 0%{?fedora} > 12
|
| |
- %global with_python3 1
|
| |
- %endif
|
| |
|
| |
%global pypi_name fasteners
|
| |
+ %global py3_prefix python%{python3_pkgversion}
|
| |
+
|
| |
+ %bcond_with py3_tests
|
| |
|
| |
Name: python-%{pypi_name}
|
| |
Version: 0.9.0
|
| |
- Release: 2%{?dist}
|
| |
+ Release: 3%{?dist}
|
| |
Summary: A python package that provides useful locks
|
| |
|
| |
License: ASL 2.0
|
| |
@@ -15,85 +15,55 @@
|
| |
BuildArch: noarch
|
| |
|
| |
BuildRequires: python2-devel
|
| |
-
|
| |
BuildRequires: python-six
|
| |
Requires: python-six
|
| |
|
| |
# tests:
|
| |
- BuildRequires: python-testtools
|
| |
+ BuildRequires: python-futures
|
| |
BuildRequires: python-nose
|
| |
+ BuildRequires: python-testtools
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
- %package -n python3-%{pypi_name}
|
| |
- Summary: A python package that provides useful locks
|
| |
|
| |
- BuildRequires: python3-six
|
| |
- BuildRequires: python3-devel
|
| |
+ %package -n %{py3_prefix}-%{pypi_name}
|
| |
+ Summary: A python package that provides useful locks
|
| |
|
| |
+ BuildRequires: %{py3_prefix}-devel
|
| |
+ %if %{with py3_tests}
|
| |
# tests
|
| |
- BuildRequires: python3-testtools
|
| |
- BuildRequires: python3-nose
|
| |
+ BuildRequires: %{py3_prefix}-nose
|
| |
+ BuildRequires: %{py3_prefix}-six
|
| |
+ BuildRequires: %{py3_prefix}-testtools
|
| |
+ %endif
|
| |
|
| |
- Requires: python3-six
|
| |
+ Requires: %{py3_prefix}-six
|
| |
|
| |
- %description -n python3-%{pypi_name}
|
| |
+ %description -n %{py3_prefix}-%{pypi_name}
|
| |
A python package that provides useful locks.
|
| |
|
| |
|
| |
- %endif
|
| |
-
|
| |
-
|
| |
%description
|
| |
A python package that provides useful locks.
|
| |
|
| |
|
| |
%prep
|
| |
- %setup -qc
|
| |
- mv %{pypi_name}-%{version} python2
|
| |
- pushd python2
|
| |
-
|
| |
- # copy LICENSE etc. to top level dir
|
| |
- cp -a LICENSE ..
|
| |
- cp -a README.rst ..
|
| |
-
|
| |
+ %autosetup -p1 -n %{pypi_name}-%{version}
|
| |
# Remove bundled egg-info
|
| |
rm -rf %{pypi_name}.egg-info
|
| |
|
| |
- popd
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- cp -a python2 python3
|
| |
- %endif
|
| |
-
|
| |
-
|
| |
%build
|
| |
- pushd python2
|
| |
- %{__python2} setup.py build
|
| |
- popd
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- pushd python3
|
| |
- %{__python3} setup.py build
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
+ %py2_build
|
| |
+ %py3_build
|
| |
|
| |
%install
|
| |
- pushd python2
|
| |
- %{__python2} setup.py install --skip-build --root %{buildroot}
|
| |
- popd
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- pushd python3
|
| |
- %{__python3} setup.py install --skip-build --root %{buildroot}
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
+ %py2_install
|
| |
+ %py3_install
|
| |
|
| |
%check
|
| |
nosetests-2.7
|
| |
+ %if %{with py3_tests}
|
| |
+ nosetests-%{python3_version}
|
| |
+ %endif
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
- nosetests-3.4
|
| |
- %endif # with_python3
|
| |
|
| |
%files
|
| |
%doc README.rst
|
| |
@@ -101,16 +71,17 @@
|
| |
%{python2_sitelib}/%{pypi_name}
|
| |
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python_version}.egg-info
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
- %files -n python3-%{pypi_name}
|
| |
+ %files -n %{py3_prefix}-%{pypi_name}
|
| |
%doc README.rst
|
| |
%license LICENSE
|
| |
%{python3_sitelib}/%{pypi_name}
|
| |
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
|
| |
- %endif # with_python3
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Mon Apr 13 2020 Felix Schwarz <fschwarz@fedoraproject.org> - 0.9.0-3
|
| |
+ - add Python 3 subpackage
|
| |
+
|
| |
* Fri Jun 12 2015 Matthias Runge <mrunge@redhat.com> - 0.9.0-2
|
| |
- switch to github sourcecode, license included
|
| |
- add tests, fix conditionals for python3
|
| |
This pr adds a Python 3 subpackage (rhbz #1823122). While I was working on this I noticed that no unittests were run in %check. I fixed that as well.
This PR requires python36-testtools which is not yet available in EPEL 7. I submitted a pull request for that as well: https://src.fedoraproject.org/rpms/python-testtools/pull-request/7