# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Christian Heusel <gromit@archlinux.org>
# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgname=devtools
epoch=1
pkgver=1.2.0
pkgrel=1
pkgdesc='Tools for Arch Linux package maintainers'
arch=(any)
license=('GPL-3.0-or-later')
url='https://gitlab.archlinux.org/archlinux/devtools'
depends=(
  arch-install-scripts
  awk
  bash
  binutils
  coreutils
  curl
  diffutils
  expac
  fakeroot
  findutils
  grep
  jq
  openssh
  parallel
  rsync
  sed
  util-linux

  breezy
  git
  mercurial
  subversion
)
makedepends=(
  asciidoctor
)
checkdepends=(
  bats
)
optdepends=(
  'btrfs-progs: btrfs support'
  'bat: pretty printing for pkgctl search'
  'nvchecker: pkgctl version subcommand'
)
replaces=(devtools-git-poc)
source=(https://gitlab.archlinux.org/archlinux/devtools/-/releases/v${pkgver}/downloads/devtools-${pkgver}.tar.gz{,.sig}
        lazy-ppc-fix.patch)
validpgpkeys=(
  'E240B57E2C4630BA768E2F26FC1B547C8D8172C8' # Levente Polyak <anthraxx@archlinux.org>
  'F00B96D15228013FFC9C9D0393B11DAA4C197E3D' # Christian Heusel (gromit packager key) <gromit@archlinux.org>
)
sha256sums=('5407d412f0a29229c8eeebea6b95811ceb24749910ac4189e3a74798c13c6822'
            'SKIP'
            'a137f3dd145e5988258ebcc9a006d279749031d37fbfc58bb2c25ddda6a2b7cf')
b2sums=('86c1d470bc5b4db8ee757da05a7af72ab80844a12f4d2f338deb4fe1aa2bc9d66d3018d05e5d7898687fb3caa4d9299c746434742ec089739801731b50002c17'
        'SKIP'
        '1b8052164a5827eeb83e13a5baf42fe1e3f338bd3b746b98e0ef226567124b68319d65dac77275589851ab61e492d30594acb07091d8e8ac4930ab0197dab16c')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -Np1 -i ${srcdir}/lazy-ppc-fix.patch
}

build() {
  cd ${pkgname}-${pkgver}
  make BUILDTOOLVER="${epoch}:${pkgver}-${pkgrel}-${arch}" PREFIX=/usr
}

check() {
  cd ${pkgname}-${pkgver}
  make PREFIX=/usr test
}

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

# vim: ts=2 sw=2 et:
