Sync from SUSE:SLFO:Main python-netifaces revision d14a49466136146b9540816bc298822f

This commit is contained in:
Adrian Schröter 2024-05-03 21:38:14 +02:00
commit a64905d469
5 changed files with 274 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

BIN
netifaces-0.11.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

129
python-netifaces.changes Normal file
View File

@ -0,0 +1,129 @@
-------------------------------------------------------------------
Fri Apr 21 12:28:27 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add sle15_python_module_pythons (jsc#PED-68)
-------------------------------------------------------------------
Thu Apr 13 22:42:42 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Make calling of %{sle15modernpython} optional.
-------------------------------------------------------------------
Sat Jul 17 06:40:25 UTC 2021 - Dirk Müller <dmueller@suse.com>
- 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 <bits/sockaddr.h>, 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

69
python-netifaces.spec Normal file
View File

@ -0,0 +1,69 @@
#
# spec file for package python-netifaces
#
# Copyright (c) 2023 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{?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://pypi.io/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 setuptools}
BuildRequires: python-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%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
%python_build
%install
%python_install
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python test.py | grep 'Interface lo'
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitearch}/*
%changelog

50
test.py Normal file
View File

@ -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))