# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=bash-completion
pkgver=2.14.0
pkgrel=2
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)
sha256sums=('5c7494f968280832d6adb5aa19f745a56f1a79df311e59338c5efa6f7285e168')

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