# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libxp
pkgver=1.0.4
pkgrel=3
pkgdesc="X11 X Print Library"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=('X11' 'X11-distribute-modifications-variant')
url="https://xorg.freedesktop.org/"
depends=('libxext' 'libx11' 'libxau' 'glibc' 'xorgproto')
makedepends=('xorg-util-macros')
provides=('libXp.so')
source=(${url}/releases/individual/lib/libXp-${pkgver}.tar.xz{,.sig}
        add-proto-files.patch)
sha512sums=('50e82e7ee7222db13a04f6223ae8653eb783593c3b28825d7fc233af188960bec53d2b11ced281e01140d283d840d0e3822d71f95f5045d594fb704485fd0f89'
            'SKIP'
            '4347b6928d9cffa610e8dec7524d3897d2bbcdb6ee24a1e801bb28a5c5dc0a7a692cb1d0d5dddca2cbf6484c3604bbb3b3b4b62cd566d807167c3636b2247004')
#validpgpkeys=('3BB639E56F861FA2E86505690FDD682D974CA72A') #  "Matt Turner <mattst88@gmail.com>"
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

prepare() {
  cd libXp-${pkgver}
  patch -Np1 -i ../add-proto-files.patch
  autoreconf -vfi
}

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

package() {
  cd libXp-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
