# Maintainer:

pkgname=findutils
pkgver=4.9.0
pkgrel=3.1
pkgdesc="GNU utilities to locate files"
license=('GPL3')
ncxfab_makedepends=('base-devel' 'sh' 'make' 'coreutils' 'crosspacman')
ncxfat_makedepends=('binutils' 'glibc' 'gcc')
url='https://www.gnu.org/software/findutils/'
source=("https://ftp.gnu.org/pub/gnu/findutils/findutils-${pkgver}.tar.xz"{,.sig})
sha256sums=('a2bfb8c09d436770edc59f50fa483e785b161a3b7b9d547573cb08065fd462fe'
            'SKIP')
validpgpkeys=('A5189DB69C1164D33002936646502EF796917195') # Bernhard Voelker <mail@bernhard-voelker.de>

build() {
  cd findutils-${pkgver}

  # Don't build or install locate because we use mlocate,
  # which is a secure version of locate.
  sed -e '/^SUBDIRS/s/locate//' -e 's/frcode locate updatedb//' -i Makefile.in

  ./configure --prefix=$MPKG_USRPATH --host=$MPKG_TARGETMACHINE
  # don't build locate, but the docs want a file in there.
  make -C locate dblocation.texi
  make
}

check() {
  cd findutils-${pkgver}
  make check
}

package() {
  ncxfah_depends=('sh')
  ncxfat_depends=('glibc')
  cd findutils-${pkgver}
  make DESTDIR="$pkgdir" install
}
