user/freescout: moved writable directories to /var/lib #341
2 changed files with 23 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
|||
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
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 \
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue