# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

pkgbase=autotools-wrappers
pkgname=('automake-wrapper' 'autoconf-wrapper' )
pkgver=20250528
pkgrel=1
arch=('any')
license=('spdx:GPL-2.0-only')
makedepends=('git')
url="https://gitweb.gentoo.org/proj/autotools-wrappers.git/"
source=("git+https://anongit.gentoo.org/git/proj/autotools-wrappers.git#tag=at-${pkgver}")
sha256sums=('aacf761276066f14f49cfa6ce20b6e5232c6ed5a41a838d2a257fc32da460101')

prepare() {
  cd "${srcdir}/${pkgbase}"
}

package_automake-wrapper() {
  pkgdesc="Wrapper scripts for automake commands"
  depends=(
    'bash'
    'gawk'
    'automake1.11'
    'automake1.12'
    'automake1.13'
    'automake1.14'
    'automake1.15'
    'automake1.16'
    'automake1.17'
    'automake1.18')
  provides=("automake")
  conflicts=("automake")

  mkdir -p ${pkgdir}/usr/bin
  for prog in automake aclocal
  do
    cp "${srcdir}/${pkgbase}/am-wrapper.sh" "${pkgdir}/usr/bin/${prog}"
  done
}

package_autoconf-wrapper() {
  pkgdesc="Wrapper scripts for autoconf commands"
  depends=(
    'bash'
    'sed'
    'autoconf2.72'
    'autoconf2.71'
    'autoconf2.69'
    'autoconf2.13')
  provides=("autoconf")
  conflicts=("autoconf")
  replaces=("autoconf")

  mkdir -p ${pkgdir}/usr/bin
  for prog in autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
  do
    cp "${srcdir}/${pkgbase}/ac-wrapper.sh" "${pkgdir}/usr/bin/${prog}"
  done
}
