c72627
%global srcname idna
c72627
c72627
%if 0%{?fedora} || 0%{?rhel} >= 8
c72627
%bcond_without python3
c72627
%else
c72627
%bcond_with python3
c72627
%endif
c72627
c72627
%if 0%{?rhel} > 7
c72627
# Disable python2 build by default
c72627
%bcond_with python2
c72627
%else
c72627
%bcond_without python2
c72627
%endif
c72627
c72627
Name:           python-%{srcname}
c72627
Version:        2.5
c72627
Release:        5%{?dist}
c72627
Summary:        Internationalized Domain Names in Applications (IDNA)
c72627
c72627
License:        BSD and Python and Unicode
c72627
URL:            https://github.com/kjd/idna
c72627
Source0:        https://pypi.io/packages/source/i/%{srcname}/%{srcname}-%{version}.tar.gz
c72627
BuildArch:      noarch
c72627
c72627
%if 0%{?with_python2}
c72627
BuildRequires:  python2-devel
c72627
BuildRequires:  python2-setuptools
c72627
%endif # with_python2
c72627
%if 0%{?with_python3}
c72627
BuildRequires:  python%{python3_pkgversion}-devel
c72627
BuildRequires:  python%{python3_pkgversion}-setuptools
c72627
%endif # with_python3
c72627
c72627
%description
c72627
A library to support the Internationalised Domain Names in Applications (IDNA)
c72627
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>.  This
c72627
version of the protocol is often referred to as "IDNA2008" and can produce
c72627
different results from the earlier standard from 2003.
c72627
c72627
The library is also intended to act as a suitable drop-in replacement for the
c72627
"encodings.idna" module that comes with the Python standard library but
c72627
currently only supports the older 2003 specification.
c72627
c72627
%if 0%{?with_python2}
c72627
%package -n python2-%{srcname}
c72627
Summary:        Internationalized Domain Names in Applications (IDNA)
c72627
%{?python_provide:%python_provide python2-%{srcname}}
c72627
c72627
%description -n python2-%{srcname}
c72627
A library to support the Internationalised Domain Names in Applications (IDNA)
c72627
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>.  This
c72627
version of the protocol is often referred to as "IDNA2008" and can produce
c72627
different results from the earlier standard from 2003.
c72627
c72627
The library is also intended to act as a suitable drop-in replacement for the
c72627
"encodings.idna" module that comes with the Python standard library but
c72627
currently only supports the older 2003 specification.
c72627
%endif # with_python2
c72627
c72627
%if 0%{?with_python3}
c72627
%package -n python%{python3_pkgversion}-%{srcname}
c72627
Summary:        Internationalized Domain Names in Applications (IDNA)
c72627
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
c72627
c72627
%description -n python%{python3_pkgversion}-%{srcname}
c72627
A library to support the Internationalised Domain Names in Applications (IDNA)
c72627
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>.  This
c72627
version of the protocol is often referred to as "IDNA2008" and can produce
c72627
different results from the earlier standard from 2003.
c72627
c72627
The library is also intended to act as a suitable drop-in replacement for the
c72627
"encodings.idna" module that comes with the Python standard library but
c72627
currently only supports the older 2003 specification.
c72627
%endif # with_python3
c72627
c72627
%prep
c72627
%setup -q -n %{srcname}-%{version}
c72627
# Remove bundled egg-info
c72627
rm -rf %{srcname}.egg-info
c72627
c72627
%build
c72627
%if 0%{?with_python2}
c72627
%py2_build
c72627
%endif # with_python2
c72627
c72627
%if 0%{?with_python3}
c72627
%py3_build
c72627
%endif # with_python3
c72627
c72627
%install
c72627
%if 0%{?with_python3}
c72627
%py3_install
c72627
%endif # with_python3
c72627
c72627
%if 0%{?with_python2}
c72627
%py2_install
c72627
%endif # with_python2
c72627
c72627
%check
c72627
%if 0%{?with_python2}
c72627
%{__python2} setup.py test
c72627
%endif # with_python2
c72627
c72627
%if 0%{?with_python3}
c72627
%{__python3} setup.py test
c72627
%endif # with_python3
c72627
c72627
%if 0%{?with_python2}
c72627
%files -n python2-%{srcname}
c72627
%license LICENSE.rst
c72627
%doc README.rst HISTORY.rst
c72627
%{python2_sitelib}/%{srcname}
c72627
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
c72627
%endif # with_python2
c72627
c72627
%if 0%{?with_python3}
c72627
%files -n python%{python3_pkgversion}-%{srcname}
c72627
%license LICENSE.rst
c72627
%doc README.rst HISTORY.rst
c72627
%{python3_sitelib}/%{srcname}
c72627
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
c72627
%endif # with_python3
c72627
c72627
%changelog
c72627
* Thu Jun 28 2018 Christian Heimes <cheimes@redhat.com> - 2.5-5
c72627
- Drop Python 2 subpackage from RHEL 8, fixes RHBZ#1590399
c72627
c72627
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-4
c72627
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c72627
c72627
* Fri Jan 19 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.5-3
c72627
- Update Python 2 dependency declarations to new packaging standards
c72627
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
c72627
c72627
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-2
c72627
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c72627
c72627
* Tue Mar 07 2017 Jeremy Cline <jeremy@jcline.org> - 2.5-1
c72627
- Update to version 2.5
c72627
c72627
* Wed Mar 01 2017 Jeremy Cline <jeremy@jcline.org> - 2.4-1
c72627
- Update to version 2.4
c72627
c72627
* Tue Feb 28 2017 Paul Wouters <pwouters@redhat.com> - 2.3-1
c72627
- Resolves: rhbz#1427499 Update to 2.3 for IDNAError bugfix and memory improvement
c72627
c72627
* Thu Feb 09 2017 Jeremy Cline <jeremy@jcline.org> - 2.2-1
c72627
- Update to version 2.2 (#1406757)
c72627
c72627
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 2.1-3
c72627
- Rebuild for Python 3.6
c72627
c72627
* Mon Nov 28 2016 Orion Poplawski <orion@cora.nwra.com> - 2.1-2
c72627
- Ship python2-idna
c72627
- Enable python3 for EPEL
c72627
- Modernize spec
c72627
c72627
* Mon Oct 17 2016 tom.prince@ualberta.net - 2.1-1
c72627
- Bump version.
c72627
c72627
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4
c72627
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c72627
c72627
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-3
c72627
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c72627
c72627
* Wed Nov 04 2015 Robert Kuska <rkuska@redhat.com> - 2.0-2
c72627
- Rebuilt for Python3.5 rebuild
c72627
c72627
* Thu Aug 13 2015 Paul Wouters <pwouters@redhat.com> - 2.0-1
c72627
- Update to 2.0 which is required by python-cryptography
c72627
c72627
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-2
c72627
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c72627
c72627
* Wed Dec 31 2014 tom.prince@ualberta.net - 1.0-1
c72627
- Bump version.
c72627
c72627
* Mon Oct 27 2014 tom.prince@ualberta.net - 0.8-3
c72627
- Update licences.
c72627
c72627
* Sat Jul 12 2014 tom.prince@ualberta.net - 0.8-2
c72627
- Be more specfic about .egg-info directories.
c72627
- Use python2-devel
c72627
c72627
* Sat Jul 12 2014 tom.prince@ualberta.net - 0.8-1
c72627
- Initial package.