# Contributor: Harry
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=cgdb
pkgver=0.7.0
pkgrel=1
pkgdesc="The Curses Debugger"
arch="all"
license="GPL-2.0"
url="http://cgdb.sourceforge.net/"
depends="gdb"
makedepends="flex bison texinfo help2man ncurses-dev readline-dev"
source="http://cgdb.me/files/cgdb-$pkgver.tar.gz"
subpackages="$pkgname-doc"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libdir=/usr/lib \
		|| return 1
	make || return 1
}

check() {
	cd "$builddir"
	make check || return 1
}

package() {
	cd "$builddir"
	make install \
		pkgconfigdir="/usr/lib/pkgconfig" \
		DESTDIR="$pkgdir" || return 1
	mkdir -p "$pkgdir"/usr/share/doc
	mv "$pkgdir"/usr/share/cgdb "$pkgdir"/usr/share/doc/
}

sha512sums="406830b5c0f8035df39571f01c20442b76c2509d069d6eb151c239e1cd30132ac6c4a404b8c96cdd8a06297d3c600c7b016a7d95cee2fda285b11fd21b391209  cgdb-0.7.0.tar.gz"
