| |
@@ -1,5 +1,6 @@
|
| |
%bcond_without tests
|
| |
%bcond_without docs
|
| |
+ %bcond_without python2
|
| |
|
| |
%if 0%{?fedora} || 0%{?rhel} >= 8
|
| |
%bcond_without python3
|
| |
@@ -9,7 +10,7 @@
|
| |
|
| |
Name: python-atomicwrites
|
| |
Version: 1.3.0
|
| |
- Release: 5%{?git_tag}%{?dist}
|
| |
+ Release: 6%{?git_tag}%{?dist}
|
| |
Summary: Python Atomic file writes on POSIX
|
| |
|
| |
License: MIT
|
| |
@@ -18,9 +19,10 @@
|
| |
|
| |
BuildArch: noarch
|
| |
|
| |
- BuildRequires: python2-devel
|
| |
%global short_name atomicwrites
|
| |
|
| |
+ %if %{with python2}
|
| |
+ BuildRequires: python2-devel
|
| |
BuildRequires: python2-setuptools
|
| |
%if %{with docs} && %{without python3}
|
| |
BuildRequires: python2-sphinx
|
| |
@@ -28,6 +30,7 @@
|
| |
%if %{with tests}
|
| |
BuildRequires: python2-pytest
|
| |
%endif
|
| |
+ %endif
|
| |
|
| |
%if %{with python3}
|
| |
BuildRequires: python3-devel
|
| |
@@ -50,11 +53,13 @@
|
| |
|
| |
%description %_description
|
| |
|
| |
+ %if %{with python2}
|
| |
%package -n python2-%{short_name}
|
| |
Summary: %summary
|
| |
%{?python_provide:%python_provide python2-%{short_name}}
|
| |
|
| |
%description -n python2-%{short_name} %_description
|
| |
+ %endif
|
| |
|
| |
%if %{with python3}
|
| |
%package -n python3-%{short_name}
|
| |
@@ -72,6 +77,7 @@
|
| |
%setup -q
|
| |
|
| |
%build
|
| |
+ %if %{with python2}
|
| |
%{__python2} setup.py --quiet build
|
| |
|
| |
%if %{with docs} && %{without python3}
|
| |
@@ -81,6 +87,7 @@
|
| |
cd ..
|
| |
unset PYTHONPATH
|
| |
%endif
|
| |
+ %endif
|
| |
|
| |
%if %{with python3}
|
| |
%py3_build
|
| |
@@ -96,7 +103,9 @@
|
| |
|
| |
|
| |
%install
|
| |
+ %if %{with python2}
|
| |
%{__python2} setup.py --quiet install -O1 --skip-build --root $RPM_BUILD_ROOT
|
| |
+ %endif
|
| |
|
| |
%if %{with python3}
|
| |
%py3_install
|
| |
@@ -109,19 +118,23 @@
|
| |
|
| |
%check
|
| |
%if %{with tests}
|
| |
+ %if %{with python2}
|
| |
%{__python2} -m pytest -v
|
| |
+ %endif
|
| |
|
| |
%if %{with python3}
|
| |
%{__python3} -m pytest -v
|
| |
%endif
|
| |
%endif
|
| |
|
| |
+ %if %{with python2}
|
| |
%files -n python2-%{short_name}
|
| |
%doc LICENSE README.rst
|
| |
%{python2_sitelib}/*
|
| |
%if %{with docs} && %{without python3}
|
| |
%{_mandir}/man1/atomicwrites.1.*
|
| |
%endif
|
| |
+ %endif
|
| |
|
| |
%if %{with python3}
|
| |
%files -n python3-%{short_name}
|
| |
@@ -133,6 +146,9 @@
|
| |
%endif
|
| |
|
| |
%changelog
|
| |
+ * Mon Nov 18 2019 Patrik Kopkan <pkopkan@redhat.com> - 1.3.0-6
|
| |
+ - add bcond python2
|
| |
+
|
| |
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-5
|
| |
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
| |
|
| |