# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=netcf
pkgver=0.2.8
pkgrel=4
pkgdesc="Cross-platform network configuration library"
arch="all"
url="https://fedorahosted.org/released/netcf"
license="LGPL-2.0"
depends=
makedepends="augeas-dev libgcrypt-dev libnl3-dev libxml2-dev libxslt-dev
	linux-headers pkgconfig readline-dev"
install=
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="https://releases.pagure.org/$pkgname/$pkgname-$pkgver.tar.gz"
replaces="libnetcf"

builddir="$srcdir/netcf-$pkgver"

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

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

libs() {
	pkgdesc="Libraries for $pkgname"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/lib "$pkgdir"/usr/share "$subpkgdir"/usr/
}

sha512sums="d9a667a06469b60e8967423d6a738abc65512bf0ad0975164738c6cd5a168bf0300153067a772a61c4088ea969a88de234be0486c354edf73a7b984ddb003328  netcf-0.2.8.tar.gz"
