# Maintainer: Hu Butui <hot123tea123@gmail.com>
# Contributor: Chris Severance aur.severach aATt spamgourmet dott com
# Contributor: oliver < a t >  first . in-berlin . de

pkgname=camlpdf
pkgver=2.9.1
pkgrel=1
pkgdesc='Coherent Graphics OCaml library for reading, writing and modifying PDF files'
arch=('x86_64')
url='https://github.com/johnwhitington/camlpdf'
license=('LGPL-2.1-or-later')
depends=(
  glibc
)
makedepends=(
  ocaml-findlib
)
options=('!strip' '!makeflags')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/johnwhitington/camlpdf/archive/v${pkgver}.tar.gz")
sha256sums=('08e13a341362fb586a8bb02daf85fc1ef62250b63e6b58812b9c361e3d1c9951')

_setvars() {
  OCAMLFIND_DESTDIR="${pkgdir}/$(ocamlfind printconf destdir)"
  OCAMLFIND_LDCONF="${pkgdir}/$(ocamlfind printconf ldconf)"
}

build() {
  cd "${pkgname}-${pkgver}"
  local OCAMLFIND_DESTDIR OCAMLFIND_LDCONF; _setvars
  make OCAMLFIND_DESTDIR="${OCAMLFIND_DESTDIR}"
}

package() {
  cd "${pkgname}-${pkgver}"
  local OCAMLFIND_DESTDIR OCAMLFIND_LDCONF; _setvars
  install -dm755 "${OCAMLFIND_DESTDIR}"
  make install -d OCAMLFIND_DESTDIR="${OCAMLFIND_DESTDIR}" OCAMLFIND_LDCONF="${OCAMLFIND_LDCONF}"
}
# vim:set ts=2 sw=2 et:
