# Maintainer: Renato Silva <br.renatosilva@gmail.com>

pkgname='quilt'
pkgver=0.69
pkgrel=1
pkgdesc='Manage large numbers of patches'
url='https://savannah.nongnu.org/projects/quilt'
msys2_references=(
  "anitya: 4143"
  "archlinux: quilt"
  "gentoo: dev-util/quilt"
)
makedepends=('autotools')
license=('GPL2+')
arch=('any')

depends=(bash bzip2 diffstat diffutils findutils gawk gettext gzip patch perl)
source=("https://savannah.nongnu.org/download/quilt/${pkgname}-${pkgver}.tar.gz")
sha256sums=('555ddffde22da3c86d1caf5a9c1fb8a152ac2b84730437bd39cc08849c9f4852')

build() {
  cd "${pkgname}-${pkgver}"
  ./configure \
      --prefix='/usr' \
      --mandir='/usr/share/man' \
      --without-rpmbuild

  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make prefix="${pkgdir}/usr" mandir="${pkgdir}/usr/share/man" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"

  # Bash completion
  mkdir "${pkgdir}/usr/share/bash-completion"
  mv "${pkgdir}/usr/etc/bash_completion.d" "${pkgdir}/usr/share/bash-completion/completions"
}
