14
0
forked from pool/python-tld
Files
python-tld/python-tld.spec
Sebastian Wagner eee0e82ae7 - add remove-download-test.patch to remove download test requiring internet
- update to version 0.8:
 - This release contains backward incompatible changes. You should update
   your code.
   Old `get_tld` functionality remain is moved to `get_fld` (first-level
   domain definition). The `as_object` argument (False by default) has been
   deprecated for `get_fld`.
   Have a look at the packages' documentation and changelog for details and examples.
 - Move to a Trie to match TLDs. This brings a speed up of 15-20%.
 - It's now possible to search in public, private or all suffixes (old
   behaviour). Use `search_public` and `search_private` arguments accordingly.
   By default (to support old behavior), both are set to True.
 - Correct TLD definitions.
 - Domains like `*****.xn--fiqs8s` are now recognized as well.
 - Due to usage of `urlsplit` instead of `urlparse`, the initial list of TLDs
   is assembled quicker (a speed-up of 15-20%).
 - Docs/ directory is included in source distribution tarball.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tld?expand=0&rev=6
2018-07-07 08:33:43 +00:00

72 lines
2.3 KiB
RPMSpec

#
# spec file for package python-tld
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-tld
Version: 0.8
Release: 0
Summary: Extract the top level domain (TLD) from the URL given
License: MPL-1.1 OR GPL-2.0-only OR LGPL-2.1-only
Group: Development/Languages/Python
Url: https://github.com/barseghyanartur/tld
Source: https://files.pythonhosted.org/packages/source/t/tld/tld-%{version}.tar.gz
# PATCH-FIX-OPENSUSE remove-download-test.patch
Patch0: remove-download-test.patch
# PATCH-FIX-UPSTREAM fix-setup-test.patch -- based on https://github.com/barseghyanartur/tld/commit/f34261e913c15391e8f48f90938a5164b69537b9.patch
Patch1: fix-setup-test.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
# SECTION test requirements
BuildRequires: %{python_module six >= 1.9}
# /SECTION
BuildRequires: fdupes
Requires: python-six >= 1.9
BuildArch: noarch
%python_subpackages
%description
Extract the top level domain (TLD) from the URL given. List of TLD names is
taken from Mozillas public suffix list:
<https://publicsuffix.org/list/effective_tld_names.dat>
%prep
%setup -q -n tld-%{version}
sed -i '1s/^#!.*/#!\/usr\/bin\/python3/' src/tld/bin/update-tld-names
%patch0 -p1
%patch1 -p1
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_exec setup.py test
%files %{python_files}
%doc README.rst CHANGELOG.rst
%license LICENSE_GPL2.0.txt LICENSE_LGPL_2.1.txt
%python3_only %{_bindir}/update-tld-names
%{python_sitelib}/*
%changelog