Blob Blame History Raw
%global upstream_name blessings

%if 0%{?fedora}
%bcond_without python3
%else
%bcond_with python3
%endif

Name:           python-%{upstream_name}
Version:        1.5
Release:        16%{?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

%description
Blessings is a thin, practical wrapper around terminal coloring, styling, and 
positioning in Python.

%package -n python2-%{upstream_name}
Summary:        Python 2 library for terminal coloring, styling, and positioning
%{?python_provide:%python_provide python2-%{upstream_name}}
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-nose

%description -n python2-%{upstream_name}
Blessings is a thin, practical wrapper around terminal coloring, styling, and 
positioning in Python.

%if %{with python3}
%package -n python3-%{upstream_name}
Summary:        Python 3 library for terminal coloring, styling, and positioning
%{?python_provide:%python_provide python3-%{upstream_name}}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-nose

%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}
# Note that we can't do the conventional in-place build using %%py2_build and 
# %%py3_build, because that breaks use_2to3.
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python2} 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

%{__python2} setup.py install --skip-build --root %{buildroot}

%check
%{__python2} setup.py test
%if %{with python3}
pushd %{py3dir}
nosetests-%{python3_version} build/lib
%endif

%files -n python2-%{upstream_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/blessings
%{python2_sitelib}/blessings*.egg-info

%if %{with python3}
%files -n python3-%{upstream_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/blessings
%{python3_sitelib}/blessings*.egg-info
%endif

%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.5-16
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Jun 23 2017 Dan Callaghan <dcallagh@redhat.com> - 1.5-13
- forgot to add %%python_provide macro

* Fri Jun 23 2017 Dan Callaghan <dcallagh@redhat.com> - 1.5-12
- renamed python-blessings to python2-blessings

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.5-10
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-7
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* 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