# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kuba Serafinowski <zizzfizzix(at)gmail(dot)com>

_name=owncloudclient
pkgname=owncloud-client
pkgver=2.5.4.11654
pkgrel=1
pkgdesc='ownCloud client based on mirall'
arch=(x86_64)
url='http://owncloud.org/'
license=(GPL2)
depends=(qtkeychain qt5-webkit hicolor-icon-theme)
makedepends=(extra-cmake-modules python-sphinx qt5-tools doxygen kio)
optdepends=('python-nautilus: integration with Nautilus' 'nemo-python: integration with Nemo' 'python2-caja: integration with Caja')
backup=('etc/ownCloud/sync-exclude.lst')
source=(https://download.owncloud.com/desktop/stable/owncloudclient-$pkgver.tar.xz{,.asc})
sha256sums=('615439c6a224e263cee0d554b8b5f98b57c331dbc18df7ae5d99197480cf563f'
            'SKIP')
validpgpkeys=(F05F7DD7953A07DF36579DAA498C45EBE94E7B37) # ownCloud Client Team (Signing Key) <info@owncloud.com>

prepare() {
  mkdir -p build
}

build() {
  cd build

  cmake ../$_name-$pkgver \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_SYSCONFDIR=/etc/$pkgname
  make
  make doc-man
}

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