# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>

pkgname="libixp-hg"
pkgver=148
pkgdesc="A 9p client/server library"
url="https://code.google.com/p/libixp"
license=("MIT")

provides=("libixp")
conflicts=("libixp")

pkgrel=3
arch=("i686" "x86_64")
makedepends=("txt2tags")

source=("https://repo.parabola.nu/other/${pkgname}/${pkgname}-${pkgver}.tar.gz")
md5sums=('7e63202f7f270777cebe3fd07ae39035')

mkdepends=('mercurial')
mksource=("$pkgname-$pkgver::hg+https://code.google.com/p/libixp/#revision=${pkgver}")
mkmd5sums=('SKIP')
mksource() {
	# don't include this precompiled binary (probably included by accident)
	rm "${srcdir}/${pkgname}-${pkgver}/test/o.client"
}

_makeflags=("PREFIX=/usr" "ETC=/etc")
build() {
	cd "$srcdir/$pkgname-$pkgver"
	make "${_makeflags[@]}"
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make "${_makeflags[@]}" DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
