description="Programmable completion for the bash shell"
url="https://github.com/scop/bash-completion"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=bash-completion
version=2.17.0

PKGMK_IGNORE_UNPACK='yes'
source=(https://github.com/scop/$name/releases/download/$version/$name-$version.tar.xz)

prepare() {
  tar xf $name-$version.tar.xz
}

build() {
  cd $name-$version
  
  ./configure --prefix=/usr \
              --libdir=/usr/lib \
              --sysconfdir=/etc
  make
}

package() {
  cd $name-$version
  make DESTDIR="$PKG" install

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

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