7ed952
%bcond_without python3
7ed952
%global srcname idna
7ed952
7ed952
Name:           python-%{srcname}
7ed952
Version:        2.5
7ed952
Release:        7%{?dist}
7ed952
Summary:        Internationalized Domain Names in Applications (IDNA)
7ed952
7ed952
License:        BSD and Python and Unicode
7ed952
URL:            https://github.com/kjd/idna
7ed952
Source0:        https://pypi.io/packages/source/i/%{srcname}/%{srcname}-%{version}.tar.gz
7ed952
BuildArch:      noarch
7ed952
7ed952
BuildRequires:  python2-devel
7ed952
BuildRequires:  python2-setuptools
7ed952
%if %{with python3}
7ed952
BuildRequires:  python%{python3_pkgversion}-devel
7ed952
BuildRequires:  python%{python3_pkgversion}-setuptools
7ed952
%endif # with python3
7ed952
7ed952
%description
7ed952
A library to support the Internationalised Domain Names in Applications (IDNA)
7ed952
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>.  This
7ed952
version of the protocol is often referred to as "IDNA2008" and can produce
7ed952
different results from the earlier standard from 2003.
7ed952
7ed952
The library is also intended to act as a suitable drop-in replacement for the
7ed952
"encodings.idna" module that comes with the Python standard library but
7ed952
currently only supports the older 2003 specification.
7ed952
7ed952
%package -n python2-%{srcname}
7ed952
Summary:        Internationalized Domain Names in Applications (IDNA)
7ed952
%{?python_provide:%python_provide python2-%{srcname}}
7ed952
7ed952
%description -n python2-%{srcname}
7ed952
A library to support the Internationalised Domain Names in Applications (IDNA)
7ed952
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>.  This
7ed952
version of the protocol is often referred to as "IDNA2008" and can produce
7ed952
different results from the earlier standard from 2003.
7ed952
7ed952
The library is also intended to act as a suitable drop-in replacement for the
7ed952
"encodings.idna" module that comes with the Python standard library but
7ed952
currently only supports the older 2003 specification.
7ed952
7ed952
%if %{with python3}
7ed952
%package -n python%{python3_pkgversion}-%{srcname}
7ed952
Summary:        Internationalized Domain Names in Applications (IDNA)
7ed952
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
7ed952
7ed952
%description -n python%{python3_pkgversion}-%{srcname}
7ed952
A library to support the Internationalised Domain Names in Applications (IDNA)
7ed952
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>.  This
7ed952
version of the protocol is often referred to as "IDNA2008" and can produce
7ed952
different results from the earlier standard from 2003.
7ed952
7ed952
The library is also intended to act as a suitable drop-in replacement for the
7ed952
"encodings.idna" module that comes with the Python standard library but
7ed952
currently only supports the older 2003 specification.
7ed952
%endif # with python3
7ed952
7ed952
%prep
7ed952
%setup -q -n %{srcname}-%{version}
7ed952
# Remove bundled egg-info
7ed952
rm -rf %{srcname}.egg-info
7ed952
7ed952
%build
7ed952
%py2_build
7ed952
7ed952
%if %{with python3}
7ed952
%py3_build
7ed952
%endif # with python3
7ed952
7ed952
%install
7ed952
%if %{with python3}
7ed952
%py3_install
7ed952
%endif # with python3
7ed952
7ed952
%py2_install
7ed952
7ed952
%check
7ed952
%{__python2} setup.py test
7ed952
7ed952
%if %{with python3}
7ed952
%{__python3} setup.py test
7ed952
%endif # with python3
7ed952
7ed952
7ed952
%files -n python2-%{srcname}
7ed952
%license LICENSE.rst
7ed952
%doc README.rst HISTORY.rst
7ed952
%{python2_sitelib}/%{srcname}
7ed952
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
7ed952
7ed952
%if %{with python3}
7ed952
%files -n python%{python3_pkgversion}-%{srcname}
7ed952
%license LICENSE.rst
7ed952
%doc README.rst HISTORY.rst
7ed952
%{python3_sitelib}/%{srcname}
7ed952
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
7ed952
%endif # with python3
7ed952
7ed952
%changelog
7ed952
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 2.5-7
7ed952
- Bumping due to problems with modular RPM upgrade path
7ed952
- Resolves: rhbz#1695587
7ed952
7ed952
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 2.5-6
7ed952
- Switch python3 coditions to bcond
7ed952
7ed952
* Mon Jul 16 2018 Lumír Balhar <lbalhar@redhat.com> - 2.5-5
7ed952
- First version for python27 module