[arch-commits] Commit in nextcloud-app-spreed/repos/community-any (PKGBUILD PKGBUILD)
David Runge
dvzrv at gemini.archlinux.org
Mon Jun 13 19:59:40 UTC 2022
Date: Monday, June 13, 2022 @ 19:59:40
Author: dvzrv
Revision: 1237816
archrelease: copy trunk to community-any
Added:
nextcloud-app-spreed/repos/community-any/PKGBUILD
(from rev 1237815, nextcloud-app-spreed/trunk/PKGBUILD)
Deleted:
nextcloud-app-spreed/repos/community-any/PKGBUILD
----------+
PKGBUILD | 163 +++++++++++++++++++++++--------------------------------------
1 file changed, 64 insertions(+), 99 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2022-06-13 19:59:32 UTC (rev 1237815)
+++ PKGBUILD 2022-06-13 19:59:40 UTC (rev 1237816)
@@ -1,99 +0,0 @@
-# Maintainer: David Runge <dvzrv at archlinux.org>
-
-_name=spreed
-pkgname=nextcloud-app-spreed
-pkgver=14.0.1
-pkgrel=2
-epoch=1
-pkgdesc="Video & audio-conferencing using WebRTC"
-arch=(any)
-url="https://apps.nextcloud.com/apps/spreed"
-license=(AGPL3)
-groups=(nextcloud-apps)
-makedepends=(nextcloud)
-checkdepends=(ripgrep yq)
-source=(https://github.com/nextcloud-releases/$_name/releases/download/v$pkgver/$_name-v$pkgver.tar.gz)
-sha512sums=('b3467aa5d77900ab8d1a2c302128d06668889212b9598bc455a3ef69fcf5702d4f999df3ac107febe9d6e7b80fd23b3cbec3545e9490238882b329c6a06e3e04')
-b2sums=('bb1e05dd2593ec8f78e7c8fcd8aa3ad1e7fe5bf2aeb4f0336744d90969151e61f3cd946a019ff871773d2d678b6e2e260eb7a69736c77e812c8018d1d17a48eb')
-
-_get_nextcloud_versions() {
- _app_min_major_version="$(xq '.info.dependencies.nextcloud["@min-version"]' "$_name/appinfo/info.xml"| sed 's/"//g')"
- _app_max_major_version="$(xq '.info.dependencies.nextcloud["@max-version"]' "$_name/appinfo/info.xml"| sed 's/"//g')"
- _app_max_major_version=$(expr ${_app_max_major_version} + 1)
-}
-
-_get_php_versions() {
- local _phps=(php7 php)
-
- _app_min_php="$(xq '.info.dependencies.php["@min-version"]' "$_name/appinfo/info.xml"| sed 's/"//g')"
- _app_max_php="$(xq '.info.dependencies.php["@max-version"]' "$_name/appinfo/info.xml"| sed 's/"//g')"
-
- if [[ $_app_max_php != 'null' ]]; then
- _app_max_php="$(echo $_app_max_php | awk -F '.' '{print $1"."$2+1}')"
- fi
-
- _system_php=""
- for _php in "${_phps[@]}"; do
- if command -v "$_php" > /dev/null; then
- if [[ -z "$_system_php" ]]; then
- _system_php="$_php"
- fi
- fi
- done
-}
-
-prepare() {
- find ${_name} -type f -exec chmod 644 {} +
- find ${_name} -type d -exec chmod 755 {} +
-}
-
-check() {
- local _app_min_major_version
- local _app_max_major_version
- _get_nextcloud_versions
- _get_php_versions
- local _nextcloud_major_version="$(rg "OC_Version = " /usr/share/webapps/nextcloud/version.php |cut -d'(' -f2| cut -d ',' -f1)"
-
- if (("$(vercmp "$_nextcloud_major_version" "$_app_min_major_version")"<0)) || (("$(vercmp "$_nextcloud_major_version" "$_app_max_major_version")">0)) ; then
- printf "%s requires nextcloud >= %s/ nextcloud <= %s, but nextcloud %s is provided.\n" "$pkgname" "$_app_min_major_version" "$_app_max_major_version" "$_nextcloud_major_version"
- exit 1
- fi
-
- local _php_version="$($_system_php --version |head -n1 |cut -d ' ' -f2 |sed 's/.[0-9]*$//g')"
- if [[ "$(vercmp "$_php_version" "$_app_min_php" )" -lt 0 ]]; then
- printf "%s requires php-interpreter >= %s, but %s is provided\n" $pkgname $_app_min_php $_php_version
- exit 1
- fi
- if [[ $_app_max_php != 'null' ]]; then
- if [[ "$(vercmp "$_php_version" "$_app_max_php" )" -ge 0 ]]; then
- printf "%s requires php-interpreter < %s, but %s is provided\n" $pkgname $_app_max_php $_php_version
- exit 1
- fi
- fi
-}
-
-package() {
- _get_nextcloud_versions
- _get_php_versions
-
- depends=(
- "nextcloud>=$_app_min_major_version"
- "nextcloud<$_app_max_major_version"
- )
- if [[ "$_app_min_php" != 'null' ]]; then
- depends+=(
- "php-interpreter>=$_app_min_php"
- )
- fi
- if [[ "$_app_max_php" != 'null' ]]; then
- depends+=(
- "php-interpreter<$_app_max_php"
- )
- fi
- if [[ "$_app_min_php" == 'null' ]] && [[ "$_app_max_php" == 'null' ]]; then
- depends+=(php-interpreter)
- fi
-
- install -vdm 755 "$pkgdir/usr/share/webapps/nextcloud/apps/"
- cp -av $_name "$pkgdir/usr/share/webapps/nextcloud/apps/"
-}
Copied: nextcloud-app-spreed/repos/community-any/PKGBUILD (from rev 1237815, nextcloud-app-spreed/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2022-06-13 19:59:40 UTC (rev 1237816)
@@ -0,0 +1,64 @@
+# Maintainer: David Runge <dvzrv at archlinux.org>
+
+_name=spreed
+pkgname=nextcloud-app-spreed
+pkgver=14.0.2
+pkgrel=1
+epoch=1
+pkgdesc="Video & audio-conferencing using WebRTC"
+arch=(any)
+url="https://apps.nextcloud.com/apps/spreed"
+license=(AGPL3)
+groups=(nextcloud-apps)
+makedepends=(nextcloud)
+checkdepends=(ripgrep yq)
+source=(https://github.com/nextcloud-releases/$_name/releases/download/v$pkgver/$_name-v$pkgver.tar.gz)
+sha512sums=('859d7d3040ce13f9cf551492372c6e40adf043ae30504cbc11df7dacbec672d2a263e119324ab765560a522c0840a80d71205f3f4ec66a6e0b65533fc1629060')
+b2sums=('a22d930ff1b4cfb8f6429a4ac5427d488ee45cf11c0a3d627872fba87ec0f770e1d664c83449d086cb0f3cf3ebc250c51af0a6f19983a452f56260a36267fdf1')
+
+# 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
+
+check() {
+ cd $_name
+ _nextcloud_app_check
+}
+
+package() {
+ install -vdm 755 "$pkgdir/usr/share/webapps/nextcloud/apps/"
+ cp -av $_name "$pkgdir/usr/share/webapps/nextcloud/apps/"
+ cd $_name
+ _nextcloud_app_package
+}
More information about the arch-commits
mailing list