# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=xorg-util-macros
pkgver=1.20.2
pkgrel=1
pkgdesc='X.Org Autotools macros'
arch=('any')
groups=('development')
license=('custom')
provides=('util-macros')
replaces=('util-macros')
conflicts=('util-macros')
url="https://xorg.freedesktop.org/"
msys2_references=(
  "anitya: 15037"
  "archlinux: xorg-util-macros"
  "cygwin: xorg-util-macros"
  "gentoo: x11-misc/util-macros"
)
depends=()
makedepends=('autotools')
source=("https://xorg.freedesktop.org/releases/individual/util/util-macros-${pkgver}.tar.xz")
sha256sums=('9ac269eba24f672d7d7b3574e4be5f333d13f04a7712303b1821b2a51ac82e8e')

prepare() {
  cd "${srcdir}/util-macros-${pkgver}"
  autoreconf -fiv
}

build() {
  cd "${srcdir}/util-macros-${pkgver}"
  ./configure --prefix=/usr
  make
}

check() {
  cd "${srcdir}/util-macros-${pkgver}"
  make -k check
}

package() {
  cd "${srcdir}/util-macros-${pkgver}"
  make install DESTDIR="${pkgdir}"

  install -m755 -d "${pkgdir}/usr/lib"
  mv "${pkgdir}/usr/share/pkgconfig" "${pkgdir}/usr/lib/"
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
