Blob Blame Raw
%global srcname publicsuffix

# Tests require network access. Package maintainer is encouraged to run them
# locally before submitting to Koji.
%global with_tests 0

Name:           python-%{srcname}
Version:        1.1.0
Release:        11%{?dist}
Summary:        Get a public suffix for a domain name using the Public Suffix List.

License:        MIT and MPLv2.0
URL:            https://pypi.python.org/pypi/publicsuffix/
Source0:        https://pypi.io/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%if 0%{?fedora}
BuildRequires:  publicsuffix-list
Requires: publicsuffix-list
%endif

%description
This module allows you to get the public suffix of a domain name using the Public Suffix List from http://publicsuffix.org

A public suffix is one under which Internet users can directly register names. Some examples of public suffixes are .com, .co.uk and pvt.k12.wy.us. Accurately knowing the public suffix of a domain is useful when handling web browser cookies, highlighting the most important part of a domain name in a user interface or sorting URLs by web site.

It’s up the user to provide this module with an appropriate version of the Public Suffix List. A convenience function is provided that downloads the most recent version available on http://publicsuffix.org


%package -n python3-%{srcname}
%if 0%{?fedora}
BuildRequires:  publicsuffix-list
Requires: publicsuffix-list
%endif
Summary: Get a public suffix for a domain name using the Public Suffix List.
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
This module allows you to get the public suffix of a domain name using the Public Suffix Listfrom http://publicsuffix.org

A public suffix is one under which Internet users can directly register names. Some examples of public suffixes are .com, .co.uk and pvt.k12.wy.us. Accurately knowing the public suffix ofa domain is useful when handling web browser cookies, highlighting the most important part ofa domain name in a user interface or sorting URLs by web site.

It’s up the user to provide this module with an appropriate version of the Public Suffix List. A convenience function is provided that downloads the most recent version available on http://publicsuffix.org


%prep
%autosetup -n %{srcname}-%{version}

rm -rf %{srcname}.egg-info

%build
%{py3_build}


%install
%{py3_install}

%if 0%{?fedora}
# Symlink the suffix list to the latest version provided by the
# publicsuffix-list package. Users of this package can always fetch()
# the latest version, but we want to make sure that if they're running
# in offline mode, they have the latest available from Fedora packages.
ln -sf %{_datadir}/publicsuffix/public_suffix_list.dat \
       $RPM_BUILD_ROOT/%{python3_sitelib}/%{srcname}/public_suffix_list.dat
%endif


%if %{with_tests}
%check
%{__python3} setup.py test
%endif


%files -n python3-%{srcname}
%license LICENSE
%doc ChangeLog MANIFEST.in PKG-INFO README.rst
# For noarch packages: sitelib
%{python3_sitelib}/%{srcname}/
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/


%changelog
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-11
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-10
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Sep 13 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-7
- Removed python2 subpackage (#1628689)

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-5
- Rebuilt for Python 3.7

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

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

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Dec  8 2016 Stephen Gallagher <sgallagh@redhat.com> - 1.1.0-1
- Initial release - 1.1.0