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

pkgname=util-macros
pkgver=1.19.3
pkgrel=1
pkgdesc='X.Org Autotools macros'
arch=('any')
groups=('development')
license=('custom')
url="https://xorg.freedesktop.org/"
depends=()
source=(${url}/releases/individual/util/util-macros-${pkgver}.tar.bz2)
sha256sums=('0f812e6e9d2786ba8f54b960ee563c0663ddbe2434bf24ff193f5feab1f31971')

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

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

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

package() {
  cd "${srcdir}/${pkgname}-${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}/"
}
