# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=bc
pkgver=1.07.1
pkgrel=5
pkgdesc='An arbitrary precision calculator language'
arch=('x86_64')
url='https://www.gnu.org/software/bc/'
license=('GPL-3.0-only')
depends=('readline')
makedepends=('ed')
replaces=('bc-readline')
conflicts=('bc-readline')
source=("https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz"{,.sig})
sha512sums=('02126d0db6b6ed06d56cfc292d6f5475ff1e574779d7e69c7809bbb1e13f946f57ea07da2a7666baa092507a951a822044b0970075f75eefe65a5c1999b75d34'
            'SKIP')
b2sums=('dcedc193be5521aa0fa3a19746233ed65bc1fe8ef12e15155341706de6fbeecb6dd7ee4ab11e2d4b3aca2ae7097cce89e389b3573493bbc893e00b4ed3239594'
        'SKIP')
validpgpkeys=('00E426232F384BF6D32D8B1881C24FF12FB7B14B') # Phil Nelson <philnelson@acm.org>

build() {
  cd "${pkgname}-${pkgver}"
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \
    --with-readline

  make -j1
}

check () {
  cd "${pkgname}-${pkgver}"

  echo "quit" | ./bc/bc -l Test/checklib.b
}

package() {
  cd "${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
}
