2019-09-09 07:18:56 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-getmac
|
|
|
|
|
#
|
2022-09-29 09:37:03 +00:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2019-09-09 07:18:56 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2019-09-10 07:32:11 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
|
#
|
2019-09-09 07:18:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
%define skip_python2 1
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
|
|
|
Name: python-getmac
|
2022-09-29 09:37:03 +00:00
|
|
|
Version: 0.8.3
|
2019-09-09 07:18:56 +00:00
|
|
|
Release: 0
|
2019-09-10 07:32:11 +00:00
|
|
|
Summary: Module to get MAC addresses of remote hosts and local interfaces
|
2019-09-09 07:18:56 +00:00
|
|
|
License: MIT
|
|
|
|
|
Group: Development/Languages/Python
|
2020-04-06 17:30:23 +00:00
|
|
|
URL: https://github.com/GhostofGoes/getmac
|
2019-09-09 07:18:56 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/g/getmac/getmac-%{version}.tar.gz
|
2021-04-17 08:37:51 +00:00
|
|
|
# PATCH-FIX-OPENSUSE
|
|
|
|
|
Patch0: fix-failing-darwin-test.patch
|
|
|
|
|
# PATCH-FIX-UPSTREAM
|
|
|
|
|
Patch1: support-python3.9.patch
|
2019-09-09 07:18:56 +00:00
|
|
|
BuildRequires: %{python_module pytest-benchmark}
|
2019-09-10 07:32:11 +00:00
|
|
|
BuildRequires: %{python_module pytest-mock}
|
|
|
|
|
BuildRequires: %{python_module pytest}
|
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-09-09 07:18:56 +00:00
|
|
|
BuildRequires: fdupes
|
2019-09-10 07:32:11 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2020-05-27 10:07:50 +00:00
|
|
|
Requires(post): update-alternatives
|
2021-04-17 08:37:51 +00:00
|
|
|
Requires(postun):update-alternatives
|
2019-09-09 07:18:56 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
2019-09-10 07:32:11 +00:00
|
|
|
A Python module to get MAC addresses of remote hosts and local interfaces.
|
2019-09-09 07:18:56 +00:00
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n getmac-%{version}
|
2021-04-17 08:37:51 +00:00
|
|
|
%patch0 -p1
|
|
|
|
|
%patch1 -p1
|
2019-09-09 07:18:56 +00:00
|
|
|
sed -i "1,4{/\/usr\/bin\/env/d}" getmac/__main__.py
|
2020-04-16 13:18:30 +00:00
|
|
|
rm -r *egg-info
|
|
|
|
|
find . -type f -exec chmod -x {} \;
|
2019-09-09 07:18:56 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%python_install
|
2020-05-27 10:07:50 +00:00
|
|
|
%python_clone -a %{buildroot}%{_mandir}/man1/getmac.1
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/getmac
|
2019-09-09 07:18:56 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
export LANG=C.UTF-8
|
2020-04-16 13:24:00 +00:00
|
|
|
# test_cli_main fails in OBS not local run
|
2020-04-16 13:33:46 +00:00
|
|
|
# test_cli_multiple_debug_levels same as above
|
|
|
|
|
%pytest tests -k 'not test_get_default_iface_freebsd and not test_cli_main and not test_cli_multiple_debug_levels'
|
2019-09-09 07:18:56 +00:00
|
|
|
|
2020-05-27 10:07:50 +00:00
|
|
|
%post
|
|
|
|
|
%python_install_alternative getmac getmac.1
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative getmac
|
|
|
|
|
|
2019-09-09 07:18:56 +00:00
|
|
|
%files %{python_files}
|
|
|
|
|
%doc CHANGELOG.md README.md
|
|
|
|
|
%license LICENSE
|
2020-05-27 10:07:50 +00:00
|
|
|
%python_alternative %{_bindir}/getmac
|
|
|
|
|
%python_alternative %{_mandir}/man1/getmac.1%{?ext_man}
|
2019-09-09 07:18:56 +00:00
|
|
|
%{python_sitelib}/getmac*
|
|
|
|
|
|
|
|
|
|
%changelog
|