From acf7d1ace8870e7d1095f8c4356358e9418936ec Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Feb 23 2016 19:23:10 +0000 Subject: Ship python2-workerpool - Modernize spec --- diff --git a/python-workerpool.spec b/python-workerpool.spec index b60ba7e..274ed6a 100644 --- a/python-workerpool.spec +++ b/python-workerpool.spec @@ -1,13 +1,13 @@ -%global with_python3 1 +%global srcname workerpool -Name: python-workerpool +Name: python-%{srcname} Version: 0.9.2 Release: 10%{?dist} Summary: Multithreaded job distribution module License: MIT URL: https://github.com/shazow/workerpool -Source0: http://workerpool.googlecode.com/files/workerpool-%{version}.tar.gz +Source0: http://workerpool.googlecode.com/files/%{srcname}-%{version}.tar.gz # Fix tests to account for non-sequential ordering # https://github.com/shazow/workerpool/pull/4 Patch0: python-workerpool-test.patch @@ -16,15 +16,31 @@ BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-nose BuildRequires: python-setuptools -%if 0%{?with_python3} -BuildRequires: python3-devel -BuildRequires: python3-nose -BuildRequires: python3-setuptools +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-nose +BuildRequires: python%{python3_pkgversion}-setuptools # For 2to3 BuildRequires: python-tools -%endif # if with_python3 %description +The workerpool module for python is a simple framework for easily +distributing jobs into multiple worker threads. Examples of usage can be +found in the unit tests and the samples provided. This module facilitates +distributing simple operations into jobs that are sent to worker threads, +maintained by a pool object. + +It consists of these components: + +* Jobs - single units of work that need to be performed. +* Workers - workers grab jobs from a queue and run them. +* Worker pool - keeps track of workers and the job queue. + + +%package -n python2-%{srcname} +Summary: Multithreaded job distribution module +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} The workerpool module for python 2 is a simple framework for easily distributing jobs into multiple worker threads. Examples of usage can be found in the unit tests and the samples provided. This module facilitates @@ -38,12 +54,12 @@ It consists of these components: * Worker pool - keeps track of workers and the job queue. -%if 0%{?with_python3} -%package -n python3-workerpool +%package -n python%{python3_pkgversion}-%{srcname} Summary: Multithreaded job distribution module +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} -%description -n python3-workerpool -The workerpool module for python 3 is a simple framework for easily +%description -n python%{python3_pkgversion}-%{srcname} +The workerpool module for python %{python3_version} is a simple framework for easily distributing jobs into multiple worker threads. Examples of usage can be found in the unit tests and the samples provided. This module facilitates distributing simple operations into jobs that are sent to worker threads, @@ -54,68 +70,68 @@ It consists of these components: * Jobs - single units of work that need to be performed. * Workers - workers grab jobs from a queue and run them. * Worker pool - keeps track of workers and the job queue. -%endif # if with_python3 %prep -%setup -q -n workerpool-%{version} -%patch0 -p1 -b .test -rm -r workerpool.egg-info - -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -2to3 --write --nobackups %{py3dir} -%endif # with_python3 +%setup -q -c +%patch0 -p0 -b .test +rm -r %{srcname}-%{version}/%{srcname}.egg-info +mv %{srcname}-%{version} python2 +cp -rp python2 python3 +2to3 --write --nobackups python3 %build -%{__python} setup.py build +cd python2 +%py2_build +cd - -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif # with_python3 +cd python3 +%py3_build +cd - %install # Must do the python3 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 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} -popd -%endif # with_python3 +cd python3 +%py3_install +cd - -%{__python} setup.py install --skip-build --root %{buildroot} +cd python2 +%py2_install +cd - %check # Error at exit due to http://bugs.python.org/issue15881 # Hopefully to be fixed in 2.7.4 +cd python2 %{__python} setup.py test +cd - -%if 0%{?with_python3} -pushd %{py3dir} +cd python3 %{__python3} setup.py test -popd -%endif # with_python3 +cd - -%files -%doc CHANGES LICENSE README samples -%{python_sitelib}/* - -%if 0%{?with_python3} -%files -n python3-workerpool -%doc CHANGES LICENSE README samples +%files -n python2-%{srcname} +%license python2/LICENSE +%doc python2/CHANGES python2/README python2/samples +%{python2_sitelib}/* + +%files -n python%{python3_pkgversion}-%{srcname} +%license python3/LICENSE +%doc python3/CHANGES python3/README python3/samples %{python3_sitelib}/* -%endif # with_python3 %changelog +* Tue Feb 23 2016 Orion Poplawski - 0.9.2-11 +- Ship python2-workerpool +- Modernize spec + * Thu Feb 04 2016 Fedora Release Engineering - 0.9.2-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild