2017-12-12 08:28:51 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-tld
|
|
|
|
#
|
2022-10-18 12:11:24 +00:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2017-12-12 08:28:51 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-12-04 14:10:10 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-04-07 19:19:39 +00:00
|
|
|
#
|
2017-12-12 08:28:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-12-24 10:27:37 +00:00
|
|
|
%define skip_python2 1
|
2017-12-12 08:28:51 +00:00
|
|
|
Name: python-tld
|
2021-06-21 06:20:22 +00:00
|
|
|
Version: 0.12.6
|
2017-12-12 08:28:51 +00:00
|
|
|
Release: 0
|
2019-01-24 07:17:16 +00:00
|
|
|
Summary: URL top level domain (TLD) extraction module
|
2021-05-19 07:42:21 +00:00
|
|
|
License: GPL-2.0-only OR MPL-1.1 OR LGPL-2.1-or-later
|
2017-12-12 08:28:51 +00:00
|
|
|
Group: Development/Languages/Python
|
2019-11-26 14:05:08 +00:00
|
|
|
URL: https://github.com/barseghyanartur/tld
|
2017-12-12 08:28:51 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/t/tld/tld-%{version}.tar.gz
|
2019-09-14 20:24:33 +00:00
|
|
|
# PATCH-FIX-OPENSUSE skip_internet_tests.patch
|
|
|
|
Patch0: skip_internet_tests.patch
|
2017-12-12 08:28:51 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2020-01-02 10:14:57 +00:00
|
|
|
BuildRequires: fdupes
|
2018-04-07 19:19:39 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-03-26 11:20:06 +00:00
|
|
|
Requires: python-setuptools
|
2020-05-18 13:02:02 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-05-19 07:42:21 +00:00
|
|
|
Requires(postun):update-alternatives
|
2020-01-02 10:14:57 +00:00
|
|
|
BuildArch: noarch
|
2017-12-12 08:28:51 +00:00
|
|
|
# SECTION test requirements
|
2019-04-07 11:35:20 +00:00
|
|
|
BuildRequires: %{python_module Faker}
|
|
|
|
BuildRequires: %{python_module factory_boy}
|
2020-01-02 10:14:57 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2017-12-12 08:28:51 +00:00
|
|
|
# /SECTION
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
2019-01-24 07:17:16 +00:00
|
|
|
This module extracts the top level domain (TLD) from the URL given.
|
|
|
|
A list of TLD names is taken from Mozillas public suffix list:
|
2018-07-07 08:33:43 +00:00
|
|
|
<https://publicsuffix.org/list/effective_tld_names.dat>
|
2017-12-12 08:28:51 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n tld-%{version}
|
2018-07-07 08:33:43 +00:00
|
|
|
%patch0 -p1
|
2019-12-24 10:27:37 +00:00
|
|
|
# https://github.com/barseghyanartur/tld/issues/75
|
2017-12-12 08:28:51 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
2020-05-18 13:02:02 +00:00
|
|
|
%python_clone -a %{buildroot}%{_bindir}/update-tld-names
|
2017-12-12 08:28:51 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%check
|
2020-01-02 10:14:57 +00:00
|
|
|
%pytest
|
2017-12-12 08:28:51 +00:00
|
|
|
|
2020-05-18 13:02:02 +00:00
|
|
|
%post
|
|
|
|
%python_install_alternative update-tld-names
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative update-tld-names
|
|
|
|
|
2017-12-12 08:28:51 +00:00
|
|
|
%files %{python_files}
|
2018-04-07 20:46:18 +00:00
|
|
|
%doc README.rst CHANGELOG.rst
|
2020-05-21 11:38:28 +00:00
|
|
|
%license LICENSE_GPL2.0.txt LICENSE_LGPL_2.1.txt LICENSE_MPL_1.1.txt
|
2020-05-18 13:02:02 +00:00
|
|
|
%python_alternative %{_bindir}/update-tld-names
|
2017-12-12 08:28:51 +00:00
|
|
|
%{python_sitelib}/*
|
|
|
|
|
|
|
|
%changelog
|