#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=devtools
pkgver=20221012
pkgrel=02
pkgdesc='Tools for Arch and Joborun Linux package maintainers'
arch=('any')
url='https://gitlab.archlinux.org/archlinux/devtools'
depends=('bash' 'openssh' 'subversion' 'rsync' 'arch-install-scripts'
         'git' 'breezy' 'mercurial' 'diffutils' 'util-linux' 'awk')
makedepends=('asciidoc')
optdepends=('btrfs-progs: btrfs support')
source=(${url}/uploads/58ff97503cfb70ddf8f90f3b73080166/devtools-${pkgver}.tar.gz
        ${url}/uploads/dc81469e5c8b1cb069c623a4e59f08ca/devtools-${pkgver}.tar.gz.sig
        devtools-mkarchroot-remove-deprecated-d-option.patch::https://gitlab.archlinux.org/archlinux/devtools/-/commit/a510331698bb13ca11ccd7db3f9beef75f87744c.patch)


#        makepkg.conf-set-LTOFLAGS-flto-auto.patch)

#prepare() {
#  cd ${pkgname}-${pkgver}
#  # https://gitlab.archlinux.org/archlinux/devtools/-/merge_requests/92
#  patch -Np1 -i ../makepkg.conf-set-LTOFLAGS-flto-auto.patch
#}

prepare() {
  cd ${pkgname}-${pkgver}
  patch -Np1 < ../devtools-mkarchroot-remove-deprecated-d-option.patch
}
 

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

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

#---- license gpg-key sha256sums ----

license=('GPL')

validpgpkeys=('4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC' # Pierre Schmitz <pierre@archlinux.org>
	'86CFFCA918CF3AF47147588051E8B148A9999C34' # Evangelos Foutras <foutrelis@archlinux.org>
	'8FC15A064950A99DD1BD14DD39E4B877E62EB915' # Sven-Hendrik Haase <svenstaro@archlinux.org>
	'A2FF3A36AAA56654109064AB19802F8B0D70FC30' # Jan Alexander Steffens (heftig) <heftig@archlinux.org>
	'B81B051F2D7FC867AAFF35A58DBD63B82072D77A' # Sébastien Luttringer <seblu@archlinux.org>
	'6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD' # Allan McRae (Developer) <allan@archlinux.org>
	'E240B57E2C4630BA768E2F26FC1B547C8D8172C8') # Levente Polyak <anthraxx@archlinux.org>

sha256sums=(6e510b1d4f2a8b652d15b12a103e16e5ef8d496603597c10ec8bbcbf0e0b34b7  # devtools-20221012.tar.gz
	655bdef65b42dcfeb916e8ad237e33896086a1b7ef738511471e1b4a689fa4f0 # devtools-20221012.tar.gz.sig
	074d1402a7472539ae26421da840a4555197c2069e15892729a40d5e898e06b1) # devtools-mkarchroot-remove-deprecated-d-option.patch
 
