summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergej Pupykin2022-06-25 00:10:31 +0300
committerSergej Pupykin2022-06-25 00:10:31 +0300
commit3b53fd5542c50fb5ecd5df21f2c79d3c7bd5b322 (patch)
tree6fe7fc0f66d24c04e0677bdafab94e6fe511aba1
parent53d12882fcbe353f547acc2e965a868a6362857b (diff)
downloadaur-3b53fd5542c50fb5ecd5df21f2c79d3c7bd5b322.tar.gz
upd
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD82
2 files changed, 89 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8aa7d018ec39..ec2db03d972c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,22 @@
pkgbase = nextcloud-app-gpxpod
pkgdesc = view gpx tracks
- pkgver = 4.2.8
+ pkgver = 4.3.0
pkgrel = 1
url = https://gitlab.com/eneiluj/gpxpod-oc
arch = any
license = GPL
+ makedepends = nextcloud
+ makedepends = php
+ makedepends = ripgrep
+ makedepends = yq
depends = nextcloud
options = !strip
- source = https://gitlab.com/eneiluj/gpxpod-oc/-/wikis/uploads/630aee117900664644669890e6693383/gpxpod-4.2.8.tar.gz
- sha256sums = 84165aafbb61436a34741b6bbffe5b9328ad42bc17134d0167ee75fe470987ec
+ source = https://gitlab.com/eneiluj/gpxpod-oc/-/wikis/uploads/89555a30934ebbe34c3a515aabd1781a/gpxpod-4.3.0.tar.gz
+ sha256sums = 248c467cae7a82aef466f4e0de335ac6ee05cd06fab9178717f4afd30a8e810a
pkgname = nextcloud-app-gpxpod
-
+ depends = nextcloud>=
+ depends = nextcloud<
+ depends = php-interpreter>=
+ depends = php-interpreter<
+ depends = php-interpreter
diff --git a/PKGBUILD b/PKGBUILD
index 9ef1c2149e39..c1693a14ed90 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,19 +2,91 @@
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
pkgname=nextcloud-app-gpxpod
-pkgver=4.2.8
+pkgver=4.3.0
+_name=gpxpod
pkgrel=1
pkgdesc="view gpx tracks"
arch=('any')
url="https://gitlab.com/eneiluj/gpxpod-oc"
license=('GPL')
depends=('nextcloud')
+makedepends=('nextcloud' 'php' 'ripgrep' 'yq')
options=('!strip')
#source=("https://gitlab.com/eneiluj/gpxpod-oc/-/archive/v$pkgver/gpxpod-oc-v$pkgver.tar.gz")
-source=("https://gitlab.com/eneiluj/gpxpod-oc/-/wikis/uploads/630aee117900664644669890e6693383/gpxpod-$pkgver.tar.gz")
-sha256sums=('84165aafbb61436a34741b6bbffe5b9328ad42bc17134d0167ee75fe470987ec')
+source=("https://gitlab.com/eneiluj/gpxpod-oc/-/wikis/uploads/89555a30934ebbe34c3a515aabd1781a/gpxpod-$pkgver.tar.gz")
+sha256sums=('248c467cae7a82aef466f4e0de335ac6ee05cd06fab9178717f4afd30a8e810a')
+
+_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() {
- install -d "${pkgdir}"/usr/share/webapps/nextcloud/apps
- cp -a "${srcdir}"/gpxpod "${pkgdir}"/usr/share/webapps/nextcloud/apps/gpxpod
+ _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}"/gpxpod "${pkgdir}"/usr/share/webapps/nextcloud/apps/gpxpod
+ rm -rf "${pkgdir}"/usr/share/webapps/nextcloud/apps/gpxpod/.idea/
}