File python-pyasn.spec of Package python-pyasn
#
# spec file for package python-pyasn
#
# Copyright (c) 2025 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/
#
Name: python-pyasn
Version: 1.6.2
Release: 0
Summary: Offline IP address to Autonomous System Number lookup module
License: MIT
URL: https://github.com/hadiasghari/pyasn
Source: https://files.pythonhosted.org/packages/source/p/pyasn/pyasn-%{version}.tar.gz
# https://github.com/hadiasghari/pyasn/commit/4aa80e9a169713b45a7420f926ccca828a493e70
Patch0: us-Update-get_as_size.patch
# https://github.com/hadiasghari/pyasn/pull/81
Patch1: fix-regex-import-warning.patch
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: %{python_module pytest}
BuildRequires: fdupes
BuildRequires: gcc
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: pyasn-data
Recommends: python-ujson
%python_subpackages
%description
Offline IP address to Autonomous System Number lookup module.
%prep
%autosetup -p1 -n pyasn-%{version}
%build
export CFLAGS="%{optflags}"
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/pyasn_util_asnames.py
%python_clone -a %{buildroot}%{_bindir}/pyasn_util_convert.py
%python_clone -a %{buildroot}%{_bindir}/pyasn_util_download.py
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
%pytest_arch
%pre
%python_libalternatives_reset_alternative pyasn_util_asnames.py
%post
%python_install_alternative pyasn_util_asnames.py pyasn_util_convert.py pyasn_util_download.py
%postun
%python_uninstall_alternative pyasn_util_asnames.py
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/pyasn_util_asnames.py
%python_alternative %{_bindir}/pyasn_util_convert.py
%python_alternative %{_bindir}/pyasn_util_download.py
%{python_sitearch}/pyasn
%{python_sitearch}/pyasn-%{version}.dist-info
%changelog