# Contributor: Daniel Sabogal <dsabogalcc@gmail.com>
# Maintainer:
pkgname=global
pkgver=6.6.2
pkgrel=0
pkgdesc="A source code tag system"
url="http://www.gnu.org/software/global"
arch="all"
license="GPL"
depends=""
makedepends="libltdl perl"
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/global/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		--localstatedir=/var \
		--with-exuberant-ctags=/usr/bin/ctags \
		--disable-gtagscscope
	make
}

check() {
	cd "$builddir"
	./global/global --version
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir/" install

	install -d "$pkgdir"/usr/share/emacs/site-lisp
	install -d "$pkgdir"/usr/share/vim/vimfiles/plugin
	mv "$pkgdir"/usr/share/gtags/gtags.el "$pkgdir"/usr/share/emacs/site-lisp/gtags.el
	mv "$pkgdir"/usr/share/gtags/gtags.vim "$pkgdir"/usr/share/vim/vimfiles/plugin/gtags.vim
	mv "$pkgdir"/usr/share/gtags/gtags-cscope.vim "$pkgdir"/usr/share/vim/vimfiles/plugin/gtags-cscope.vim
}

sha512sums="9a58e4c2128bd420068754a5f93a472efa7ce12589dc291ebc0b6f4af8e2a5113d47ffa6887fc61ed1d6370529ced55826f25b484ac16416bced99235c01d744  global-6.6.2.tar.gz"
