# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: Paul Mattal <paul@archlinux.org>
# Contributor: Martin Kemp <mdkemp@elys.com>

pkgname=ethtool
epoch=1
pkgver=6.19
pkgrel=1
pkgdesc="Utility for controlling network drivers and hardware"
arch=('x86_64')
url="https://www.kernel.org/pub/software/network/ethtool/"
license=('GPL')
depends=('glibc' 'libmnl')
makedepends=('git')
source=("git+https://git.kernel.org/pub/scm/network/ethtool/ethtool.git#tag=v${pkgver}")
sha256sums=('ffa70ad03a5f5790853d97acb2e2358e6de7b7c1e64d06695615fa865ba84a32')
validpgpkeys=(CE4A4D080F0D304F23B9EBDD972D5BF4DC613806  # John W. Linville <linville@kernel.org>
              D2CB120AB45957B721CD9596F4554567B91DE934) # Michal Kubecek <mkubecek@suse.cz>

prepare() {
  cd "${pkgname}"
  autoreconf -fi
}

build() {
  cd "${pkgname}"
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --sbindir=/usr/bin
  make
}

check() {
  cd "${pkgname}"
  make check
}

package() {
  cd "${pkgname}"
  make DESTDIR="${pkgdir}" install
}
