# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
setvar pkgname = 'ragel'
setvar pkgver = '6.10'
setvar pkgrel = '0'
setvar pkgdesc = ""Finite state machine compiler""
setvar url = ""http://www.complang.org/ragel/""
setvar arch = ""all""
setvar license = ""GPLv2+""
setvar depends = """"
setvar depends_dev = """"
setvar makedepends = "$depends_dev"
setvar install = """"
setvar subpackages = ""$pkgname-doc""
setvar source = ""http://www.colm.net/files/ragel/ragel-$pkgver.tar.gz""

setvar _builddir = ""$srcdir"/ragel-$pkgver"
proc prepare {
	local i
	cd $_builddir
	for i in $source {
		case (i) {
		*.patch { msg $i; patch -p1 -i "$srcdir"/$i || return 1}
		}
	}
}

proc build {
	cd $_builddir
	export CXXFLAGS="$CXXFLAGS -std=gnu++98"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		|| return 1
	make || return 1
}

proc package {
	cd $_builddir
	make DESTDIR="$pkgdir" install || return 1
}

setvar sha512sums = ""6c1fe4f6fa8546ae28b92ccfbae94355ff0d3cea346b9ae8ce4cf6c2bdbeb823e0ccd355332643ea72d3befd533a8b3030ddbf82be7ffa811c2c58cbb01aaa38  ragel-6.10.tar.gz""