1 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
2 # Contributor: Caleb Maclennan <caleb@alerque>
5 pkgname=nextcloud-app-bookmarks
9 pkgdesc="Bookmarks app for nextcloud"
11 url="https://github.com/nextcloud/bookmarks"
13 makedepends=(nextcloud yq)
14 groups=(nextcloud-apps)
16 source=(https://github.com/nextcloud/$_name/releases/download/v$pkgver/$_name-$pkgver.tar.gz)
17 sha256sums=('ec6c7c7bc0b6743901ff7f5e00628e2eb3f762455b1a47cf2a9401782695fdc1')
18 b2sums=('0b653ab78a743d804c47e2c16ed2418760bc9ea95ef364ddd15619d462a551aaec72fbca6654ecba9d29ce8218ff70ee65614bfc0f8cda44591cacc5549a0b1d')
20 # BEGIN boilerplate nextcloud app version clamping, see also other packages in group
21 # 1. Call respective function helpers in check() and package() *after* cd'ing to the source directory
22 # 2. Add makedepends+=(nextcloud yq)
23 _phps=(php php-legacy)
24 _get_supported_ranges() {
25 _app_min_nextcloud="$(< appinfo/info.xml xq -r '.info.dependencies.nextcloud["@min-version"] | values')"
26 _app_max_nextcloud="$(< appinfo/info.xml xq -r '.info.dependencies.nextcloud["@max-version"] | values | tonumber | .+1')"
27 _app_min_php="$(< appinfo/info.xml xq -r '.info.dependencies.php["@min-version"] | values')"
28 _app_max_php="$(< appinfo/info.xml xq -r '.info.dependencies.php["@max-version"] | values | tonumber | .+0.1')"
30 _unsupported_range() {
31 printf "%s requires %s %s, but %s %s is provided.\n" "$pkgname" "$1" "$2" "$1" "$3"
34 _nextcloud_app_check() {
36 for _php in "${_phps[@]}"; do command -v "$_php" > /dev/null && break; done
37 local _nextcloud_ver="$("$_php" <(cat /usr/share/webapps/nextcloud/version.php; echo 'print($OC_VersionString);'))"
38 local _php_ver="$("$_php" -r 'print(phpversion());')"
39 [[ "$(vercmp "${_app_min_nextcloud:-0}" "$_nextcloud_ver")" -le 0 ]] || \
40 _unsupported_range nextcloud "=> $_app_min_nextcloud" "$_nextcloud_ver"
41 [[ "$(vercmp "${_app_max_nextcloud:-999}" "$_nextcloud_ver")" -gt 0 ]] || \
42 _unsupported_range nextcloud "< $_app_max_nextcloud" "$_nextcloud_ver"
43 [[ "$(vercmp "${_app_min_php:-0}" "$_php_ver")" -le 0 ]] || \
44 _unsupported_range php ">= $_app_min_php" "$_php_ver"
45 [[ "$(vercmp "${_app_max_php:-999}" "$_php_ver")" -gt 0 ]] || \
46 _unsupported_range php "< $_app_max_php" "$_php_ver"
48 _nextcloud_app_package() {
50 depends+=("nextcloud>=${_app_min_nextcloud:-0}" "nextcloud<${_app_max_nextcloud:-999}")
51 depends+=("php-interpreter${_app_min_php:+>=$_app_min_php}" ${_app_max_php:+"php-interpreter<$_app_max_php"})
53 # END boilerplate nextcloud app version clamping
61 install -d "$pkgdir/usr/share/webapps/nextcloud/apps"
62 cp -av $_name "$pkgdir/usr/share/webapps/nextcloud/apps/"
64 _nextcloud_app_package