[arch-commits] Commit in nextcloud-app-news/trunk (PKGBUILD)
David Runge
dvzrv at gemini.archlinux.org
Mon Mar 14 00:08:51 UTC 2022
Date: Monday, March 14, 2022 @ 00:08:50
Author: dvzrv
Revision: 1151922
upgpkg: nextcloud-app-news 18.0.0-1: Upgrade to 18.0.0.
Add check and automatic setting of php lower and upper boundary.
Modified:
nextcloud-app-news/trunk/PKGBUILD
----------+
PKGBUILD | 38 +++++++++++++++++++++++++++++++++-----
1 file changed, 33 insertions(+), 5 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2022-03-14 00:08:13 UTC (rev 1151921)
+++ PKGBUILD 2022-03-14 00:08:50 UTC (rev 1151922)
@@ -3,7 +3,7 @@
pkgname=nextcloud-app-news
_name=news
-pkgver=17.0.1
+pkgver=18.0.0
pkgrel=1
pkgdesc="An RSS/Atom feed aggregator"
arch=(any)
@@ -10,9 +10,9 @@
url="https://github.com/nextcloud/news"
license=(AGPL3)
makedepends=(nextcloud ripgrep yq)
-source=("$pkgname-$pkgver.tar.gz::https://github.com/nextcloud/${_name}/releases/download/${pkgver}/${_name}.tar.gz")
-sha512sums=('17e5404196a22b2ee932c24cbffd9315b735005d6dcd27304bd9ac9d14afc821c072881403598b3fb50117080e22f8bb5a6d61b1d5494fe161c204978efd8496')
-b2sums=('ae15022de9bc5190296efffeb8e62b7a31fd664401854414464a253873db6587745f8b5c68ff37cfae36a850374b05f768b10c59f494fb3dfc82b1dc0c5580fc')
+source=($pkgname-$pkgver.tar.gz::https://github.com/nextcloud/$_name/releases/download/$pkgver/$_name.tar.gz)
+sha512sums=('1fe771b9ba57df779f703f78a8c8ad9255219dd8cb32d99c0f0cdab49764b196d7bd737e62b8535e331d776a66be1d13e944f32acbfc766ca960207ffd9a5a6c')
+b2sums=('9e2fc942739461113e8e30af3df79164141e961501e6325b957ede37ea99eb42c506b5e08e2ffcaf5d2e2a9a6ae6bb7419ef5af29c842179c28905e40bfdf10c')
_get_nextcloud_versions() {
_app_min_major_version="$(xq '.info.dependencies.nextcloud["@min-version"]' "${_name}/appinfo/info.xml"| sed 's/"//g')"
@@ -20,10 +20,16 @@
_app_max_major_version=$(expr ${_app_max_major_version} + 1)
}
+_get_php_versions() {
+ _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')"
+}
+
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
@@ -30,12 +36,34 @@
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="$(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 >= %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 <= %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}")
+ depends=(
+ "nextcloud>=${_app_min_major_version}"
+ "nextcloud<${_app_max_major_version}"
+ "php>=$_app_min_php"
+ )
+ if [[ "$_app_max_php" != 'null' ]]; then
+ depends+=(
+ "php<=$_app_max_php"
+ )
+ fi
install -vdm 755 "${pkgdir}/usr/share/webapps/nextcloud/apps"
cp -av "${_name}" "${pkgdir}/usr/share/webapps/nextcloud/apps/"
More information about the arch-commits
mailing list