# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Ju Liu <liuju86 at gmail dot com>
# Contributor: Bjorn Lindeijer <bjorn lindeijer nl>
# Contributor: Andreas Zwinkau <beza1e1@web.de>

pkgname=telepathy-mission-control
pkgver=5.16.6
pkgrel=4
pkgdesc='Account manager and channel dispatcher for Telepathy'
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://telepathy.freedesktop.org/'
license=(LGPL-2.1-only)
depends=(
  dbus
  dbus-glib
  dconf
  glib2
  glibc
  libnm
  telepathy-glib
)
makedepends=(
  git
  glib2-devel
  gtk-doc
  libxslt
  python
)
source=("git+https://gitlab.freedesktop.org/telepathy/$pkgname.git?signed#tag=$pkgname-$pkgver")
b2sums=(471e36c0d833c1511e4f6d93b66272e8b2c817dfeb96dfdfea1555b90f681753572ad9896cb50bb47b580f94e3bb66f7260084194721b8c77f9dc5d523ae1e00)
validpgpkeys=(
  38FDAD7D73CE1AE7A16200291F3845DD1432A9FB # Georgios Kiagiadakis <gkiagia@tolabaki.gr>
  AA33B0D27868E36C151780F0FE0B6D736B1195ED # Alexandr Akulich <akulichalexander@gmail.com>
)

prepare() {
  cd $pkgname

  # Fix property name
  git cherry-pick -n d8dab08fe8db137c6bbd8bbdc3d9b01d98c48910

  autoreconf -fi
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib/telepathy \
    --with-connectivity=nm \
    --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
