pkgname=grep
pkgver=3.12
pkgdesc='A string search utility'
license=('GPL3')
homepage='https://www.gnu.org/software/grep/'
sources=("${pkgname}-${pkgver}.tar.xz")
urls=("https://ftp.gnu.org/gnu/${pkgname}/${sources[0]}")
md5sums=('5d9301ed9d209c4a88c8d3a6fd08b9ac')

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

src_build() {
  sed -i "s/echo/#echo/" src/egrep.sh
  ./configure --prefix=/usr
  make
}

src_check() {
  make check
}

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

