Files
python-ethtool/python-ethtool.spec
Jan Matejek 933f47c469 Accepting request 538130 from home:mcalmer:branches:devel:languages:python
- provide tools for python3 only again

- use update_alternatives for different python versions

- update to version 0.13 for python3 support
- fix build for python2 and python3
- drop obsolete patch python-ethtool.patch

OBS-URL: https://build.opensuse.org/request/show/538130
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ethtool?expand=0&rev=8
2017-11-01 16:12:20 +00:00

67 lines
2.1 KiB
RPMSpec

#
# spec file for package python
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%global pypi_name ethtool
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-%{pypi_name}
Version: 0.13
Release: 0
Summary: Ethernet settings Python bindings
License: GPL-2.0
Group: Development/Languages/Python
Url: https://github.com/fedora-python/%{name}
Source: https://files.pythonhosted.org/packages/source/e/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: libnl3-devel
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%python_subpackages
%description
Python bindings for the ethtool kernel interface that allows querying and
changing of Ethernet interface settings, such as speed, port, autonegotiation, and
PCI locations.
%prep
%setup -q -n %{pypi_name}-%{version}
%build
export LANG=C.UTF-8
export CFLAGS="%{optflags}"
%python_build
%install
export LANG=C.UTF-8
%python_install
mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_mandir}/man8
mv %{buildroot}{%{_bindir},%{_sbindir}}/pifconfig
mv %{buildroot}{%{_bindir},%{_sbindir}}/pethtool
%files %{python_files}
%defattr(-,root,root)
%doc README.rst CHANGES.rst COPYING
%{python_sitearch}/
%python3_only %{_sbindir}/pethtool
%python3_only %{_sbindir}/pifconfig
%changelog