# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: David Moore <davidm@sjsoft.com>

pkgname=aqbanking
pkgver=6.6.3
pkgrel=1
pkgdesc="A library for online banking and financial applications"
arch=('x86_64')
url="https://www.aquamaniac.de/rdm/projects/aqbanking"
license=('GPL')
depends=('gwenhywfar')
options=('!makeflags')
source=(https://www.aquamaniac.de/rdm/attachments/download/543/$pkgname-$pkgver.tar.gz
        https://www.aquamaniac.de/rdm/attachments/download/542/$pkgname-$pkgver.tar.gz.asc)
validpgpkeys=('42400AF5EB2A17F0A69BB551E9899D784A977416') #AqBanking Package Key <packages@aqbanking.de>
sha256sums=('792a04d384089daf643eed5bffafadabaef0ecd55c66554e5822c433cb93b610'
            'SKIP')

build() {
  cd "${srcdir}"/$pkgname-$pkgver

  BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m%d%H%M%S)"

  export PKG_CONFIG=/usr/bin/pkg-config
  ./configure --prefix=/usr --enable-gwenhywfar \
              --with-build-datetime=${BUILD_DATE} \
              --with-backends="aqhbci aqofxconnect aqpaypal aqnone" # aqnone https://www.aquamaniac.de/rdm/issues/258
  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

  make DESTDIR="${pkgdir}" install
}
