# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=rarian
pkgver=0.8.1
pkgrel=6
pkgdesc="Documentation meta-data library, designed as a replacement for Scrollkeeper."
url="http://rarian.freedesktop.org/"
arch="all"
license="GPL"
subpackages="$pkgname-dev"
depends="bash"
makedepends="libxslt-dev"
source="http://ftp.gnome.org/pub/gnome/sources/$pkgname/0.8/$pkgname-$pkgver.tar.bz2
	user-segfault.patch"

_builddir=""$srcdir/$pkgname-$pkgver""

prepare() {
	cd "$_builddir"
	update_config_sub || return 1
	patch -p0 -i "$srcdir"/user-segfault.patch || return 1
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--enable-scrollkeeper-compat \
		--disable-static \
		|| return 1
	make || return 1
}

package() {
	cd "$srcdir"/$pkgname-$pkgver
	make -j1 DESTDIR="$pkgdir" install || return 1
}

sha512sums="64f3e7fbe423e45a59453805fe6b4116e0ffad43c7e88fe362d76a326c70936c6b46c4a4dc57cf43e3535c16f2f07fa1b2affa0aaeae637ee3ede48850c1fc60  rarian-0.8.1.tar.bz2
e4644e1cf6ad8de28bde163604b073b1366c8b35fa65873a91d38770dd0cadf4322797e85e5ccfcfd9d1fccce6a72c45d8b189328077b7400a24e5103677b939  user-segfault.patch"