# Maintainer: André Klitzing <aklitzing@gmail.com>

pkgname=uncrustify
pkgver=0.65
pkgrel=0
pkgdesc="A source code beautifier"
url="https://github.com/uncrustify/uncrustify"
arch="all"
license="GPL2"
makedepends="cmake python2"
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
builddir="$srcdir"

build() {
	cd "$builddir"
	mkdir -p build
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=/usr ..
	make
}

package() {
	cd "$builddir"
	install -d -m755 "$pkgdir"/usr/share/$pkgname
	install -m644 etc/*.cfg "$pkgdir"/usr/share/$pkgname
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING

	cd build
	make DESTDIR="$pkgdir" PREFIX=/usr install
}

sha512sums="c74e1b8d107ec54f95c70fa1e6a0418085dbdb8e1aab864ef459138191ee4da31230ff5ab706276d5717eb6caa6567a20a8aa82cb18d85560f41374a0a8dbadf  uncrustify-0.65.tar.gz"