# Maintainer: Joćo Guerra <joca.bt@gmail.com>

pkgname=global
pkgver=6.6.6
pkgrel="1"
pkgdesc="A source code tagging system"
arch=("i686" "x86_64")
url="https://www.gnu.org/software/global/"
license=('GPL3')
depends=("libltdl")
optdepends=("ctags" "python3-pygments")
makedepends=("ncurses-devel")
options=(libtool !emptydirs)
source=("https://ftp.gnu.org/gnu/global/${pkgname}-${pkgver}.tar.gz")
sha256sums=('758078afff98d4c051c58785c7ada3ed1977fabb77f8897ff657b71cc62d4d5d')

prepare() {
  cd "${pkgname}-${pkgver}"
  autoreconf -fiv
}

build () {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
              --build=${CHOST} \
              --host=${CHOST} \
              --enable-shared \
              --disable-static \
              --with-exuberant-ctags=ctags
  make
}

package () {
  cd "${pkgname}-${pkgver}"
  make prefix="${pkgdir}/usr" install
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
