blob: 1670fe7220fca2abcfb5933096962b7510595fec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# Maintainer: Gilrain <gilrain+libre.arch A_T castelmo DOT_ re>
# Contributor: Sergej Pupykin <arch+pub@sergej.pp.ru>
# Contributor: David Runge <dave@sleepmap.de>
_name=files_antivirus
pkgname=nextcloud-app-files-antivirus
pkgver=5.6.1
pkgrel=1
pkgdesc="Antivirus app for Nextcloud"
arch=(any)
url="https://github.com/nextcloud/files_antivirus"
license=(AGPL-3.0-or-later)
depends=(clamav)
makedepends=(nextcloud yq)
groups=(nextcloud-apps)
options=(!strip)
source=(${pkgname}-${pkgver}.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz)
sha256sums=('66eab5c357c0fa6784821c2e7b6f0a2e5114354c783f28a04c32fa53dc7745d2')
b2sums=('2f6ebb089d7250b16c4278c208d9df989c3ef630719c7227cf6ee5ae4a78878a6a901c876dd252bec8d217aa1992677f5458f3adfe24930e85d94029aaa6f25e')
# 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=(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-$pkgver
_nextcloud_app_check
}
package() {
install -d "$pkgdir/usr/share/webapps/nextcloud/apps"
cp -av $_name-$pkgver "$pkgdir/usr/share/webapps/nextcloud/apps/"
cd $_name-$pkgver
_nextcloud_app_package
}
|