Ship python2-idna

- Enable python3 for EPEL
- Modernize spec
This commit is contained in:
Orion Poplawski 2016-12-04 14:00:36 -07:00
parent 172125993b
commit 3cba5e94dc

View File

@ -1,7 +1,4 @@
%if 0%{?fedora}
%global with_python3 1 %global with_python3 1
%endif
%global srcname idna %global srcname idna
Name: python-%{srcname} Name: python-%{srcname}
@ -17,8 +14,8 @@ BuildArch: noarch
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python-setuptools
%if 0%{?with_python3} %if 0%{?with_python3}
BuildRequires: python3-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python3-setuptools BuildRequires: python%{python3_pkgversion}-setuptools
%endif # with_python3 %endif # with_python3
%description %description
@ -31,11 +28,26 @@ The library is also intended to act as a suitable drop-in replacement for the
"encodings.idna" module that comes with the Python standard library but "encodings.idna" module that comes with the Python standard library but
currently only supports the older 2003 specification. currently only supports the older 2003 specification.
%if 0%{?with_python3} %package -n python2-%{srcname}
%package -n python3-%{srcname}
Summary: Internationalized Domain Names in Applications (IDNA) Summary: Internationalized Domain Names in Applications (IDNA)
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python3-%{srcname} %description -n python2-%{srcname}
A library to support the Internationalised Domain Names in Applications (IDNA)
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>. This
version of the protocol is often referred to as "IDNA2008" and can produce
different results from the earlier standard from 2003.
The library is also intended to act as a suitable drop-in replacement for the
"encodings.idna" module that comes with the Python standard library but
currently only supports the older 2003 specification.
%if 0%{?with_python3}
%package -n python%{python3_pkgversion}-%{srcname}
Summary: Internationalized Domain Names in Applications (IDNA)
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname}
A library to support the Internationalised Domain Names in Applications (IDNA) A library to support the Internationalised Domain Names in Applications (IDNA)
protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>. This protocol as specified in RFC 5891 <http://tools.ietf.org/html/rfc5891>. This
version of the protocol is often referred to as "IDNA2008" and can produce version of the protocol is often referred to as "IDNA2008" and can produce
@ -51,54 +63,48 @@ currently only supports the older 2003 specification.
# Remove bundled egg-info # Remove bundled egg-info
rm -rf %{srcname}.egg-info rm -rf %{srcname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif # with_python3
%build %build
%{__python2} setup.py build %py2_build
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_build
%{__python3} setup.py build
popd
%endif # with_python3 %endif # with_python3
%install %install
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir} %py3_install
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # with_python3 %endif # with_python3
%{__python2} setup.py install --skip-build --root %{buildroot} %py2_install
%check %check
%{__python2} setup.py test %{__python2} setup.py test
%if 0%{?with_python3} %if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test %{__python3} setup.py test
popd
%endif # with_python3 %endif # with_python3
%files %files -n python2-%{srcname}
%doc README.rst HISTORY.rst LICENSE.rst %license LICENSE.rst
%doc README.rst HISTORY.rst
%{python2_sitelib}/%{srcname} %{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info %{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
%if 0%{?with_python3} %if 0%{?with_python3}
%files -n python3-%{srcname} %files -n python%{python3_pkgversion}-%{srcname}
%doc README.rst HISTORY.rst LICENSE.rst %license LICENSE.rst
%doc README.rst HISTORY.rst
%{python3_sitelib}/%{srcname} %{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
%endif # with_python3 %endif # with_python3
%changelog %changelog
* Mon Nov 28 2016 Orion Poplawski <orion@cora.nwra.com> - 2.1-2
- Ship python2-idna
- Enable python3 for EPEL
- Modernize spec
* Mon Oct 17 2016 tom.prince@ualberta.net - 2.1-1 * Mon Oct 17 2016 tom.prince@ualberta.net - 2.1-1
- Bump version. - Bump version.