# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=evolution-ews
pkgver=3.34.0
pkgrel=1
pkgdesc="MS Exchange integration through Exchange Web Services"
url="https://wiki.gnome.org/Apps/Evolution/EWS"
arch=(x86_64)
license=(LGPL2.1)
depends=(libmspack evolution)
makedepends=(git cmake intltool python)
_commit=5c2fc5b56814df24c5a1b8e83813a267c189a64f  # tags/3.34.0^0
source=("git+https://gitlab.gnome.org/GNOME/evolution-ews.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^EVOLUTION_EWS_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  cmake -H$pkgname -Bbuild \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIBEXEC_INSTALL_DIR=/usr/lib \
    -DSYSCONF_INSTALL_DIR=/etc
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --build build --target install
}
