Project not found: openSUSE:Factory:Staging:adi:57

File python-google-i18n-address.spec of Package python-google-i18n-address

#
# spec file for package python-google-i18n-address
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#

%{?sle15_python_module_pythons}
Name:           python-google-i18n-address
Version:        3.1.1
Release:        0
License:        BSD-3-Clause-Clear
Summary:        Address validation helpers for Google's i18n address database
Url:            https://github.com/mirumee/google-i18n-address
Group:          Development/Languages/Python
Source:         https://files.pythonhosted.org/packages/source/g/google-i18n-address/google_i18n_address-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module hatchling}
BuildRequires:  fdupes
Requires:       python-requests >= 2.7.0
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch:      noarch

%python_subpackages

%description
This package contains a copy of `Google's i18n
address <https://chromium-i18n.appspot.com/ssl-address>`_ metadata repository
that contains great data but comes with no uptime guarantees.

Contents of this package will allow you to programatically build address
forms that adhere to rules of a particular region or country, validate
local addresses and format them to produce a valid address label for
delivery.

%prep
%autosetup -p1 -n google_i18n_address-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/update-validation-files
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%pre
# delete command if the old package was not update-alternatives controlled
[ -h %{_bindir}/update-validation-files ] || rm -f %{_bindir}/update-validation-files

%post
%python_install_alternative update-validation-files

%postun
%python_uninstall_alternative update-validation-files

%files %{python_files}
%license LICENSE
%python_alternative update-validation-files
%{python_sitelib}/google_i18n_address-%{version}*-info

%changelog
openSUSE Build Service is sponsored by