3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module blessings
8 %define egg_name blessings
9 %define pypi_name blessings
10 Summary: Python library for terminal coloring, styling, and positioning
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: 38555a2bba0ace706aec58444368e022
18 Patch1: 0001-fix-tests-when-run-without-a-tty-fixes-25.patch
19 Patch2: 0002-more-fixes-for-tests-without-a-tty.patch
20 URL: https://github.com/erikrose/blessings
22 BuildRequires: python-modules >= 1:2.5
23 BuildRequires: python-nose
24 BuildRequires: python-setuptools
25 BuildRequires: python-six
28 BuildRequires: python3-modules >= 1:3.2
29 BuildRequires: python3-nose
30 BuildRequires: python3-setuptools
31 BuildRequires: python3-six
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 Blessings is a thin, practical wrapper around terminal coloring,
39 styling, and positioning in Python.
41 %package -n python3-%{module}
42 Summary: Python 3 library for terminal coloring, styling, and positioning
43 Group: Libraries/Python
46 %description -n python3-%{module}
47 Blessings is a thin, practical wrapper around terminal coloring,
48 styling, and positioning in Python.
51 %setup -q -n %{pypi_name}-%{version}
54 rm -r blessings.egg-info
60 nosetests-%{py_ver} build-2/lib
66 nosetests-%{py3_ver} build-3/lib
71 rm -rf $RPM_BUILD_ROOT
81 rm -rf $RPM_BUILD_ROOT
85 %defattr(644,root,root,755)
86 %doc README.rst LICENSE
87 %{py_sitescriptdir}/%{module}
88 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
92 %files -n python3-%{module}
93 %defattr(644,root,root,755)
94 %doc README.rst LICENSE
95 %{py3_sitescriptdir}/%{module}
96 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info