Blob Blame History Raw
%global pypi_name rfc3987

Name:		python-%{pypi_name}
Version:	1.3.7
Release:	6%{?dist}
Summary:	Parsing and validation of URIs (RFC 3986) and IRIs (RFC 3987)

License:	GPLv3+
URL:		https://github.com/dgerber/rfc3987
Source0:	https://files.pythonhosted.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:	noarch

%global _description \
This module provides regular expressions according to RFC 3986 "Uniform\
Resource Identifier (URI): Generic Syntax" <http://tools.ietf.org/html/rfc3986>\
and RFC 3987 "Internationalized Resource Identifiers (IRIs)"\
<http://tools.ietf.org/html/rfc3987>, and utilities for composition and\
relative resolution of references.

%description %{_description}

%package -n     python2-%{pypi_name}
Summary:	Parsing and validation of URIs (RFC 3986) and IRIs (RFC 3987)
%{?python_provide:%python_provide python2-%{pypi_name}}

BuildRequires:	python2-setuptools
BuildRequires:	python2-devel

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

%package -n     python3-%{pypi_name}
Summary:	Parsing and validation of URIs (RFC 3986) and IRIs (RFC 3987)
%{?python_provide:%python_provide python3-%{pypi_name}}

BuildRequires:	python3-setuptools
BuildRequires:	python3-devel

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

This package includes the Python 3 version of the module.

%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install

# Remove shebang
pushd %{buildroot}%{python2_sitelib}
sed -i -e '/^#!\//, 1d' rfc3987.py
popd

pushd %{buildroot}%{python3_sitelib}
sed -i -e '/^#!\//, 1d' rfc3987.py
popd

%check
%{__python2} -m doctest -v %{pypi_name}.py
%{__python3} -m doctest -v %{pypi_name}.py


%files -n python2-%{pypi_name}
%license COPYING.txt
%doc README.txt
%{python2_sitelib}/%{pypi_name}.py*
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%files -n python3-%{pypi_name}
%license COPYING.txt
%doc README.txt
%{python3_sitelib}/%{pypi_name}.py
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%{python3_sitelib}/__pycache__/%{pypi_name}.*


%changelog
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-6
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Jan 30 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.3.7-4
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Wed Apr 19 2017 Eduardo Mayorga Téllez <mayorga@fedoraproject.org> - 1.3.7-2
- Remove shebang from rfc3987.py

* Tue Apr 11 2017 Eduardo Mayorga Téllez <mayorga@fedoraproject.org> - 1.3.7-1
- Update to 1.3.7
- Include license text from tarball

* Wed Dec 21 2016 Eduardo Mayorga Téllez <mayorga@fedoraproject.org> - 1.3.6-2
- Call doctest in %%check

* Mon Jul 18 2016 Eduardo Mayorga Téllez <mayorga@fedoraproject.org> - 1.3.6-1
- Initial packaging