# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Aaron Griffin <aaron@archlinux.org>

pkgbase=libofx
pkgname=('libofx' 'libofx-doc')
pkgver=0.10.9
pkgrel=2
pkgdesc="API for the OFX banking standard"
arch=('x86_64')
url="https://github.com/libofx"
license=('GPL')
depends=('opensp' 'curl' 'libxml++2.6')
checkdepends=('gnupg')
source=(https://github.com/$pkgname/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('1ca89ff7d681c9edad312172ac464231a8de686e653213612f9417492cef0d37')

build() {
  cd $pkgbase-$pkgver
  ./configure --prefix=/usr
   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
   make CXXFLAGS+=-std=c++11
}

check() {
  cd $pkgbase-$pkgver
  make check
}

package_libofx() {
  options=('!docs')

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

package_libofx-doc() {
  pkgdesc="Documention of the OFX banking standard API"
  depends=()

  cd $pkgbase-$pkgver
  make DESTDIR="$pkgdir" install-docDATA
  make -C doc DESTDIR="$pkgdir" install
}
