app=grep
version=3.6
build=1sml
homepage="https://www.gnu.org/software/grep/"
download="https://ftp.gnu.org/gnu/grep/grep-$version.tar.xz"
desc="print lines matching a pattern"
requires="pcre"

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

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

  CFLAGS="-static" \
  ./configure \
    --prefix="" \
    --bindir=/bin \
    --sysconfdir=/etc 

  make CFLAGS="-static"
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
8934544a19ded61344d83ff2cab501e86f17f8ae338892e0c36c2d2d8e63c76817840a0071ef5e3fcbca9115eba8a1aae0e4c46b024e75cd9a2e3bd05f933d90  grep-3.6.tar.xz
"
