diff options
author | Narrat | 2023-06-28 17:56:01 +0200 |
---|---|---|
committer | Narrat | 2023-06-28 17:56:01 +0200 |
commit | 0f096e23fbeb341203186625d49aaad89fa5b8b9 (patch) | |
tree | 082c8c69acf50ecf70843927eaa84c743eefdd03 /PKGBUILD | |
parent | d1d4e9c592eeace9b9b8b8490b75d2997ea0bfe5 (diff) | |
download | aur-nextcloud-app-ocdownloader.tar.gz |
nextcloud-app-ocdownloader: update to 1.9.1
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 73 |
1 files changed, 54 insertions, 19 deletions
@@ -1,32 +1,67 @@ -# Maintainer: Anty0 <anty150 at gmail dot com> +# Contributor: Anty0 <anty150 at gmail dot com> - -# Helper variables for updaurpkg (https://aur.archlinux.org/packages/updaurpkg-git) -_nextcloud_appname='ocdownloader' -_upstreamver='1.8.0' -_upstreamver_regex='^[0-9]+\.[0-9]+\.[0-9]+$' -_source_type='github-releases' -_repo='e-alfred/ocdownloader' - - -pkgdesc='Easy to use download manager using Curl/Aria2 and youtube-dl for Nextcloud' +_name='ocdownloader' pkgname=('nextcloud-app-ocdownloader') -pkgver="${_upstreamver}" +pkgver=1.9.1 pkgrel=1 +pkgdesc='Easy to use download manager using Curl/Aria2 and youtube-dl for Nextcloud' arch=('any') license=('AGPL3') -url="https://github.com/${_repo}" -makedepends=() -depends=('nextcloud') +url="https://github.com/e-alfred/ocdownloader" +makedepends=('nextcloud' 'yq') optdepends=( 'aria2: To use aria2 as download manager' 'curl: To download files using curl' 'youtube-dl: To download videos') options=('!strip') -source=("${_nextcloud_appname}-v${pkgver}.tar.gz::${url}/releases/download/${pkgver}/${_nextcloud_appname}-${pkgver}.tar.gz") -sha512sums=('7dba9e87df471c1c5adaa5ce7ff33524b005cf221758146af1fdd82d82337cda558c3b3bd0709ca60b3942def6c678830bea42ad27eb628c5008249b8ad5f5af') +source=("${_name}-v${pkgver}.tar.gz::${url}/releases/download/${pkgver}/${_name}-${pkgver}.tar.gz") +sha512sums=('45f7ff16c39ab85f5134bc0a0b557302a93ed49c9897dbf5ae595f6938017531f96f6969f79852cb296f28768d418008b266492e36c6803a6a535206f703b1f9') + + +# 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 php-legacy) +_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 -d "${pkgdir}/usr/share/webapps/nextcloud/apps" - cp -a "${srcdir}/${_nextcloud_appname}" "${pkgdir}/usr/share/webapps/nextcloud/apps/${_nextcloud_appname}" + install -vdm 755 "$pkgdir/usr/share/webapps/nextcloud/apps/" + cp -av $_name "$pkgdir/usr/share/webapps/nextcloud/apps/" + cd $_name + _nextcloud_app_package } + |