# 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.3.0
pkgrel=1.1
pkgdesc='Tools for Arch Linux package maintainers'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
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
)
depends_powerpc64le=(glow gum)
depends_riscv64=(glow gum)
depends_x86_64=(glow gum)
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=('537c2b7d362e6d0cb919358305a83e65dbf2dc8b5cedcf4b927702ad67411794'
            'SKIP'
            'a137f3dd145e5988258ebcc9a006d279749031d37fbfc58bb2c25ddda6a2b7cf')
b2sums=('40c2f8fb81a939a027b772f215b31c73d7f8003415335e5c2667589f0e5ddd786e627f4812687fbceff26c1a0f212e20b48402ba2d9d7561502ab16fc8ae0a07'
        '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:
