# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>

pkgname=ctags
_commit=ca81123303640582358ce7b8a4e466615950a1f7  # p5.9.20210905.0
pkgver=5.9.20210905.0
pkgrel=1
epoch=1
pkgdesc='Generates an index file of language objects found in source files'
url='https://ctags.io/'
arch=('x86_64')
license=('GPL')
depends=('glibc' 'libxml2' 'jansson' 'libyaml' 'libseccomp' 'libseccomp.so')
makedepends=('git' 'python-docutils')
provides=('universal-ctags')
source=("git+https://github.com/universal-ctags/ctags.git#commit=$_commit")
sha512sums=('SKIP')

pkgver() {
  git -C ctags describe --tags --match 'p*' | sed 's/^p//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd ctags
  autoreconf -fiv
}

build() {
  cd ctags
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib
  make
}

check() {
  make -C ctags check
}

package() {
  make -C ctags DESTDIR="${pkgdir}" install
}

# vim:set sw=2 et:
