# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=nextcloud-client
pkgver=2.3.3
pkgrel=0
pkgdesc="Nextcloud Desktop Client"
url="https://github.com/nextcloud/client_theming"
arch="all"
license="GPL-2.0"
makedepends="$depends_dev cmake qt5-qttools-dev qt5-qtwebkit-dev
	qt5-qtkeychain-dev"
subpackages="$pkgname-dev"
options="!check" # no testsuite
source="owncloud-client-$pkgver.tar.gz::https://github.com/owncloud/client/archive/v$pkgver.tar.gz
	$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/client_theming/archive/v$pkgver.tar.gz"
builddir="$srcdir"/client-$pkgver

build() {
	cd "$builddir"
	# mkdir _build.tmp && cd _build.tmp
	cmake \
		-DCMAKE_BUILD_TYPE="Release" \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc/$pkgname \
		-DOEM_THEME_DIR="$srcdir/$_realname-$pkgver/nextcloudtheme"
	make all
}

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

sha512sums="f037987307cc0f66e7135114557b91bfae7e66ab9b3cf97d7b4f3a28de53fe651ae306a27fe01d14d6505da55eddb540b4e8ec2636c4b25f628da8d873ed2b0e  owncloud-client-2.3.3.tar.gz
fd02c61a7a92b77f9063e4f15be426be84d02033bead4b176d876134f8b85d7385e4a361959b68c332f1ccb55d43e2a8b55e0d5c8e5a54f645a5816a37790bde  nextcloud-client-2.3.3.tar.gz"
