# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=libpst
pkgname=('libpst' 'libpst-docs')
pkgver=0.6.76
pkgrel=2
arch=('x86_64')
url="https://www.five-ten-sg.com/libpst/"
license=('GPL')
makedepends=('python' 'boost' 'libgsf')
source=(https://www.five-ten-sg.com/libpst/packages/${pkgbase}-${pkgver}.tar.gz)
sha256sums=('3d291beebbdb48d2b934608bc06195b641da63d2a8f5e0d386f2e9d6d05a0b42')

build() {
  cd $pkgbase-$pkgver
  ./configure --prefix=/usr --mandir=/usr/share/man \
      --disable-static --enable-libpst-shared --disable-dii
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_libpst() {
  pkgdesc="Outlook .pst file converter"
  depends=('gcc-libs' 'libgsf')
  optdepends=('boost-libs: for libpst python interface')
  options=('!docs')

  cd $pkgbase-$pkgver
  make DESTDIR="${pkgdir}" install
}

package_libpst-docs() {
  pkgdesc="Documentation for Outlook .pst file converter"
  options=('docs')

  cd $pkgbase-$pkgver
  make DESTDIR="${pkgdir}" install-htmlDATA
  cd html
  make DESTDIR="${pkgdir}" install-htmldevelDATA
}
