File python-ethtool.spec of Package python-ethtool

%define realname python-ethtool
%define srcext   tar.bz2

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

%if ! 0%{?py_ver:1}
%define py_ver %(python -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON-NOT-FOUND)

# Common info
Name:          python-ethtool
Version:       0.13
Release:       wiz%{?extraver:0.}1%{?dist}
License:       GPL-2.0
Group:         Development/Libraries/Python
Summary:       Python module to interface with ethtool

# Install-time parameters
Requires:      python(abi) = %{py_ver}

# Build-time parameters
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: pkgconfig(libnl-3.0)
BuildRequires: python-setuptools
BuildRoot:     %{_tmppath}/%{name}-root
Source:        %{realname}-%{version}%{?extraver}.%{srcext}

Python bindings for the ethtool kernel interface

The Python ethtool module allows querying and changing of ethernet card
settings, such as speed, port, autonegotiation, and PCI locations.

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{version}%{?extraver}

python build

python install --prefix=%{_prefix} --root=%{buildroot} -O2

[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}