%global upstream_name blessings
%if 0%{?fedora}
%bcond_without python3
%else
%bcond_with python3
%endif
Name: python-%{upstream_name}
Version: 1.5
Release: 6%{?dist}
Summary: Python library for terminal coloring, styling, and positioning
License: MIT
URL: https://github.com/erikrose/blessings
Source0: http://pypi.python.org/packages/source/b/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
# https://github.com/erikrose/blessings/issues/25
Patch0: blessings-1.5-tests-without-tty.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
%if %{with python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-nose
%endif
%description
Blessings is a thin, practical wrapper around terminal coloring, styling, and
positioning in Python.
%if %{with python3}
%package -n python3-%{upstream_name}
Summary: Python library for terminal coloring, styling, and positioning
%description -n python3-%{upstream_name}
Blessings is a thin, practical wrapper around terminal coloring, styling, and
positioning in Python.
%endif
%prep
%setup -q -n %{upstream_name}-%{version}
%patch0 -p1
rm -rf blessings.egg-info
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%{__python} setup.py build
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%if %{with python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif
%{__python} setup.py install --skip-build --root %{buildroot}
%check
%{__python} setup.py test
%if %{with python3}
pushd %{py3dir}
nosetests-%{python3_version} build/lib
%endif
%files
%doc README.rst LICENSE
%{python_sitelib}/blessings
%{python_sitelib}/blessings*.egg-info
%if %{with python3}
%files -n python3-%{upstream_name}
%doc README.rst LICENSE
%{python3_sitelib}/blessings
%{python3_sitelib}/blessings*.egg-info
%endif
%changelog
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 1.5-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Nov 30 2012 Dan Callaghan <dcallagh@redhat.com> - 1.5-1
- initial version