forked from pool/python-getmac
* Support BusyBox's ``arping``
* Improve how ARP is handled. If ``ArpFile`` method succeeds, use it
instead of ``ArpingHost``
* Speed up the first call to ``ArpingHost``
* Fix FORCE_METHOD not being respected for IPv4 macs
* Fix `ArpFile` method being used for IPv6
* Deprecate Python 3.6 support
* This release is a *complete rewrite of getmac from the ground up*. The
public API of `getmac` is **unchanged** as part of this rewrite.
* Fully support Python 3.9
* Tentatively support Python 3.10 and 3.11
* `arping` (POSIX) or `SendARP` (Windows) will now *always* be used instead
of sending a UDP packet when looking for the MAC of a IPv4 host, if
they're available and operable (otherwise, UDP + ARP table check will be
used like before).
* Added ability to override the detected platform via `--override-platform`
argument (CLI) or `getmac.getmac.OVERRIDE_PLATFORM` variable (Python).
This will force methods for that platform to be used, regardless of the
actual platform.
* Overhauled `ifconfig` parsing. It should now be far more reliable and
accurate across all platforms.
* Fixed bug with `/proc/net/route` parsing
* Removed man pages from distribution (`getmac.1`/`getmac2.1`). They were
severely out of date and unused.
- Drop patches fix-failing-darwin-test.patch and support-python3.9.patch
- Add patch cope-with-no-ip6.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-getmac?expand=0&rev=16
78 lines
2.3 KiB
RPMSpec
78 lines
2.3 KiB
RPMSpec
#
|
|
# spec file for package python-getmac
|
|
#
|
|
# 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/
|
|
#
|
|
|
|
|
|
Name: python-getmac
|
|
Version: 0.9.4
|
|
Release: 0
|
|
Summary: Module to get MAC addresses of remote hosts and local interfaces
|
|
License: MIT
|
|
URL: https://github.com/GhostofGoes/getmac
|
|
Source: https://files.pythonhosted.org/packages/source/g/getmac/getmac-%{version}.tar.gz
|
|
# PATCH-FIX-OPENSUSE
|
|
Patch0: cope-with-no-ip6.patch
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module pytest-benchmark}
|
|
BuildRequires: %{python_module pytest-mock}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: %{python_module wheel}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
Requires(post): update-alternatives
|
|
Requires(postun): update-alternatives
|
|
BuildArch: noarch
|
|
%python_subpackages
|
|
|
|
%description
|
|
A Python module to get MAC addresses of remote hosts and local interfaces.
|
|
|
|
%prep
|
|
%autosetup -p1 -n getmac-%{version}
|
|
sed -i "1,4{/\/usr\/bin\/env/d}" getmac/__main__.py
|
|
rm -r *egg-info
|
|
find . -type f -exec chmod -x {} \;
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_clone -a %{buildroot}%{_bindir}/getmac
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
export LANG=C.UTF-8
|
|
# test_cli_main fails in OBS not local run
|
|
# test_cli_multiple_debug_levels same as above
|
|
%pytest tests -k 'not test_cli_main and not test_cli_multiple_debug_levels'
|
|
|
|
%post
|
|
%python_install_alternative getmac
|
|
|
|
%postun
|
|
%python_uninstall_alternative getmac
|
|
|
|
%files %{python_files}
|
|
%doc CHANGELOG.md README.md
|
|
%license LICENSE
|
|
%python_alternative %{_bindir}/getmac
|
|
%{python_sitelib}/getmac
|
|
%{python_sitelib}/getmac-%{version}.dist-info
|
|
|
|
%changelog
|