# Contributor: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

_pkgname=libxdmcp
pkgname=static-compat-$_pkgname
pkgver=1.1.3
pkgrel=3
pkgdesc="X11 Display Manager Control Protocol library"
arch=('x86_64')
url="https://xorg.freedesktop.org/"
license=('custom')
depends=('glibc-static-compat')
makedepends=('xorg-util-macros' 'static-compat-xorgproto' 'static-compat-configure')
options=(!emptydirs staticlibs)
source=(${url}/releases/individual/lib/libXdmcp-${pkgver}.tar.bz2{,.sig})
sha512sums=('cb1d4650f97d66e73acd2465ec7d757b9b797cce2f85e301860a44997a461837eea845ec9bd5b639ec5ca34c804f8bdd870697a5ce3f4e270b687c9ef74f25ec'
            'SKIP')
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

build() {
  source static-compat-environment
  cd libXdmcp-${pkgver}
  static-compat-configure --disable-shared --enable-static --sysconfdir=/etc
  make
}

package() {
  source static-compat-environment
  cd libXdmcp-${pkgver}
  make DESTDIR="${pkgdir}" install
  rm -r "$pkgdir/$static_compat_prefix"/share/doc

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