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

pkgname=global
pkgver=6.6.12
pkgrel="1"
pkgdesc="A source code tagging system"
arch=("i686" "x86_64")
url="https://www.gnu.org/software/global/"
msys2_references=(
  'anitya: 7987'
  'archlinux: global'
  'cpe: cpe:2.3:a:gnu:global'
  'gentoo: dev-util/global'
)
license=('GPL3')
depends=("libltdl")
optdepends=("ctags" "python3-pygments")
makedepends=("ncurses-devel" 'autotools' 'gperf' 'gcc')
options=(libtool !emptydirs)
source=("https://ftp.gnu.org/gnu/global/${pkgname}-${pkgver}.tar.gz"{,.sig})
sha256sums=('542a5b06840e14eca548b4bb60b44c0adcf01024e68eb362f8bf716007885901'
            'SKIP')
validpgpkeys=("26F631B43D624A927E6F1C33969C3BE389DDA6EB") # Shigio YAMAGUCHI <shigio@gnu.org>

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"
}
