diff --git a/user/freescout/APKBUILD b/user/freescout/APKBUILD index 47de62c..0125bdb 100644 --- a/user/freescout/APKBUILD +++ b/user/freescout/APKBUILD @@ -2,7 +2,7 @@ # Contributor: Antoine Martin (ayakael) pkgname=freescout pkgver=1.8.115 -pkgrel=0 +pkgrel=1 pkgdesc="Free self-hosted help desk & shared mailbox" arch="noarch" url="freescout.net" @@ -26,25 +26,41 @@ build() { package() { local logdir="/var/log/$pkgname" + local datadir="/var/lib/$pkgname" local wwwdir="/usr/share/webapps/$pkgname" local confdir="/etc/$pkgname" # Make directories install -dm 755 \ "$pkgdir"/$wwwdir \ - "$pkgdir"/$confdir + "$pkgdir"/$confdir \ + "$pkgdir"/$logdir \ + "$pkgdir"/$datadir # Copy and ln operations cp $builddir/* -R "$pkgdir"/$wwwdir/. + for i in storage/app storage/framework bootstrap/cache \ + public/css/builds public/js/builds public/modules Modules; do + + if [ -d "$pkgdir"$wwwdir/$i ]; then + if [ ! -d "$pkgdir"/$datadir/${i%/*} ]; then + mkdir -p "$pkgdir"/$datadir/${i%/*} + fi + mv "$pkgdir"$wwwdir/$i "$pkgdir"/$datadir/$i + else + mkdir -p "$pkgdir"/$datadir/$i + fi + ln -s $datadir/$i "$pkgdir"/$wwwdir/$i + done ln -s /etc/freescout/freescout.conf "$pkgdir"/usr/share/webapps/freescout/.env - rm -R "$pkgdir"/$wwwdir/storage/logs - ln -s "$logdir" "$pkgdir"/$wwwdir/storage/logs ln -s $wwwdir/storage/app/public "$pkgdir"/$wwwdir/public/storage + # log dir + rm -R "$pkgdir"/$wwwdir/storage/logs + ln -s "$logdir" "$pkgdir"/$wwwdir/storage/logs + # Permission settings - chown -R root:www-data "$pkgdir"/"$wwwdir" - find "$pkgdir/$wwwdir" -type f -exec chmod 664 {} \; - find "$pkgdir/$wwwdir" -type d -exec chmod 775 {} \; + chown -R freescout:www-data "$pkgdir"/$datadir "$pkgdir"/$logdir # config files install -Dm644 "$srcdir"/freescout.nginx \ diff --git a/user/freescout/freescout.post-install b/user/freescout/freescout.post-install index 0d64b10..3475bcb 100755 --- a/user/freescout/freescout.post-install +++ b/user/freescout/freescout.post-install @@ -18,10 +18,6 @@ if [ "${0##*.}" = 'post-upgrade' ]; then * * freescout-manage migrate * - * You may need to adjust permissions: - * find /usr/share/webapps/freescout -type f -exec chmod 664 {} \; - * find /usr/share/webapps/freescout -type d -exec chmod 775 {} \; - * EOF else cat >&2 <<-EOF @@ -47,10 +43,6 @@ else * * freescout-manage freescout:create-user * - * You may need to adjust permissions: - * find /usr/share/webapps/freescout -type f -exec chmod 664 {} \; - * find /usr/share/webapps/freescout -type d -exec chmod 775 {} \; - * EOF fi