_realname=onig
_fullname=oniguruma
pkgname=${_fullname}
pkgver=6.9.10
pkgrel=1
pkgdesc="A regular expressions library"
arch=('x86_64')
url="https://github.com/kkos/oniguruma"
license=('BSD')
makedepends=("autotools" "gcc")
source=("https://github.com/kkos/${_fullname}/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('2a5cfc5ae259e4e97f86b68dfffc152cdaffe94e2060b770cb827238d769fc05')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver%.1}"
  autoreconf -fiv
}

build() {
  cd "${srcdir}/${_realname}-${pkgver%.1}"
  ./configure \
    --prefix=/usr \
    --enable-posix-api
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver%.1}"
  make check || true
}

package() {
  cd "${srcdir}/${_realname}-${pkgver%.1}"
  make install DESTDIR="${pkgdir}"
}
