c9a4d2f6f3
Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: Ic025c5a76c6f27cdf1a6267f24cf8052733f1f24
35 lines
983 B
Bash
35 lines
983 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
configure)
|
|
setcap cap_fowner,cap_chown,cap_mknod,cap_sys_chroot=ep /usr/bin/coolforkit || true
|
|
setcap cap_sys_admin=ep /usr/bin/coolmount || true
|
|
|
|
adduser --quiet --system --group --home /opt/cool cool
|
|
chown cool: /etc/loolwsd/loolwsd.xml
|
|
chmod 640 /etc/loolwsd/loolwsd.xml
|
|
|
|
# We assume that the LibreOffice to be used is built TDF-style
|
|
# and installs in @LO_PATH@, and that /opt/cool is
|
|
# on the same file system
|
|
|
|
rm -rf /opt/cool
|
|
mkdir -p /opt/cool/child-roots
|
|
chown cool: /opt/cool
|
|
chown cool: /opt/cool/child-roots
|
|
|
|
fc-cache @LO_PATH@/share/fonts/truetype
|
|
|
|
loolwsd-systemplate-setup /opt/cool/systemplate @LO_PATH@ >/dev/null 2>&1
|
|
loolwsd-generate-proof-key >/dev/null 2>&1
|
|
cat << EOF > /etc/apt/apt.conf.d/25loolwsd
|
|
// Rebuild systemplate of @APP_NAME@
|
|
DPkg::Post-Invoke { "echo Updating loolwsd systemplate;loolwsd-systemplate-setup /opt/cool/systemplate @LO_PATH@ >/dev/null 2>&1 || true"; };
|
|
EOF
|
|
;;
|
|
|
|
esac
|
|
|
|
#DEBHELPER#
|