diff options
author | Caleb Maclennan | 2022-05-25 10:07:24 +0300 |
---|---|---|
committer | Caleb Maclennan | 2022-05-25 10:07:24 +0300 |
commit | 96c22d6998a8425a60e4cb3227d0280b4d3a58e5 (patch) | |
tree | dafff58e09a004223181b6d4077ee2edbccedf1f | |
parent | ba6afa71326eff3fba6c9dcf55389dc1f01ce4a4 (diff) | |
download | aur-96c22d6998a8425a60e4cb3227d0280b4d3a58e5.tar.gz |
upgpkg: nextcloud-app-user-saml 5.0.1-1
upstream release
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | PKGBUILD | 58 |
2 files changed, 56 insertions, 11 deletions
@@ -1,14 +1,15 @@ pkgbase = nextcloud-app-user-saml pkgdesc = App for authenticating Nextcloud users using SAML - pkgver = 5.0.0 + pkgver = 5.0.1 pkgrel = 1 url = https://github.com/nextcloud/user_saml arch = x86_64 license = AGPL3 makedepends = composer + makedepends = nextcloud makedepends = rsync - depends = nextcloud - source = user_saml-5.0.0.tar.gz::https://github.com/nextcloud/user_saml/archive/v5.0.0.tar.gz - sha256sums = c3401177c1aa3ae68d4471ad0aa4dff73fd2e1dda314fad1f52f350f84ae5e23 + makedepends = yq + source = https://github.com/nextcloud/user_saml/archive/v5.0.1/user_saml-5.0.1.tar.gz + sha256sums = c3949753b2a0df7bfff5e19e49d34d99235027ea09faf2575847cbadb8298640 pkgname = nextcloud-app-user-saml @@ -2,25 +2,69 @@ _appname=user_saml pkgname=nextcloud-app-${_appname/_/-} -pkgver=5.0.0 +pkgver=5.0.1 pkgrel=1 pkgdesc="App for authenticating Nextcloud users using SAML" arch=(x86_64) url="https://github.com/nextcloud/$_appname" license=(AGPL3) -depends=(nextcloud) makedepends=(composer - rsync) -source=("$_appname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") -sha256sums=('c3401177c1aa3ae68d4471ad0aa4dff73fd2e1dda314fad1f52f350f84ae5e23') + nextcloud + rsync + yq) +_archive="$_appname-$pkgver" +source=("$url/archive/v$pkgver/$_archive.tar.gz") +sha256sums=('c3949753b2a0df7bfff5e19e49d34d99235027ea09faf2575847cbadb8298640') + +# BEGIN boilerplate nextcloud app version clamping, see also other packages in group +# 1. Call respective function helpers in check() and package() *after* cd'ing to the source directory +# 2. Add makedepends+=(nextcloud yq) +_phps=(php7 php) +_get_supported_ranges() { + _app_min_nextcloud="$(< appinfo/info.xml xq -r '.info.dependencies.nextcloud["@min-version"] | values')" + _app_max_nextcloud="$(< appinfo/info.xml xq -r '.info.dependencies.nextcloud["@max-version"] | values | tonumber | .+1')" + _app_min_php="$(< appinfo/info.xml xq -r '.info.dependencies.php["@min-version"] | values')" + _app_max_php="$(< appinfo/info.xml xq -r '.info.dependencies.php["@max-version"] | values | tonumber | .+0.1')" +} +_unsupported_range() { + printf "%s requires %s %s, but %s %s is provided.\n" "$pkgname" "$1" "$2" "$1" "$3" + exit 1 +} +_nextcloud_app_check() { + _get_supported_ranges + for _php in "${_phps[@]}"; do command -v "$_php" > /dev/null && break; done + local _nextcloud_ver="$("$_php" <(cat /usr/share/webapps/nextcloud/version.php; echo 'print($OC_VersionString);'))" + local _php_ver="$("$_php" -r 'print(phpversion());')" + [[ "$(vercmp "${_app_min_nextcloud:-0}" "$_nextcloud_ver")" -le 0 ]] || \ + _unsupported_range nextcloud "=> $_app_min_nextcloud" "$_nextcloud_ver" + [[ "$(vercmp "${_app_max_nextcloud:-999}" "$_nextcloud_ver")" -gt 0 ]] || \ + _unsupported_range nextcloud "< $_app_max_nextcloud" "$_nextcloud_ver" + [[ "$(vercmp "${_app_min_php:-0}" "$_php_ver")" -le 0 ]] || \ + _unsupported_range php ">= $_app_min_php" "$_php_ver" + [[ "$(vercmp "${_app_max_php:-999}" "$_php_ver")" -gt 0 ]] || \ + _unsupported_range php "< $_app_max_php" "$_php_ver" +} +_nextcloud_app_package() { + _get_supported_ranges + depends+=("nextcloud>=${_app_min_nextcloud:-0}" "nextcloud<${_app_max_nextcloud:-999}") + depends+=("php-interpreter${_app_min_php:+>=$_app_min_php}" ${_app_max_php:+"php-interpreter<$_app_max_php"}) +} +# END boilerplate nextcloud app version clamping + prepare() { - cd "$_appname-$pkgver" + cd "$_archive" composer install --no-dev -d ./3rdparty/ } +check() { + cd "$_archive" + _nextcloud_app_check +} + package() { - cd "$_appname-$pkgver" + cd "$_archive" + _nextcloud_app_package _appdir="$pkgdir/usr/share/webapps/nextcloud/apps/$_appname" rsync -a --mkpath \ --exclude=.drone.yml \ |