From 20978d0ce9d91bc0dc774ca9361f31e14419130dea80272cb7afbd6690eafa5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 2 Jun 2025 14:40:11 +0000 Subject: [PATCH 1/4] - Convert to pip-based build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netifaces?expand=0&rev=28 --- .gitattributes | 23 +++++++ .gitignore | 1 + netifaces-0.11.0.tar.gz | 3 + python-netifaces.changes | 134 +++++++++++++++++++++++++++++++++++++++ python-netifaces.spec | 69 ++++++++++++++++++++ test.py | 50 +++++++++++++++ 6 files changed, 280 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 netifaces-0.11.0.tar.gz create mode 100644 python-netifaces.changes create mode 100644 python-netifaces.spec create mode 100644 test.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/netifaces-0.11.0.tar.gz b/netifaces-0.11.0.tar.gz new file mode 100644 index 0000000..11dbee0 --- /dev/null +++ b/netifaces-0.11.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:043a79146eb2907edf439899f262b3dfe41717d34124298ed281139a8b93ca32 +size 30106 diff --git a/python-netifaces.changes b/python-netifaces.changes new file mode 100644 index 0000000..561087e --- /dev/null +++ b/python-netifaces.changes @@ -0,0 +1,134 @@ +------------------------------------------------------------------- +Mon Jun 2 14:39:57 UTC 2025 - Markéta Machová + +- Convert to pip-based build + +------------------------------------------------------------------- +Fri Apr 21 12:28:27 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:42:42 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Sat Jul 17 06:40:25 UTC 2021 - Dirk Müller + +- update to 0.11.0: + * Fixing netmask calculation for IPv6 + * segfault when trying to access netifaces.ifaddresses + * Interpret missing gateway priority, handle some out of order metrics + +------------------------------------------------------------------- +Fri May 24 11:00:13 UTC 2019 - pgajdos@suse.com + +- version update to 0.10.9 + * Fixed a bug that in certain circumstances could lead to an infinite + loop in netifaces.gateways() (thanks asomers). + * Fixed a memory management bug in an error path (thanks NicoPy). +- created a small test + +------------------------------------------------------------------- +Mon Sep 10 11:00:01 UTC 2018 - dmueller@suse.com + +- update to 0.10.7: + * move to github + +------------------------------------------------------------------- +Fri Jul 7 23:04:50 UTC 2017 - antoine.belvire@opensuse.org + +- Update to version 0.10.6: + * All addresses are now unicode strings on all platforms, + regardless of Python version. + +------------------------------------------------------------------- +Fri Mar 31 17:31:37 UTC 2017 - antoine.belvire@opensuse.org + +- Use pypi.io as source url. + +------------------------------------------------------------------- +Sat Mar 18 19:50:34 UTC 2017 - antoine.belvire@opensuse.org + +- Update to version 0.10.5: + * Fix setup.py in case there's no print + * Fix a potential one-byte stack overwrite + * Fix possible null pointer deference + * Respect interface priorities when determining default gateway + * Use CIDR notation for IPv6 netmasks + * Ignore broadcast addresses in the 169.254.0.0/16 range +- Convert package to python singlespec. + +------------------------------------------------------------------- +Sat May 24 09:42:16 UTC 2014 - tchvatal@suse.com + +- Version bump to 0.10.4: + * Various small fixes +- Fix source download url +- Fix homepage + +------------------------------------------------------------------- +Mon May 12 19:16:49 UTC 2014 - hpj@urpla.net + +- Update to version 0.10.3: + - Version 0.10.3 + + When using Netlink (i.e. Linux), check for the constant + NLM_F_DUMP_INTR, since it only appeared in kernel version 3.1 + + - Version 0.10.2 + + Added a workaround for broken netlink headers on certain Linux + distributions (the problem being that the netlink headers fail to + include , which causes a build failure). + + - Version 0.10.1 + + Fixed a problem with the gateways() function that caused it a + crash on PyPy. + + The CI system is now set up to build for PyPy as well, so + problems will be found sooner. + + - Version 0.10.0 + + Python 3 compatibility. + + Improved Windows source code compatibility. + + Added gateway detection via gateways() function. + + New version number format (skipped 0.9.0 due to its use by + the netifaces-merged fork). + +------------------------------------------------------------------- +Thu Oct 24 11:09:09 UTC 2013 - speilicke@suse.com + +- Require python-setuptools instead of distribute (upstreams merged) + +------------------------------------------------------------------- +Mon Jun 25 15:17:42 UTC 2012 - saschpe@suse.de + +- Update to version 0.8: + + Fixed bit-rot in the ioctl() code path. + + Fixed a problem with setup.py that might manifest itself if the + config.cache file was manually edited. + + Fixed the ioctl() code path to cope with systems that have sa_len and + return longer than normal struct ifreq results from SIOCG[L]IFCONF; + +------------------------------------------------------------------- +Fri Jun 15 08:55:18 UTC 2012 - saschpe@suse.de + +- Update to version 0.6: + + Added a workaround for a FreeBSD kernel bug (kern/152036). + + Added address_families dictionary to allow code to look up the symbolic + name corresponding to a given numeric address family code. + +------------------------------------------------------------------- +Mon Jun 11 12:37:51 UTC 2012 - saschpe@suse.de + +- Spec header cleanup + +------------------------------------------------------------------- +Tue Nov 29 09:21:30 UTC 2011 - saschpe@suse.de + +- Minor cleanup + +------------------------------------------------------------------- +Thu Jan 27 12:37:48 UTC 2011 - rschweikert@novell.com + +- Initial build to meet swift dependency requirement + diff --git a/python-netifaces.spec b/python-netifaces.spec new file mode 100644 index 0000000..5debccd --- /dev/null +++ b/python-netifaces.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-netifaces +# +# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2011 Novell +# +# 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-netifaces +Version: 0.11.0 +Release: 0 +Summary: Portable network interface information +License: MIT +Group: Development/Languages/Python +URL: https://github.com/al45tair/netifaces +Source0: https://files.pythonhosted.org/packages/source/n/netifaces/netifaces-%{version}.tar.gz +Source2: https://raw.githubusercontent.com/al45tair/netifaces/master/test.py +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: python-rpm-macros +%python_subpackages + +%description +netifaces provides a (hopefully portable-ish) way for Python programmers to +get access to a list of the network interfaces on the local machine, and to +obtain the addresses of those network interfaces. + +The package has been tested on Mac OS X, Windows XP, Windows Vista, Linux and +Solaris. On Windows, it is currently not able to retrieve IPv6 addresses, +owing to shortcomings of the Windows API. + +It should work on other UNIX-like systems provided they implement either +getifaddrs() or support the SIOCGIFxxx socket options, although the data +provided by the socket options is normally less complete. + +%prep +%setup -q -n netifaces-%{version} +cp %{SOURCE2} . + +%build +%pyproject_wheel + +%install +%pyproject_install + +%check +%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python test.py | grep 'Interface lo' + +%files %{python_files} +%license LICENSE +%doc README.rst +%{python_sitearch}/netifaces +%{python_sitearch}/netifaces-%{version}*-info + +%changelog diff --git a/test.py b/test.py new file mode 100644 index 0000000..020d70f --- /dev/null +++ b/test.py @@ -0,0 +1,50 @@ +import netifaces + +print('Found interfaces:') +for iface in netifaces.interfaces(): + print(' %s' % iface) + +print('') + +for iface in netifaces.interfaces(): + allAddrs = netifaces.ifaddresses(iface) + + print('Interface %s:' % iface) + + for family in allAddrs: + addrs = allAddrs[family] + fam_name = netifaces.address_families[family] + print(' Address family: %s' % fam_name) + for addr in addrs: + print(' Address : %s' % addr['addr']) + nmask = addr.get('netmask', None) + if nmask: + print(' Netmask : %s' % nmask) + bcast = addr.get('broadcast', None) + if bcast: + print(' Broadcast: %s' % bcast) + + print('') + +print('Found gateways:') +gateway_info = netifaces.gateways() +for family in gateway_info: + if family == 'default': + continue + + fam_name = netifaces.address_families[family] + print(' Family: %s' % fam_name) + for gateway,interface,default in gateway_info[family]: + if default: + def_text = ', default' + else: + def_text = '' + print(' %s (via %s%s)' % (gateway, interface, def_text)) + print('') + +print('Default gateways:') +default_gateways = gateway_info['default'] +for family in default_gateways: + fam_name = netifaces.address_families[family] + gateway, interface = default_gateways[family] + print(' %s: %s (via %s)' % (fam_name, gateway, interface)) From 64c0c980e284381a399d31892ebe8294c5bcb7568203e98f916ce6bd87e83079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 3 Jun 2025 13:00:08 +0000 Subject: [PATCH 2/4] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netifaces?expand=0&rev=29 --- python-netifaces.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-netifaces.spec b/python-netifaces.spec index 5debccd..fa5e253 100644 --- a/python-netifaces.spec +++ b/python-netifaces.spec @@ -63,7 +63,7 @@ cp %{SOURCE2} . %files %{python_files} %license LICENSE %doc README.rst -%{python_sitearch}/netifaces +#%%{python_sitearch}/netifaces %{python_sitearch}/netifaces-%{version}*-info %changelog From 13b2204142bb3279d2749e7fb3c86bf105e51f1ec5ce9226817ea148aedda892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 3 Jun 2025 13:09:20 +0000 Subject: [PATCH 3/4] fix files OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netifaces?expand=0&rev=30 --- python-netifaces.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python-netifaces.spec b/python-netifaces.spec index fa5e253..eaee277 100644 --- a/python-netifaces.spec +++ b/python-netifaces.spec @@ -63,7 +63,8 @@ cp %{SOURCE2} . %files %{python_files} %license LICENSE %doc README.rst -#%%{python_sitearch}/netifaces +%{python_sitearch}/netifaces.cpython* %{python_sitearch}/netifaces-%{version}*-info +%pycache_only %{python_sitearch}/__pycache__/netifaces.cpython* %changelog From e8f7c67f7ac1e23440df05a4d42ec9b834b498237c6d0019a3bb618bdce80159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 3 Jun 2025 13:26:02 +0000 Subject: [PATCH 4/4] sorry OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-netifaces?expand=0&rev=31 --- python-netifaces.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-netifaces.spec b/python-netifaces.spec index eaee277..407301d 100644 --- a/python-netifaces.spec +++ b/python-netifaces.spec @@ -65,6 +65,5 @@ cp %{SOURCE2} . %doc README.rst %{python_sitearch}/netifaces.cpython* %{python_sitearch}/netifaces-%{version}*-info -%pycache_only %{python_sitearch}/__pycache__/netifaces.cpython* %changelog