Date: Sunday, May 8, 2022 @ 19:54:42 Author: dvzrv Revision: 1196292 upgpkg: nextcloud-app-bookmarks 1:10.3.1-3: Rebuild to add versioned dependency constraint on php-interpreter.
Modified: nextcloud-app-bookmarks/trunk/PKGBUILD ----------+ PKGBUILD | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-05-08 19:45:06 UTC (rev 1196291) +++ PKGBUILD 2022-05-08 19:54:42 UTC (rev 1196292) @@ -4,7 +4,7 @@ _name=bookmarks epoch=1 pkgver=10.3.1 -pkgrel=2 +pkgrel=3 pkgdesc="Bookmarks app for nextcloud" arch=(any) url="https://github.com/nextcloud/bookmarks" @@ -24,11 +24,25 @@ } _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 @@ -39,6 +53,18 @@ 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_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 + fi } package() { @@ -48,16 +74,16 @@ depends=("nextcloud>=${_app_min_major_version}" "nextcloud<${_app_max_major_version}") if [[ "$_app_min_php" != 'null' ]]; then depends+=( - "php>=$_app_min_php" + "php-interpreter>=$_app_min_php" ) fi if [[ "$_app_max_php" != 'null' ]]; then depends+=( - "php<=$_app_max_php" + "php-interpreter<$_app_max_php" ) fi if [[ "$_app_min_php" == 'null' ]] && [[ "$_app_max_php" == 'null' ]]; then - depends+=(php) + depends+=(php-interpreter) fi install -d "$pkgdir"/usr/share/webapps/nextcloud/apps
