%if 0%{?rhel}
%global with_python3 0
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%{!?py2_build: %global py2_build %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} build --executable="%{__python2} -s"}}
%{!?py2_install: %global py2_install %{expand: CFLAGS="%{optflags}" %{__python2} setup.py %{?py_setup_args} install -O1 --skip-build --root %{buildroot}}}
%else
%global with_python3 1
%endif
%global pypi_name prompt_toolkit
Name: python-%{pypi_name}
Version: 0.57
Release: 2%{?dist}
Summary: Library for building powerful interactive command lines in Python
License: BSD
URL: https://github.com/jonathanslenders/python-prompt-toolkit
Source0: https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif # with_python3
%description
prompt_toolkit is a library for building powerful interactive command lines
and terminal applications in Python.
%package -n python2-%{pypi_name}
Summary: Library for building powerful interactive command lines in Python
%{?python_provide:%python_provide python2-%{pypi_name}}
%{?el6:Provides: python-%{pypi_name}}
Requires: python-pygments
Requires: python-six >= 1.9.0
Requires: python-wcwidth
%description -n python2-%{pypi_name}
prompt_toolkit is a library for building powerful interactive command lines
and terminal applications in Python.
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Library for building powerful interactive command lines in Python
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: python3-pygments
Requires: python3-six >= 1.9.0
Requires: python3-wcwidth
%description -n python3-%{pypi_name}
prompt_toolkit is a library for building powerful interactive command lines
and terminal applications in Python.
%endif # with_python3
%prep
%setup -q -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif # with_python3
%install
%if 0%{?with_python3}
%py3_install
%endif # with_python3
%py2_install
%files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc}
%doc README.rst AUTHORS.rst CHANGELOG TODO.rst
%license LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst AUTHORS.rst CHANGELOG TODO.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3
%changelog
* Tue Jan 12 2016 Fabio Alessandro Locati <fabio@locati.cc> - 0.57-2
- Make the EL6 package provide python-prompt_toolkit too
* Sat Jan 09 2016 Fabio Alessandro Locati <fabio@locati.cc> - 0.57-1
- New upstream update
* Wed Jan 06 2016 Fabio Alessandro Locati <fabio@locati.cc> - 0.54-2
- Fix quiet setup
- Fix license
- Add AUTHORS.rst, CHANGELOG & TODO.rst
* Tue Dec 29 2015 Fabio Alessandro Locati <fabio@locati.cc> - 0.54-1
- Initial package.