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

pkgname=cscope
pkgver=15.9
pkgrel="1"
pkgdesc="A tool for browsing source code"
arch=("i686" "x86_64")
url="https://cscope.sourceforge.io/"
license=('BSD')
makedepends=("ncurses-devel")
source=("https://sourceforge.net/projects/cscope/files/${pkgname}/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('c5505ae075a871a9cd8d9801859b0ff1c09782075df281c72c23e72115d9f159')

prepare () {
  cd "${pkgname}-${pkgver}"
  sed -i 's|/usr/local/lib/cs|/usr/lib/cs|' contrib/ocs
}

build () {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr \
              --build=${CHOST} \
              --host=${CHOST}
  make
}

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