From 70e1834c1b3b1658cc1e608e9ac29950109536ef Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Sep 29 2015 19:44:18 +0000 Subject: cleanup and use new py_build macros etc --- diff --git a/python-simplegeneric.spec b/python-simplegeneric.spec index 14228fb..755a4e9 100644 --- a/python-simplegeneric.spec +++ b/python-simplegeneric.spec @@ -15,7 +15,6 @@ Group: Development/Languages License: Python or ZPLv2.1 URL: http://cheeseshop.python.org/pypi/simplegeneric Source0: http://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.zip -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel @@ -34,12 +33,30 @@ functions use simple lookup tables, akin to those used by e.g. pickle.dump() and other generic functions found in the Python standard library. +%package -n python2-%{modname} +Summary: Simple generic functions (similar to Python's own len(), pickle.dump(), etc.) + +Group: Development/Languages +License: Python or ZPLv2.1 +%{?python_provide:%python_provide python2-%{modname}} + + +%description -n python2-%{modname} +The simplegeneric module lets you define simple single-dispatch generic +functions, akin to Python's built-in generic functions like len(), iter() and +so on. However, instead of using specially-named methods, these generic +functions use simple lookup tables, akin to those used by e.g. pickle.dump() +and other generic functions found in the Python standard library. + + %if 0%{?with_python3} %package -n python3-%{modname} Summary: Simple generic functions (similar to Python's own len(), pickle.dump(), etc.) Group: Development/Languages License: Python or ZPLv2.1 +%{?python_provide:%python_provide python3-%{modname}} + %description -n python3-%{modname} The simplegeneric module lets you define simple single-dispatch generic @@ -67,24 +84,23 @@ find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' %build -%{__python} setup.py build +%py2_build %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py build +%py3_build popd %endif # with_python3 %install -rm -rf %{buildroot} %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install --skip-build --root %{buildroot} +%py3_install popd %endif # with_python3 -%{__python} setup.py install --skip-build --root %{buildroot} +%py2_install %check %if 0%{?with_python3} @@ -95,18 +111,14 @@ popd PYTHONPATH=$(pwd) %{__python} setup.py test -%clean -rm -rf %{buildroot} -%files -%defattr(-,root,root,-) +%files -n python2-%{modname} %doc README.txt %{python_sitelib}/simplegeneric.py* %{python_sitelib}/simplegeneric-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{modname} -%defattr(-,root,root,-) %doc README.txt %{python3_sitelib}/__pycache__/simplegeneric.cpython* %{python3_sitelib}/simplegeneric.py* @@ -116,6 +128,7 @@ rm -rf %{buildroot} %changelog * Tue Sep 29 2015 Thomas Spura - 0.8.1-1 - update to 0.8.1 (no user visible changes, but packages require it on pypi) +- cleanup and use new py_build macros etc * Thu Jun 18 2015 Fedora Release Engineering - 0.8-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild