app=iproute2
version=4.20.0
build=1sml
homepage="https://wiki.linuxfoundation.org/networking/iproute2"
download="https://mirrors.edge.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.20.0.tar.xz"
desc="Advanced IP routing utilities for the linux kernel"
requires="musl"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  applypatch $srcdir/fix-install-errors.patch
  applypatch $srcdir/musl-fixes.patch

  ./configure \
    --prefix="" \
    --sysconfdir=/etc \

  make
  make install DESTDIR=$pkg PREFIX="" SBINDIR="/bin" MANDIR="/share/man" LIBDIR="/lib" KERNEL_INCLUDE="/include"

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
0de26018541004f9386ce454a684fb3c18248f477a8bd41f27788b2a3834bfbbec84ea09e0af884099ac2b09444bf0c46743e8f4d2f7eaa0902da8bee5e87db4  iproute2-4.20.0.tar.lz
24fc2a901650e11f80bcaa82c839e70c21aafdf3c5b8a357d932d066a0b98ae2ec8379fc17a0a16a1b5b4fa5edc131179c10fc02e55d6101701df5a09966912c  fix-install-errors.patch
2e3558caddf814da8c4d78c74eddb7a659d6f94b93de5396bdd995e2333e3cd656f9c936ac7a5a86d0477abc27a92550582575ab4ed19fc2ec0d9b6699cd612c  musl-fixes.patch
"
