From cbe3bc0f12d56ee65b1fa3c724c93b986d7d6a4b29eca1d52921810957de18b1 Mon Sep 17 00:00:00 2001 From: Todd R Date: Wed, 12 Apr 2017 17:22:01 +0000 Subject: [PATCH] Accepting request 487662 from home:TheBlackCat:branches:devel:languages:python Implement single-spec version OBS-URL: https://build.opensuse.org/request/show/487662 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-termstyle?expand=0&rev=5 --- python-termstyle.changes | 5 +++++ python-termstyle.spec | 26 ++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/python-termstyle.changes b/python-termstyle.changes index 39a9e5a..466ff40 100644 --- a/python-termstyle.changes +++ b/python-termstyle.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 12 16:55:35 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version. + ------------------------------------------------------------------- Mon Apr 3 18:56:16 UTC 2017 - jengelh@inai.de diff --git a/python-termstyle.spec b/python-termstyle.spec index 1c0c03e..5bed5c7 100644 --- a/python-termstyle.spec +++ b/python-termstyle.spec @@ -15,7 +15,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # +%bcond_without tests +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-termstyle Version: 0.1.11 Release: 0 @@ -24,12 +26,15 @@ License: BSD-3-Clause Group: Development/Languages/Python Url: http://github.com/gfxmonk/termstyle Source: https://files.pythonhosted.org/packages/source/t/termstyle/termstyle-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-setuptools +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} Provides: python-python-termstyle = %{version} Obsoletes: python-python-termstyle < %{version} BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch +%python_subpackages %description termstyle is a Python library for adding coloured output to @@ -40,15 +45,24 @@ terminal (console) programs. The definitions come from ECMA-048, the %setup -q -n termstyle-%{version} %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_expand %fdupes -s %{buildroot}%{$python_sitelib} +%if %{with tests} %check -python setup.py test +export LANG=en_US.UTF-8 +%if %have_python2 +python2 setup.py test +%endif +%if %have_python3 +python3 test3.py +%endif +%endif -%files +%files %{python_files} %defattr(-,root,root,-) %doc LICENSE README.rst %{python_sitelib}/*