[arch-commits] Commit in nextcloud-app-bookmarks/repos (2 files)

David Runge dvzrv at gemini.archlinux.org
Sun May 8 19:56:03 UTC 2022


    Date: Sunday, May 8, 2022 @ 19:56:02
  Author: dvzrv
Revision: 1196293

archrelease: copy trunk to community-staging-any

Added:
  nextcloud-app-bookmarks/repos/community-staging-any/
  nextcloud-app-bookmarks/repos/community-staging-any/PKGBUILD
    (from rev 1196292, nextcloud-app-bookmarks/trunk/PKGBUILD)

----------+
 PKGBUILD |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 91 insertions(+)

Copied: nextcloud-app-bookmarks/repos/community-staging-any/PKGBUILD (from rev 1196292, nextcloud-app-bookmarks/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2022-05-08 19:56:02 UTC (rev 1196293)
@@ -0,0 +1,91 @@
+# Maintainer: Sergej Pupykin <pupykin.s+arch at gmail.com>
+
+pkgname=nextcloud-app-bookmarks
+_name=bookmarks
+epoch=1
+pkgver=10.3.1
+pkgrel=3
+pkgdesc="Bookmarks app for nextcloud"
+arch=(any)
+url="https://github.com/nextcloud/bookmarks"
+license=(AGPL3)
+depends=(nextcloud)
+makedepends=(ripgrep yq)
+groups=(nextcloud-apps)
+options=(!strip)
+source=("$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/bookmarks/releases/download/v$pkgver/bookmarks-$pkgver.tar.gz")
+sha256sums=('96f19ed9e1f7175745b527e1673e53bea0ccc84f212fb0e10330953dffa075c4')
+b2sums=('d1de66aa827594710e2659396db75ef98cbdf15a5cd16d627960eef9930e9613a8bde2fd8338e3df53184f45cb3ab17418b5273e4490ebf324763a623609ab39')
+
+_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
+}
+
+check() {
+  local _app_min_major_version
+  local _app_max_major_version
+  _get_nextcloud_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}")" -lt 0 ]] || [[ "$(vercmp "${_nextcloud_major_version}" "${_app_max_major_version}")" -gt 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_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
+  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 -d "$pkgdir"/usr/share/webapps/nextcloud/apps
+  cp -a "$srcdir"/bookmarks "$pkgdir"/usr/share/webapps/nextcloud/apps/bookmarks
+}



More information about the arch-commits mailing list