# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=dotconf
pkgver=1.3
pkgrel=0
pkgdesc="A C library for parsing configuration files"
url="https://github.com/williamh/dotconf"
arch="all"
license="LGPL2.1"
depends=""
depends_dev=""
makedepends="$depends_dev automake autoconf libtool"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/williamh/dotconf/archive/v1.3.tar.gz"

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

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	autoreconf -vif
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

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

md5sums="b3ba921e45b05e89bf69835c0f30bc14  dotconf-1.3.tar.gz"
sha256sums="7f1ecf40de1ad002a065a321582ed34f8c14242309c3547ad59710ae3c805653  dotconf-1.3.tar.gz"
sha512sums="ccd806685879e2438efaa06949cd685af8bd318d38111babf8c289134b90d01bc2857277f2aa01549a1ffe8a2f2d5bbb0685f46de0d7b987412350af8a28d6d5  dotconf-1.3.tar.gz"