# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=bash-completion
pkgver=2.11
pkgrel=1
pkgdesc="Programmable completion for the bash shell"
arch=('any')
url="https://bash-completion.alioth.debian.org/"
license=('GPL')
depends=('bash')
options=('!emptydirs' '!makeflags')
source=(https://github.com/scop/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.xz
        001-quote_readline_by_ref_fixes.patch)
sha256sums=('73a8894bad94dee83ab468fa09f628daffd567e8bef1a24277f1e9a0daf911ac'
            'cb33b656f435b945a6ae42dace5ace56e7063152ad3fa38429a7311d491525af')
prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/001-quote_readline_by_ref_fixes.patch

  autoreconf --install
}

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

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

  rm "${pkgdir}"/usr/share/bash-completion/completions/makepkg
}
