From f3c358c1778c38a6a34f1298c146cf2972c5cec0 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Sun, 11 Sep 2022 14:30:49 +0200 Subject: [PATCH] update to 7.5.4 autodetect nextcloud dependency --- .SRCINFO | 11 ++++++----- PKGBUILD | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index c2de662..bf174ec 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,15 +1,16 @@ pkgbase = nextcloud-app-onlyoffice pkgdesc = ONLYOFFICE connector allows you to view, edit and collaborate using ONLYOFFICE Docs. - pkgver = 7.5.2 + pkgver = 7.5.4 pkgrel = 1 url = https://github.com/ONLYOFFICE/onlyoffice-nextcloud arch = any license = AGPL3 - depends = nextcloud>=24 - depends = nextcloud<25 - source = onlyoffice-nextcloud-7.5.2.tar.gz::https://github.com/ONLYOFFICE/onlyoffice-nextcloud/archive/v7.5.2.tar.gz + makedepends = yq + source = onlyoffice-nextcloud-7.5.4.tar.gz::https://github.com/ONLYOFFICE/onlyoffice-nextcloud/archive/v7.5.4.tar.gz source = onlyoffice-document-templates-main-new.tar.gz::https://github.com/ONLYOFFICE/document-templates/archive/main/new.tar.gz - sha512sums = a451ff4a6f71992532682e745d9be0d59a3ae6417766e2a6e9ebfc62a17200de829d5be530ec91cb1eac43e796dee6b4f460fe992e7d1ffd4fecf621e738e289 + sha512sums = d28d6959f659a0f24f4b31a8ab32343da66cdd96314fbf0f8303b72b3a3fe9b7befce679efc73411a4ef1f7fb8d09a3a9b7316110f6adb98c1d1e9e66998d702 sha512sums = 0d4239ea9d9f7848afe4eb192b67bfae5e56e7614d38eb6970cf6a54651f1a32c5e30d229e2c63b98530fc98e87f0e395d051234f33514109dc17bf1ca694b11 pkgname = nextcloud-app-onlyoffice + depends = nextcloud>= + depends = nextcloud< diff --git a/PKGBUILD b/PKGBUILD index f294a4e..3fa47bc 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,19 +1,30 @@ # Maintainer: Carlos Galindo < arch -at - cgj.es > _appname=onlyoffice pkgname=nextcloud-app-onlyoffice -pkgver=7.5.2 +pkgver=7.5.4 pkgrel=1 pkgdesc="ONLYOFFICE connector allows you to view, edit and collaborate using ONLYOFFICE Docs." arch=("any") url="https://github.com/ONLYOFFICE/onlyoffice-nextcloud" license=('AGPL3') -depends=('nextcloud>=24' 'nextcloud<25') +makedepends=('yq') source=("$_appname-nextcloud-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" "onlyoffice-document-templates-main-new.tar.gz::https://github.com/ONLYOFFICE/document-templates/archive/main/new.tar.gz") -sha512sums=('a451ff4a6f71992532682e745d9be0d59a3ae6417766e2a6e9ebfc62a17200de829d5be530ec91cb1eac43e796dee6b4f460fe992e7d1ffd4fecf621e738e289' +sha512sums=('d28d6959f659a0f24f4b31a8ab32343da66cdd96314fbf0f8303b72b3a3fe9b7befce679efc73411a4ef1f7fb8d09a3a9b7316110f6adb98c1d1e9e66998d702' '0d4239ea9d9f7848afe4eb192b67bfae5e56e7614d38eb6970cf6a54651f1a32c5e30d229e2c63b98530fc98e87f0e395d051234f33514109dc17bf1ca694b11') +_get_nextcloud_versions() { + _app_min_major_version="$(xq '.info.dependencies.nextcloud["@min-version"]' "${_appname}-nextcloud-$pkgver/appinfo/info.xml"| sed 's/"//g')" + _app_max_major_version="$(xq '.info.dependencies.nextcloud["@max-version"]' "${_appname}-nextcloud-$pkgver/appinfo/info.xml"| sed 's/"//g')" + _app_max_major_version=$(expr ${_app_max_major_version} + 1) +} + package() { + local _app_min_major_version + local _app_max_major_version + _get_nextcloud_versions + + depends=("nextcloud>=$_app_min_major_version" "nextcloud<$_app_max_major_version") local _appsdir="$pkgdir/usr/share/webapps/nextcloud/apps" mkdir -p "$_appsdir" cp -a "$_appname-nextcloud-$pkgver" "$_appsdir/$_appname"