[arch-commits] Commit in nextcloud-app-notes/repos/community-any (PKGBUILD PKGBUILD)
David Runge
dvzrv at gemini.archlinux.org
Mon Jul 11 19:14:08 UTC 2022
Date: Monday, July 11, 2022 @ 19:14:07
Author: dvzrv
Revision: 1249632
archrelease: copy trunk to community-any
Added:
nextcloud-app-notes/repos/community-any/PKGBUILD
(from rev 1249631, nextcloud-app-notes/trunk/PKGBUILD)
Deleted:
nextcloud-app-notes/repos/community-any/PKGBUILD
----------+
PKGBUILD | 157 +++++++++++++++++++++++++------------------------------------
1 file changed, 66 insertions(+), 91 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2022-07-11 19:13:59 UTC (rev 1249631)
+++ PKGBUILD 2022-07-11 19:14:07 UTC (rev 1249632)
@@ -1,91 +0,0 @@
-# Maintainer: Sergej Pupykin <arch+pub at sergej.pp.ru>
-# Maintainer: David Runge <dave at sleepmap.de>
-# Contributor: David Runge <dave at sleepmap.de>
-
-pkgname=nextcloud-app-notes
-_name=notes
-pkgver=4.3.1
-pkgrel=2
-pkgdesc="Simple Notes app for Nextcloud"
-arch=('any')
-url="https://github.com/nextcloud/notes"
-license=('AGPL3')
-makedepends=('nextcloud' 'ripgrep' 'yq')
-groups=('nextcloud-apps')
-options=('!strip')
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/nextcloud/notes/releases/download/v${pkgver}/notes.tar.gz")
-sha512sums=('2b21580f2a2a79fac8e46cc6c6ddb564f05469866c816c27f32b2b14f3a1c2dd64cb646735e24c2daec1401fb465dab943b20955e4b388924245a881c1e8dd89')
-
-_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
- _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}")" -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_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 -d "${pkgdir}/usr/share/webapps/nextcloud/apps"
- cp -R "${srcdir}/notes" "${pkgdir}/usr/share/webapps/nextcloud/apps/notes"
-}
Copied: nextcloud-app-notes/repos/community-any/PKGBUILD (from rev 1249631, nextcloud-app-notes/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2022-07-11 19:14:07 UTC (rev 1249632)
@@ -0,0 +1,66 @@
+# Maintainer: Sergej Pupykin <arch+pub at sergej.pp.ru>
+# Maintainer: David Runge <dave at sleepmap.de>
+# Contributor: David Runge <dave at sleepmap.de>
+
+pkgname=nextcloud-app-notes
+_name=notes
+pkgver=4.4.0
+pkgrel=1
+pkgdesc="Simple Notes app for Nextcloud"
+arch=(any)
+url="https://github.com/nextcloud/notes"
+license=(AGPL3)
+makedepends=(nextcloud)
+checkdepends=(yq)
+groups=(nextcloud-apps)
+options=(!strip)
+source=($pkgname-$pkgver.tar.gz::https://github.com/nextcloud/$_name/releases/download/v$pkgver/$_name.tar.gz)
+sha512sums=('d002d675206b91cfc60d3bb766cc7ed05767118851224f857ba2901c2dbfec8f48bcf1f7da9eee65fc03a364a27014bd8f43ab1bda41f953e0549c6eca187454')
+b2sums=('ca150587bccc888bcf76da5bc74959f665084692eab3f859f50315656ff38407682fbb34560c0a5720c6ff5d604d3f10570131fc11cff98603f393083a1e058f')
+
+# 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