Blob Blame History Raw
# Disable tests since tox.ini is not found properly. I'll try to enable them back ASAP
%bcond_with tests

%global pypi_name wcwidth
%global summary Measures number of Terminal column cells of wide-character codes
%global _description \
This API is mainly for Terminal Emulator implementors, or those writing \
programs that expect to interpreted by a terminal emulator and wish to \
determine the printable width of a string on a Terminal.

Name:           python-%{pypi_name}
Version:        0.2.4
Release:        1%{?dist}
Summary:        %{summary}

License:        MIT
URL:            https://github.com/jquast/wcwidth
Source0:        https://pypi.io/packages/source/w/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch
%if 0%{?el7}
Patch0:     el7_req_fixes.patch
%endif

%description %{_description}

%package -n     python2-%{pypi_name}
BuildRequires:  python2-devel
BuildRequires:  python-setuptools
BuildRequires:  python2-backports-functools_lru_cache
%if %{with tests}
BuildRequires:  python-tox
%endif # with tests
Summary:        %{summary}
Requires:       python2-backports-functools_lru_cache
%{?python_provide:%python_provide python2-%{pypi_name}}
%{?el6:Provides: python-%{pypi_name}}

%description -n python2-%{pypi_name} %{_description}

%package -n     python%{python3_pkgversion}-%{pypi_name}
Summary:        %{summary}
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
%if %{with tests}
BuildRequires:  python%{python3_pkgversion}-tox
%endif # with tests
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}

%description -n python%{python3_pkgversion}-%{pypi_name} %{_description}

%if 0%{?with_python3_other}
%package -n     python%{python3_other_pkgversion}-%{pypi_name}
Summary:        %{summary}
BuildRequires:  python%{python3_other_pkgversion}-devel
BuildRequires:  python%{python3_other_pkgversion}-setuptools
%if %{with tests}
BuildRequires:  python%{python3_other_pkgversion}-tox
%endif # with tests
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{pypi_name}}

%description -n python%{python3_other_pkgversion}-%{pypi_name} %{_description}
%endif # with_python3_other

%prep
%autosetup -p1 -n %{pypi_name}-%{version}

%build
%py2_build
%py3_build
%if 0%{?with_python3_other}
%py3_other_build
%endif # with_python3_other

%install
%py2_install
%py3_install
%if 0%{?with_python3_other}
%py3_other_install
%endif # with_python3_other

%if %{with tests}
%check
%{__python2} setup.py test
%{__python3} setup.py test
%if 0%{?with_python3_other}
%{__python3_other} setup.py test
%endif # with_python3_other
%endif # with tests

%files -n python2-%{pypi_name}
%{!?_licensedir:%global license %doc}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files -n python%{python3_pkgversion}-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%if 0%{?with_python3_other}
%doc README.rst
%license LICENSE
%{python3_other_sitelib}/%{pypi_name}
%{python3_other_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif # with_python3_other

%changelog
* Tue Jun 02 2020 Avram Lubkin <aviso@rockhopper.net> - 0.2.4-1
- Update to 0.2.4

* Tue Jun 02 2020 Avram Lubkin <aviso@rockhopper.net> - 0.2.3-1
- Update to 0.2.3

* Sat Mar 28 2020 Avram Lubkin <aviso@rockhopper.net> - 0.1.9-1
- Update to 0.1.9

* Fri Mar 08 2019 Troy Dawson <tdawson@redhat.com> - 0.1.7-3
- Rebuilt to change main python from 3.4 to 3.6

* Mon Mar 13 2017 Aurelien Bompard <abompard@fedoraproject.org> - 0.1.7-2
- Build for Python 3 in EPEL:
  https://fedoraproject.org/wiki/User:Bkabrda/EPEL7_Python3

* Tue Dec 13 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.7-1
- Update to 0.1.7

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

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

* Tue Jan 12 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.6-2
- Provide python-wcwidth for EL6

* Sat Jan 09 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.6-1
- Update to new upstream
- Remove external LICENSE thanks to the new version

* Wed Jan 06 2016 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.5-2
- Remove shabang from file that was not executable

* Tue Dec 29 2015 Fabio Alessandro Locati <fale@fedoraproject.org> - 0.1.5-1
- Initial package.