# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=bash-completion
pkgver=2.15.0
pkgrel=1
pkgdesc='Programmable completion for the bash shell'
arch=(any)
url='https://github.com/scop/bash-completion'
license=(GPL-2.0-only)
depends=(bash)
options=(!emptydirs !makeflags)
backup=('etc/bash_completion.d/000_bash_completion_compat.bash')
source=($url/releases/download/$pkgver/$pkgname-$pkgver.tar.xz)
validpgpkeys=(A558062B6D5DA1347CD468D52B0AE2C1B09B07CB)
b2sums=('d2234cb2baf8494d2159e8abe6780e0879efb6fe9e851c0d51ebf09363c83652ef610658e2beca181adc0d6c844472a68a219be8b3ca51271fdfc53477f174ba')

build() {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  # bash-completion is sourced in /etc/bash.bashrc so that non-bash shell don't source it
  rm "${pkgdir}/etc/profile.d/bash_completion.sh"

  # remove Slackware's makepkg completion
  rm "${pkgdir}/usr/share/bash-completion/completions/makepkg"
}

