[packages/python-async] - drop tests from installation - modernize spec, release 2
qboosh
qboosh at pld-linux.org
Wed Mar 20 18:12:43 CET 2019
commit d9f72e25ebd92445b0cd4294192f5fc11732f44a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Mar 20 18:18:34 2019 +0100
- drop tests from installation
- modernize spec, release 2
python-async.spec | 84 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 73 insertions(+), 11 deletions(-)
---
diff --git a/python-async.spec b/python-async.spec
index 20f513b..be17a0a 100644
--- a/python-async.spec
+++ b/python-async.spec
@@ -1,19 +1,35 @@
+#
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+%bcond_with python3 # CPython 3.x module [broken: async is a keyword in python 3.5+]
+%bcond_without tests # unit tests
+
%define module async
Summary: Async Framework
-# Name must match the python module/package name (as in 'import' statement)
+Summary(pl.UTF-8): Szkielet Async do programowania asynchronicznego
Name: python-%{module}
Version: 0.6.2
-Release: 1
+Release: 2
License: BSD
Group: Development/Languages/Python
-Source0: http://pypi.python.org/packages/source/a/async/%{module}-%{version}.tar.gz
+#Source0Download: https://pypi.org/simple/async/
+Source0: https://files.pythonhosted.org/packages/source/a/async/%{module}-%{version}.tar.gz
# Source0-md5: 9b06b5997de2154f3bc0273f80bcef6b
URL: https://github.com/gitpython-developers/async
-BuildRequires: python-devel
-BuildRequires: python-distribute
+%if %{with python}
+BuildRequires: python-devel >= 1:2.6
+BuildRequires: python-setuptools
+%{?with_tests:BuildRequires: python-nose}
+%endif
+%if %{with python3}
+BuildRequires: python3-devel >= 1:3.3
+BuildRequires: python3-devel < 1:3.5
+BuildRequires: python3-setuptools
+%{?with_tests:BuildRequires: python3-nose}
+%endif
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.710
-Requires: python-modules
+BuildRequires: rpmbuild(macros) >= 1.714
+Requires: python-modules >= 1:2.6
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -21,25 +37,71 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Async is a framework to process interdependent tasks in a pool of
workers.
+%description -l pl.UTF-8
+Async to szkielet do przetwarzania niezależnych zadań przez pulę
+workerów.
+
+%package -n python3-%{module}
+Summary: Async Framework
+Summary(pl.UTF-8): Szkielet Async do programowania asynchronicznego
+Group: Development/Languages/Python
+Requires: python3-modules >= 1:3.3
+
+%description -n python3-%{module}
+Async is a framework to process interdependent tasks in a pool of
+workers.
+
+%description -n python3-%{module} -l pl.UTF-8
+Async to szkielet do przetwarzania niezależnych zadań przez pulę
+workerów.
+
%prep
%setup -q -n %{module}-%{version}
%build
-%py_build
+%if %{with python2}
+%py_build %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%py3_build %{?with_tests:test}
+%endif
%install
rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
%py_install
%py_postclean
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/async/test
+%endif
+
+%if %{with python3}
+%py3_install
+
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/async/test
+%endif
+
%clean
rm -rf $RPM_BUILD_ROOT
+%if %{with python2}
%files
%defattr(644,root,root,755)
-%doc AUTHORS
+%doc AUTHORS LICENSE
%dir %{py_sitescriptdir}/async
%{py_sitescriptdir}/async/*.py[co]
-%{py_sitescriptdir}/async-*.egg-info
-%{py_sitescriptdir}/async/test
+%{py_sitescriptdir}/async-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc AUTHORS LICENSE
+%dir %{py3_sitescriptdir}/async
+%{py3_sitescriptdir}/async/*.py
+%{py3_sitescriptdir}/async/__pycache__
+%{py3_sitescriptdir}/async-%{version}-py*.egg-info
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-async.git/commitdiff/d9f72e25ebd92445b0cd4294192f5fc11732f44a
More information about the pld-cvs-commit
mailing list