APP=mlocate
VERSION=0.26
BUILD=1sml
HOMEPAGE='https://packages.debian.org/jessie/mlocate'
DOWNLOAD='http://deb.debian.org/debian/pool/main/m/mlocate/mlocate_0.26.orig.tar.gz'
DESC="file and directory finder that aims to optimize find times using databases"
REQUIRES="musl"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  patch -p1 < $SRCDIR/01-fortify-source-compat.patch
  sed -i '/^groupname /s/mlocate/locate/' Makefile.in

  autoreconf -vif

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

  make
  make install DESTDIR=$PKG

  install -Dm 644 $SRCDIR/updatedb.conf.sample $PKG/etc/updatedb.conf

  cp COPYING $PKGDOCS/

  mkfinalpkg
}

SHA512SUMS="
09d6fda20c4cd1293981ed2e3fce051aabd85076b386a92b7bfc6153e2405322fcdebd839bbb9258b91af11a7eff390f9e5faf9af51ecc592afff8be4cb86aa8  mlocate-0.26.tar.lz
ad4a70a3a827d09113b30788e7343f3cd47750cf0ce79f088fadab102fc78c04243482eddb9987cac8843c5065257dd6d9c17f423fe4c331fefe0148657f55fe  01-fortify-source-compat.patch
"
