# $Id: PKGBUILD 237804 2015-04-20 19:36:19Z arojas $
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=signon-plugin-oauth2
_pkgname=signon-oauth2
pkgver=0.22
pkgrel=1
pkgdesc='OAuth 2 plugin for signon'
arch=('i686' 'x86_64')
url="https://gitlab.com/accounts-sso/signon-plugin-oauth2"
license=('LGPL')
depends=('signon')
makedepends=('qt5-xmlpatterns')
source=("$pkgname-$pkgver.tar.gz::https://gitlab.com/accounts-sso/signon-plugin-oauth2/repository/archive.tar.gz?ref=VERSION_$pkgver")
md5sums=('d7c3b7fffe6102fc58d479028141f2b4')

prepare() {
  cd signon-plugin-oauth2.git

  sed -i '/-Werror/d' common-project-config.pri

  # Do not install tests and example
  echo 'INSTALLS =' >>tests/tests.pro
  echo 'INSTALLS =' >>example/example.pro
}

build() {
  cd signon-plugin-oauth2.git

  qmake-qt5 PREFIX=/usr LIBDIR=/usr/lib
  make
}

package() {
  cd signon-plugin-oauth2.git

  make INSTALL_ROOT="$pkgdir" install
}

