pkgname=findutils
pkgver=4.10.0
pkgdesc="GNU utilities to locate files"
arch=('x86_64')
license=('GPL-3.0-or-later')
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://ftp.gnu.org/gnu/${pkgname}/${sources[0]}")
md5sums=("870cfd71c07d37ebe56f9f4aaf4ad872")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  ./configure --prefix=/usr --localstatedir=/var/lib/locate
  make
}

src_check() {
  chown -R leaf .
  su leaf -c "PATH=$PATH make check"
}

src_install() {
  make DESTDIR="${pkgdir}" install
}
