ea984b
%global pypi_name blessed
0c307f
%global summary A thin, practical wrapper around terminal capabilities in Python
0c307f
%global _description \
0c307f
Blessed is a thin, practical wrapper around terminal styling, screen \
0c307f
positioning, and keyboard input. \
0c307f
\
0c307f
It provides: \
0c307f
- Styles, color, and maybe a little positioning without necessarily clearing \
0c307f
  the whole screen first. \
0c307f
- Works great with standard Python string formatting. \
eca4ba
- Provides up-to-the-moment terminal height and width, so you can respond \
0c307f
  to terminal size changes. \
0c307f
- Avoids making a mess if the output gets piped to a non-terminal: outputs \
0c307f
  to any file-like object such as StringIO, files, or pipes. \
0c307f
- Uses the terminfo(5) database so it works with any terminal type and \
0c307f
  supports any terminal capability: No more C-like calls to tigetstr and \
0c307f
  tparm. \
0c307f
- Keeps a minimum of internal state, so you can feel free to mix and match \
0c307f
  with calls to curses or whatever other terminal libraries you like. \
0c307f
- Provides plenty of context managers to safely express terminal modes, \
0c307f
  automatically restoring the terminal to a safe state on exit. \
0c307f
- Act intelligently when somebody redirects your output to a file, omitting \
0c307f
  all of the terminal sequences such as styling, colors, or positioning. \
0c307f
- Dead-simple keyboard handling: safely decoding unicode input in your \
0c307f
  system’s preferred locale and supports application/arrow keys. \
0c307f
- Allows the printable length of strings containing sequences to be \
0c307f
  determined.
0c307f
ea984b
%bcond_without python3
0c307f
73cbc2
# Disable dependency generator until it has test code
73cbc2
%{?python_disable_dependency_generator}
73cbc2
ea984b
# Drop Python 2 with Fedora 30 and EL8
ea984b
%if (0%{?fedora} && 0%{?fedora} < 30) || (0%{?rhel} && 0%{?rhel} < 8)
ea984b
  %bcond_without python2
ea984b
%else
ea984b
  %bcond_with python2
ea984b
%endif
ea984b
ea984b
Name:       python-%{pypi_name}
0b3066
Version:    1.15.0
edfc6b
Release:    11%{?dist}
0c307f
Summary:    %{summary}
0c307f
0c307f
License:    MIT
ea984b
URL:        https://github.com/jquast/blessed
ea984b
Source0:    %{pypi_source}
ea984b
BuildArch:      noarch
0c307f
2eb694
%if 0%{?el6}
2eb694
Patch0:     el6_pytest_fixes.patch
3219a1
Patch1:     el6_setup_fixes.patch
2eb694
%endif
2eb694
ea984b
%if %{with python2}
ea984b
BuildRequires:  python2-devel
ea984b
BuildRequires:  python2-setuptools
ea984b
BuildRequires:  python2-six
ea984b
BuildRequires:  python2-wcwidth
ea984b
BuildRequires:  python2-mock
ea984b
BuildRequires:  python2-pytest
ea984b
%endif
2eb694
ea984b
%if %{with python3}
ea984b
BuildRequires:  python%{python3_pkgversion}-devel
ea984b
BuildRequires:  python%{python3_pkgversion}-setuptools
ea984b
BuildRequires:  python%{python3_pkgversion}-six
ea984b
BuildRequires:  python%{python3_pkgversion}-wcwidth
ea984b
BuildRequires:  python%{python3_pkgversion}-mock
ea984b
BuildRequires:  python%{python3_pkgversion}-pytest
0c307f
%endif
0c307f
ea984b
%if 0%{?with_python3_other}
ea984b
BuildRequires:  python%{python3_other_pkgversion}-devel
ea984b
BuildRequires:  python%{python3_other_pkgversion}-setuptools
ea984b
BuildRequires:  python%{python3_other_pkgversion}-six
ea984b
BuildRequires:  python%{python3_other_pkgversion}-wcwidth
ea984b
BuildRequires:  python%{python3_other_pkgversion}-mock
ea984b
BuildRequires:  python%{python3_other_pkgversion}-pytest
ea984b
%endif
0c307f
0c307f
%description %{_description}
0c307f
0c307f
ea984b
# Python 2 package
ea984b
%if %{with python2}
ea984b
%package -n     python2-%{pypi_name}
0c307f
Summary:        %{summary}
ea984b
%{?python_provide:%python_provide python2-%{pypi_name}}
0c307f
ea984b
Requires:       python2-six
ea984b
Requires:       python2-wcwidth
0c307f
ea984b
%description -n python2-%{pypi_name} %{_description}
ea984b
%endif
0c307f
ea984b
# Python 3 package
ea984b
%if %{with python3}
ea984b
%package -n     python%{python3_pkgversion}-%{pypi_name}
0c307f
Summary:        %{summary}
ea984b
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
0c307f
0c307f
Requires:       python%{python3_pkgversion}-six
0c307f
Requires:       python%{python3_pkgversion}-wcwidth
0c307f
ea984b
%description -n python%{python3_pkgversion}-%{pypi_name} %{_description}
ea984b
%endif
0c307f
ea984b
# Python 3 other package
0c307f
%if 0%{?with_python3_other}
ea984b
%package -n     python%{python3_other_pkgversion}-%{pypi_name}
0c307f
Summary:        %{summary}
ea984b
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{pypi_name}}
0c307f
0c307f
Requires:       python%{python3_other_pkgversion}-six
0c307f
Requires:       python%{python3_other_pkgversion}-wcwidth
0c307f
ea984b
%description -n python%{python3_other_pkgversion}-%{pypi_name} %{_description}
ea984b
%endif
ea984b
0c307f
0c307f
%prep
ea984b
%autosetup -p1 -n %{pypi_name}-%{version}
ea984b
ea984b
# Remove bundled egg-info
ea984b
rm -rf %{pypi_name}.egg-info
ea984b
0c307f
0c307f
%build
ea984b
%if %{with python2}
0c307f
%py2_build
ea984b
%endif
ea984b
ea984b
%if %{with python3}
0c307f
%py3_build
ea984b
%endif
ea984b
0c307f
%if 0%{?with_python3_other}
0c307f
%py3_other_build
0c307f
%endif
ea984b
0c307f
0c307f
%install
0c307f
%if 0%{?with_python3_other}
0c307f
%py3_other_install
0c307f
%endif
ea984b
ea984b
%if %{with python3}
ea984b
%py3_install
ea984b
%endif
ea984b
ea984b
%if %{with python2}
ea984b
%py2_install
2eb694
%endif
0c307f
ea984b
0c307f
%check
0c307f
export PYTHONIOENCODING=UTF8
0c307f
export TERM=xterm-256color
ea984b
%if %{with python2}
ea984b
%{__python2} -m pytest --strict --verbose --verbose --exitfirst
0c307f
%endif
ea984b
ea984b
%if %{with python3}
ea984b
%{__python3} -m pytest --strict --verbose --verbose --exitfirst
2eb694
%endif
0c307f
ea984b
%if 0%{?with_python3_other}
ea984b
%{__python3_other} -m pytest --strict --verbose --verbose --exitfirst
ea984b
%endif
ea984b
ea984b
ea984b
%if %{with python2}
ea984b
%files -n python2-%{pypi_name}
0c307f
%license LICENSE
0c307f
%doc README.rst docs/*.rst
ea984b
%{python2_sitelib}/%{pypi_name}
ea984b
%{python2_sitelib}/%{pypi_name}-*.egg-info
ea984b
%endif
0c307f
ea984b
%if %{with python3}
ea984b
%files -n python%{python3_pkgversion}-%{pypi_name}
0c307f
%license LICENSE
0c307f
%doc README.rst docs/*.rst
ea984b
%{python3_sitelib}/%{pypi_name}
ea984b
%{python3_sitelib}/%{pypi_name}-*.egg-info
ea984b
%endif
0c307f
0c307f
%if 0%{?with_python3_other}
ea984b
%files -n python%{python3_other_pkgversion}-%{pypi_name}
0c307f
%license LICENSE
0c307f
%doc README.rst docs/*.rst
ea984b
%{python3_other_sitelib}/%{pypi_name}
ea984b
%{python3_other_sitelib}/%{pypi_name}-*.egg-info
ea984b
%endif
ea984b
0c307f
0c307f
%changelog
edfc6b
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.15.0-11
edfc6b
- Rebuilt for Python 3.8
edfc6b
2075b2
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-10
2075b2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
2075b2
41fc0d
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-9
41fc0d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
41fc0d
73cbc2
* Mon Dec 24 2018 Avram Lubkin <aviso@rockhopper.net> - 1.15.0-8
73cbc2
- Disable Python dependency generator until it has test code
73cbc2
ea984b
* Mon Dec 24 2018 Avram Lubkin <aviso@rockhopper.net> - 1.15.0-7
ea984b
- Remove Python 2 packages in Fedora 30+ (bz#1661354)
ea984b
- Clean up spec
ea984b
e1097f
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.15.0-6
e1097f
- Drop explicit locale setting
e1097f
  See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
e1097f
e6d786
* Tue Nov 13 2018 Avram Lubkin <aviso@rockhopper.net> - 1.15.0-5
e6d786
- Build Python 3 version on all platforms
e6d786
f16810
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.15.0-4
f16810
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
f16810
b8c6fb
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 1.15.0-3
b8c6fb
- Rebuilt for Python 3.7
b8c6fb
b96dac
* Wed Jun 20 2018 Avram Lubkin <aviso@rockhopper.net> - 1.15.0-2
b96dac
- Fixed spec changelog error
b96dac
b96dac
* Wed Jun 20 2018 Avram Lubkin <aviso@rockhopper.net>- 1.15.0-1
0b3066
- Updated to 1.15.0 (Python 3.7 Support)
0b3066
- Exit tests on first failure to avoid loops
0b3066
08fc0c
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.14.1-7
08fc0c
- Rebuilt for Python 3.7
08fc0c
1a0cd8
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.14.1-6
1a0cd8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
1a0cd8
eca4ba
* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.14.1-5
eca4ba
- Fix creation of python2- subpackage
eca4ba
3219a1
* Wed Oct 04 2017 Avram Lubkin <aviso@rockhopper.net> - 1.14.1-4
3219a1
- Conflicting ordereddict requirements in EL6
3219a1
2eb694
* Wed Oct 04 2017 Avram Lubkin <aviso@rockhopper.net> - 1.14.1-3
2eb694
- Add EL6 build support
2eb694
2c3438
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.14.1-2
2c3438
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2c3438
0c307f
* Mon Mar 13 2017 Aurelien Bompard <abompard@fedoraproject.org> - 1.14.1
0c307f
- Initial package.