# # spec file for package python-netifaces2 # # Copyright (c) 2024 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/ # %define skip_python311 1 %define skip_python312 1 %define orig_name netifaces %define short_name netifaces2 Name: python-netifaces2 Version: 0.0.22 Release: 0 Summary: Reborn version of original/archived netifaces License: MIT URL: https://github.com/SamuelYvon/netifaces-2 Source0 https://files.pythonhosted.org/packages/source/n/netifaces2/netifaces2-%{version}.tar.gz Source1: vendor.tar.zst BuildRequires: python-rpm-macros BuildRequires: %{python_module maturin} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: cargo BuildRequires: cargo-packaging BuildRequires: meson BuildRequires: rust BuildRequires: fdupes Conflicts: python3-netifaces %python_subpackages %description 1. What is this? The original netifaces was abandoned by it's maintainer, leaving us without the option to get network addresses of any kind in Python. Unfortunately, the original sources are more akin to arcane magic, so picking where it's been left off is a difficult task. I decided to rewrite netifaces, keeping the almost exact same API and adding the following: * Support for future python versions * Type annotations * Maybe a more "queryable" API in the future This project aims to be a drop-in replacement for those project who use netifaces, but I do not guarantee anything. 1.1 What is not working right-now * The gateways API is only working if your system has a /proc/net/route file or the ip tool * The windows gateways API is non-functional %prep %autosetup -a1 -n %{short_name}-%{version} #find . -type f -exec sed -i 's@#!%%{_bindir}/env python$@#!%%{_bindir}/python@' {} + #find . -type f -exec sed -i 's@#!%%{_bindir}/env python3$@#!%%{_bindir}/python3@' {} + %build %pyproject_wheel %install %pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %files %{python_files} %{python_sitearch}/%{orig_name} %dir %{python_sitearch}/%{short_name}-%{version}.dist-info %{python_sitearch}/%{short_name}-%{version}.dist-info/* %changelog