aports/community/grommunio-web/APKBUILD
2025-03-28 06:33:40 +00:00

97 lines
3.3 KiB
Text

# Maintainer: Noel Kuntze <noel.kuntze@contauro.com>
pkgname=grommunio-web
pkgver=3.11
pkgrel=0
pkgdesc="Web user interface for grommunio"
# s390x: blocked by grommunio-gromox
arch="noarch !riscv64 !s390x"
url="https://grommunio.com/"
license="AGPL-3.0-only"
options="!check" # No test suite
_php=php83
install="$pkgname.pre-install $pkgname.pre-upgrade"
depends="grommunio-gromox
grommunio-mapi-header-php
$_php
$_php-bcmath
$_php-ctype
$_php-curl
$_php-dom
$_php-gd
$_php-gettext
$_php-mbstring
$_php-openssl
$_php-session
$_php-simplexml
$_php-sodium
$_php-sqlite3
$_php-sysvshm
$_php-zip
"
makedepends="libxml2-utils $_php-gettext npm gettext"
pkgusers="grommunio groweb"
pkggroups="grommunio groweb"
source="https://github.com/grommunio/grommunio-web/archive/refs/tags/grommunio-web-$pkgver.tar.gz
0001-makefile.patch
enforce-npm-lockfile.patch
"
builddir="$srcdir/grommunio-web-grommunio-web-$pkgver"
build() {
make -j1
}
package() {
# webapp
install -dm0755 "$pkgdir"/usr/share/webapps/
cp -rp deploy "$pkgdir"/usr/share/webapps/$pkgname
# license
install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
# nginx conf
sed -i "s@/usr/share/grommunio-web/@/usr/share/webapps/grommunio-web/@" build/grommunio-web.conf
install -Dpm644 build/grommunio-web.conf "$pkgdir"/usr/share/grommunio-common/nginx/locations.d/grommunio-web.conf
sed -i "s@/php-fpm/@/php-fpm${_php#php}/@" build/grommunio-web-upstream.conf
install -Dpm644 build/grommunio-web-upstream.conf "$pkgdir"/usr/share/grommunio-common/nginx/upstreams.d/grommunio-web.conf
# php-fpm
sed -i "s@/php-fpm/@/php-fpm${_php#php}/@" build/pool-grommunio-web.conf
install -Dpm644 build/pool-grommunio-web.conf "$pkgdir"/etc/$_php/php-fpm.d/pool-grommunio-web.conf
# web config
install -Dm644 config.php.dist "$pkgdir"/etc/grommunio-web/config.php
ln -sf "/etc/grommunio-web/config.php" "$pkgdir"/usr/share/webapps/grommunio-web/config.php
rm "$pkgdir"/usr/share/webapps/grommunio-web/config.php.dist
rm "$pkgdir"/usr/share/webapps/grommunio-web/debug.php.dist
# plugin config
for dir in "$pkgdir"/usr/share/webapps/grommunio-web/plugins/*; do
plugindir=$(basename "$dir")
if [ -f "$pkgdir"/usr/share/webapps/grommunio-web/plugins/"$plugindir"/config.php ]; then
mv "$pkgdir"/usr/share/webapps/grommunio-web/plugins/"$plugindir"/config.php "$pkgdir"/etc/grommunio-web/config-"$plugindir".php
ln -s /etc/grommunio-web/config-"$plugindir".php "$pkgdir"/usr/share/webapps/grommunio-web/plugins/"$plugindir"/config.php
fi
done
# create index and temp directories
for i in /var/lib/grommunio-web \
/var/lib/grommunio-web/session \
/var/lib/grommunio-web/sqlite-index \
/var/lib/grommunio-web/tmp; do
install -dm 0770 -g groweb -o groweb "$pkgdir"/$i
done
# store version
echo $pkgver-$pkgrel > "$pkgdir"/usr/share/webapps/grommunio-web/version
}
sha512sums="
971261485c145de7b335ab9526e1d82e33ffa64d12aeb8e046b4bc5cc9e1f1c8c059c50facb7250d98a7f747691e9507395f3a086a7908c9a73da0b23e7ca570 grommunio-web-3.11.tar.gz
5b5099e45e2262b451f36008802b321a06969c302e782fa72024494669346657bcd49a603fcb70615cb485ff499b1da6f4a73af1a6cffa2ac65dcf4e0bacb16e 0001-makefile.patch
5091ab7a2ee3acfb7f0829eb836c7c5e5986bb2a40dc1e70db0f1f3640b155d23c7f17be5ff3065678fef512e5ee9b1985d8c58f40697873b7815f91a3700cc1 enforce-npm-lockfile.patch
"