# Contributor: Jeff Bilyk <jbilyk at gmail>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=re2c
pkgver=1.0.2
pkgrel=0
pkgdesc="A tool for writing fast and flexible scanners in C from regular expressions"
url="http://www.re2c.org"
arch="all"
license="Public-Domain"
checkdepends="bash"
subpackages="$pkgname-doc"
source="https://github.com/skvadrik/re2c/releases/download/$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

check() {
	cd "$builddir"
	make tests
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="9d85933ae874cb9240175ce7210d3808173bafe246c67b9c333578846239b7bcef074287f26040b5a048bcd98db8d0393035c417918b80db1f74098695a77176  re2c-1.0.2.tar.gz"
