[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - debian/changelog debian/control debian/loolwsd.postinst.in debian/loolwsd.postrm debian/loolwsd.service debian/rules loolwsd.init.rhel6 loolwsd.init.sle11 loolwsd.service loolwsd.spec.in
Andras Timar
andras.timar at collabora.com
Thu Nov 16 17:40:38 UTC 2017
debian/changelog | 6 +
debian/control | 4 -
debian/loolwsd.postinst.in | 4 +
debian/loolwsd.postrm | 3
debian/loolwsd.service | 2
debian/rules | 4 -
loolwsd.init.rhel6 | 49 +++++++++++++++
loolwsd.init.sle11 | 68 +++++++++++++++++++++
loolwsd.service | 2
loolwsd.spec.in | 143 ++++++++++++++++++++++++++++++++++-----------
10 files changed, 245 insertions(+), 40 deletions(-)
New commits:
commit 18c3063bf3d641b7cf87c2dfa0be21b7517ab735
Author: Andras Timar <andras.timar at collabora.com>
Date: Thu Nov 16 18:08:41 2017 +0100
forward-ported packaging bits from 2.1
Change-Id: I848ae9e36a0bea852c743eb67e8a6180a5421ba7
diff --git a/debian/changelog b/debian/changelog
index 56cbc556..9eb4ec64 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+loolwsd (3.0.0-1) unstable; urgency=medium
+
+ * see the git log: http://col.la/cool30
+
+ -- Andras Timar <andras.timar at collabora.com> Thu, 16 Nov 2017 17:20:00 +0100
+
loolwsd (1.8.2-1) unstable; urgency=medium
* Fix crash in Impress.
diff --git a/debian/control b/debian/control
index b89cb7ca..158bae8a 100644
--- a/debian/control
+++ b/debian/control
@@ -2,13 +2,13 @@ Source: loolwsd
Section: web
Priority: optional
Maintainer: Tor Lillqvist <tml at collabora.com>
-Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5), linux-libc-dev
+Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5)
Standards-Version: 3.9.7
Package: loolwsd
Section: web
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, fontconfig, libsm6, libssl1.0.0, libodbc1, libxinerama1, libcairo2, libgl1-mesa-glx, libcups2, libdbus-glib-1-2, cpio, libcap2-bin, ${lo:Depends}
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, fontconfig, libsm6, libodbc1, libxinerama1, libcairo2, libgl1-mesa-glx, libcups2, libdbus-glib-1-2, cpio, libcap2-bin, collaboraofficebasis5.3-calc (>= 5.3.10.31), collaboraofficebasis5.3-core (>= 5.3.10.31), collaboraofficebasis5.3-graphicfilter (>= 5.3.10.31), collaboraofficebasis5.3-images (>= 5.3.10.31), collaboraofficebasis5.3-impress (>= 5.3.10.31), collaboraofficebasis5.3-ooofonts (>= 5.3.10.31), collaboraofficebasis5.3-writer (>= 5.3.10.31), collaboraoffice5.3 (>= 5.3.10.31), collaboraoffice5.3-ure (>= 5.3.10.31), collaboraofficebasis5.3-en-us (>= 5.3.10.31), collaboraofficebasis5.3-en-us-calc (>= 5.3.10.31), collaboraofficebasis5.3-en-us-res (>= 5.3.10.31), collaboraofficebasis5.3-noto-fonts (>= 5.3.10.31), collaboraofficebasis5.3-draw (>= 5.3.10.31), collaboraofficebasis5.3-extension-pdf-import (>= 5.3.10.31)
Description: LibreOffice Online WebSocket Daemon
LOOLWSD is a daemon that talks to web browser clients and provides LibreOffice
services.
diff --git a/debian/loolwsd.postinst.in b/debian/loolwsd.postinst.in
index 59e4f898..d15baafe 100755
--- a/debian/loolwsd.postinst.in
+++ b/debian/loolwsd.postinst.in
@@ -25,6 +25,10 @@ case "$1" in
fc-cache @LO_PATH@/share/fonts/truetype
su lool --shell=/bin/sh -c "loolwsd-systemplate-setup /opt/lool/systemplate @LO_PATH@ >/dev/null 2>&1"
+ cat << EOF > /etc/apt/apt.conf.d/25loolwsd
+// Rebuild systemplate of LibreOffice Online
+DPkg::Post-Invoke { "echo Updating loolwsd systemplate;su lool --shell=/bin/sh -c 'loolwsd-systemplate-setup /opt/lool/systemplate @LO_PATH@ >/dev/null 2>&1'"; };
+EOF
;;
esac
diff --git a/debian/loolwsd.postrm b/debian/loolwsd.postrm
new file mode 100755
index 00000000..d4e1fd99
--- /dev/null
+++ b/debian/loolwsd.postrm
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+rm /etc/apt/apt.conf.d/25loolwsd
diff --git a/debian/loolwsd.service b/debian/loolwsd.service
index d43d5907..2a7125ed 100644
--- a/debian/loolwsd.service
+++ b/debian/loolwsd.service
@@ -4,7 +4,7 @@ After=network.target
[Service]
EnvironmentFile=-/etc/sysconfig/loolwsd
-ExecStart=/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
+ExecStart=/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.3 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
User=lool
KillMode=control-group
Restart=always
diff --git a/debian/rules b/debian/rules
index 976dbde7..6a278ba8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,7 +23,3 @@ override_dh_auto_test:
override_dh_installinit:
# no init.d scripts here, assume systemd
-
-override_dh_gencontrol:
- # put package names of LibreOffice here
- # dh_gencontrol -- -Vlo:Depends=""
diff --git a/loolwsd.init.rhel6 b/loolwsd.init.rhel6
new file mode 100644
index 00000000..7c231e16
--- /dev/null
+++ b/loolwsd.init.rhel6
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# chkconfig: 35 90 12
+# description: loolwsd server
+#
+
+# Get function from functions library
+. /etc/init.d/functions
+
+# Start the service loolwsd
+start() {
+ echo -n $"Starting loolwsd server: "
+ su lool -c "/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.3 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd --o:logging.file[@enable]=true" &
+ ### Create the lock file ###
+ touch /var/lock/subsys/loolwsd
+ success $"loolwsd server startup"
+ echo
+}
+
+# Stop the service loolwsd
+stop() {
+ echo -n $"Stopping loolwsd server: "
+ killproc loolwsd
+ ### Now, delete the lock file ###
+ rm -f /var/lock/subsys/loolwsd
+ echo
+}
+
+### main logic ###
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status loolwsd
+ ;;
+ restart|reload|condrestart)
+ stop
+ start
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/loolwsd.init.sle11 b/loolwsd.init.sle11
new file mode 100644
index 00000000..92440748
--- /dev/null
+++ b/loolwsd.init.sle11
@@ -0,0 +1,68 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: loolwsd
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 4 6
+# Short-Description: LibreOffice Online Websocket Daemon
+# Description: LibreOffice Online Websocket Daemon
+### END INIT INFO
+
+RETVAL=0
+prog="loolwsd"
+
+# Source function library.
+. /etc/rc.status
+rc_reset
+
+LOOLWSD=/usr/bin/loolwsd
+PID_FILE=/var/run/loolwsd.pid
+
+case "$1" in
+ start)
+ echo -n "Starting $prog "
+ /sbin/startproc -u lool -p $PID_FILE $LOOLWSD --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.3 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd --o:logging.file[@enable]=true 2>/dev/null
+ rc_status -v
+ ;;
+
+ stop)
+ echo -n "Shutting down $prog "
+ /sbin/killproc -p $PID_FILE $LOOLWSD -TERM
+ rc_status -v
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ rc_status
+ ;;
+
+ reload)
+ echo -n "Reload service $prog "
+ killproc $LOOLWSD -HUP
+ rc_status -v
+ ;;
+
+ force-reload)
+ $0 reload
+ ;;
+
+ status)
+ echo -n "Checking for service $prog"
+ /sbin/checkproc $LOOLWSD
+ rc_status -v
+ ;;
+
+ condrestart|try-restart)
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset # Not running is not a failure.
+ fi
+ rc_status
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+ exit 1
+esac
+rc_exit
diff --git a/loolwsd.service b/loolwsd.service
index d43d5907..2a7125ed 100644
--- a/loolwsd.service
+++ b/loolwsd.service
@@ -4,7 +4,7 @@ After=network.target
[Service]
EnvironmentFile=-/etc/sysconfig/loolwsd
-ExecStart=/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
+ExecStart=/usr/bin/loolwsd --version --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.3 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
User=lool
KillMode=control-group
Restart=always
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index f7355b17..2ee3555a 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -13,37 +13,68 @@ Name: loolwsd
%endif
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
-Vendor: %{vendor}
-Summary: LibreOffice Online WebSocket Daemon
+%if 0%{?suse_version} == 1110
+Group: Productivity/Office/Suite
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+%endif
+Vendor: Collabora
+Summary: LibreOffice On-Line WebSocket Daemon
License: MPL
Source0: loolwsd- at PACKAGE_VERSION@.tar.gz
BuildRequires: libcap-devel libpng-devel poco-devel >= 1.7.5
+
+# Red Hat and CentOS
%if 0%{?fedora} || 0%{?rhel} >= 7
BuildRequires: libpcap kernel-headers
-%else
-%if 0%{?suse_version}
+%endif
+
+# openSUSE and SLES12
+%if 0%{?suse_version} >= 1300
BuildRequires: libcap-progs linux-glibc-devel systemd-rpm-macros
%endif
+
+# SLES11SP4
+%if 0%{?suse_version} == 1110
+BuildRequires: libcap-progs
%endif
-Requires: %{lo_rpm_list}
-Requires: systemd
+Requires: collaboraoffice5.3 >= 5.3.10.31 collaboraoffice5.3-ure >= 5.3.10.31 collaboraofficebasis5.3-core >= 5.3.10.31 collaboraofficebasis5.3-writer >= 5.3.10.31 collaboraofficebasis5.3-impress >= 5.3.10.31 collaboraofficebasis5.3-graphicfilter >= 5.3.10.31 collaboraofficebasis5.3-en-US >= 5.3.10.31 collaboraofficebasis5.3-calc >= 5.3.10.31 collaboraofficebasis5.3-en-US-res >= 5.3.10.31 collaboraofficebasis5.3-en-US-calc >= 5.3.10.31 collaboraofficebasis5.3-ooofonts >= 5.3.10.31 collaboraofficebasis5.3-images >= 5.3.10.31 collaboraofficebasis5.3-noto-fonts >= 5.3.10.31 collaboraofficebasis5.3-draw >= 5.3.10.31 collaboraofficebasis5.3-extension-pdf-import >= 5.3.10.31
Requires(post): coreutils grep sed
+%if 0%{?rhel} == 6
+# loolwsd dependencies
+Requires: keyutils-libs krb5-libs libattr libcap libcom_err libgcc libpng libselinux openssl pcre zlib
+Requires: poco-crypto >= 1.7.8 poco-foundation >= 1.7.8 poco-json >= 1.7.8 poco-net >= 1.7.8 poco-netssl >= 1.7.8 poco-util >= 1.7.8 poco-xml >= 1.7.8
+# Collabora Office dependencies (unfortunately Collabora Office RPM packages do not have real dependencies)
+Requires: atk avahi-libs cairo cups-libs dbus-glib dbus-libs expat fontconfig freetype gdk-pixbuf2 glib2 gnutls gstreamer gstreamer-plugins-base gtk2 libdrm libgcc libgcrypt libgpg-error libICE libSM libtasn1 libuuid libX11 libXau libxcb libXcomposite libXcursor libXdamage libXext libXfixes libXi libXinerama libXrandr libXrender libXxf86vm mesa-dri-drivers mesa-libGL pango pixman
+%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
# loolwsd dependencies
+Requires: systemd
Requires: expat keyutils-libs krb5-libs libattr libcap libcom_err libgcc libpng libselinux openssl-libs pcre xz-libs zlib
Requires: poco-crypto >= 1.7.5 poco-foundation >= 1.7.5 poco-json >= 1.7.5 poco-net >= 1.7.5 poco-netssl >= 1.7.5 poco-util >= 1.7.5 poco-xml >= 1.7.5
-# LibreOffice dependencies (unfortunately upstream LibreOffice RPM packages (from TDF) do not have real dependencies)
+# Collabora Office dependencies (unfortunately Collabora Office RPM packages do not have real dependencies)
Requires: atk avahi-glib avahi-libs bzip2-libs cairo cups-libs dbus-glib dbus-libs fontconfig freetype GConf2 gdk-pixbuf2 glib2 gnome-vfs2 graphite2 gstreamer gstreamer-plugins-base gtk2 harfbuzz libdrm libffi libICE libSM libuuid libX11 libXau libxcb libXcomposite libXcursor libXdamage libXext libXfixes libXi libXinerama libXrandr libXrender libxshmfence libXt libXxf86vm mesa-libEGL mesa-libgbm mesa-libGL mesa-libglapi pango pixman
-%else
+%endif
+
%if 0%{?suse_version}
# loolwsd dependencies
Requires(post): libcap-progs
-Requires: libcap2 libopenssl1_0_0 libpng12-0 libpcre1 libz1 %{?systemd_requires} %{fillup_prereq}
-Requires: libPocoCrypto48 >= 1.7.8 libPocoFoundation48 >= 1.7.8 libPocoJSON48 >= 1.7.8 libPocoNet48 >= 1.7.8 libPocoNetSSL48 >= 1.7.8 libPocoUtil48 >= 1.7.8 libPocoXML48 >= 1.7.8
-# LibreOffice dependencies (unfortunately upstream LibreOffice RPM packages (from TDF) do not have real dependencies)
+Requires: libcap2 libpng12-0 %{fillup_prereq}
+Requires: libPocoCrypto49 >= 1.7.9 libPocoFoundation49 >= 1.7.9 libPocoJSON49 >= 1.7.9 libPocoNet49 >= 1.7.9 libPocoNetSSL49 >= 1.7.9 libPocoUtil49 >= 1.7.9 libPocoXML49 >= 1.7.9
+%endif
+
+%if 0%{?suse_version} >= 1300
+Requires: systemd
+Requires: libopenssl1_0_0 libpcre1 libz1
+# Collabora Office dependencies (unfortunately Collabora Office RPM packages do not have real dependencies)
+# cd /opt/collaboraoffice5.3/program ; for i in soffice.bin *.so ;do ldd $i | grep '=>' | sed -e "s/^.*=> //" -e "s/ [(].*$//"; done | sort | uniq | xargs rpm -qf --qf="%{NAME}\n" | sort | uniq | grep -v collaboraoffice
Requires: Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0 cups-libs dbus-1-glib fontconfig libatk-1_0-0 libavahi-client3 libavahi-common3 libavahi-glib1 libbz2-1 libcairo2 libcom_err2 libdbus-1-3 libdrm2 libexpat1 libfreetype6 libgbm1 libgio-2_0-0 libglib-2_0-0 libgmodule-2_0-0 libgobject-2_0-0 libgraphite2-3 libgthread-2_0-0 libgtk-2_0-0 libharfbuzz0 libkeyutils1 liblzma5 libpixman-1-0 libpng16-16 libuuid1 libxml2 libffi4 libgbm1 libICE6 libselinux1 libSM6 libwayland-client0 libwayland-server0 libX11-6 libX11-xcb1 libXau6 libxcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libXdamage1 libXext6 libXfixes3 libXrender1 libxshmfence1 libXxf86vm1
%endif
+
+# SLES11SP4
+%if 0%{?suse_version} == 1110
+Requires: libattr libopenssl0_9_8 pcre zlib
+Requires: cairo cups-libs dbus-1 dbus-1-glib fontconfig freetype2 glibc keyutils-libs krb5 libcom_err2 libdrm libexpat1 libgcc_s1 libgio-2_0-0 libglib-2_0-0 libgmodule-2_0-0 libgobject-2_0-0 libgstinterfaces-0_10-0 libgstreamer-0_10-0 libgthread-2_0-0 libopenssl0_9_8 libpixman-1-0 libpng12-0 libselinux1 libstdc++6 libuuid1 Mesa pcre xorg-x11-libICE xorg-x11-libs xorg-x11-libSM xorg-x11-libX11 xorg-x11-libXau xorg-x11-libxcb xorg-x11-libXext xorg-x11-libXfixes xorg-x11-libXrender zlib
%endif
%if 0%{?name_suffix:1}
Provides: loleaflet = 1.5.8, loolwsd
@@ -64,7 +95,7 @@ Obsoletes: loleaflet <= 1.5.8
%configure \
--enable-silent-rules \
--with-lokit-path=bundled/include \
- --with-lo-path=%{loroot} \
+ --with-lo-path=/opt/collaboraoffice5.3 \
%if 0%{?config_options:1}
%{config_options}
%endif
@@ -76,20 +107,29 @@ env BUILDING_FROM_RPMBUILD=yes make %{?_smp_mflags}
%install
env BUILDING_FROM_RPMBUILD=yes make install DESTDIR=%{buildroot}
-%__install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service
install -d -m 755 %{buildroot}/var/adm/fillup-templates
+%if 0%{?rhel} == 6
+install -d -m 755 %{buildroot}/etc/init.d
+install -D -m 755 loolwsd.init.rhel6 %{buildroot}/etc/init.d/loolwsd
+%endif
+%if 0%{?suse_version} == 1110
+install -d -m 755 %{buildroot}/etc/init.d
+install -D -m 755 loolwsd.init.sle11 %{buildroot}/etc/init.d/loolwsd
+%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
+install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service
install -D -m 644 sysconfig.loolwsd %{buildroot}/etc/sysconfig/loolwsd
-%else
-%if 0%{?suse_version}
-install -D -m 644 sysconfig.loolwsd %{buildroot}/var/adm/fillup-templates
%endif
+%if 0%{?suse_version} >= 1300
+install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service
+install -D -m 644 sysconfig.loolwsd %{buildroot}/var/adm/fillup-templates
%endif
mkdir -p %{buildroot}/etc/cron.d
echo "#Remove old tiles once every 10 days at midnight" > %{buildroot}/etc/cron.d/loolwsd.cron
echo "0 0 */1 * * root find /var/cache/loolwsd -name \"*.png\" -a -atime +10 -exec rm {} \;" >> %{buildroot}/etc/cron.d/loolwsd.cron
%files
+%defattr(-,root,root,-)
/usr/bin/loolwsd
/usr/bin/loolwsd-systemplate-setup
/usr/bin/loolmap
@@ -106,13 +146,16 @@ echo "0 0 */1 * * root find /var/cache/loolwsd -name \"*.png\" -a -atime +10 -ex
/usr/share/doc/loolwsd/README.vars
/usr/share/doc/loolwsd/protocol.txt
/usr/share/doc/loolwsd/reference.txt
-%{_unitdir}/loolwsd.service
+%if 0%{?rhel} == 6 || 0%{?suse_version} == 1110
+/etc/init.d/loolwsd
+%endif
%if 0%{?fedora} || 0%{?rhel} >= 7
+%{_unitdir}/loolwsd.service
%config(noreplace) /etc/sysconfig/loolwsd
-%else
-%if 0%{?suse_version}
-/var/adm/fillup-templates/sysconfig.loolwsd
%endif
+%if 0%{?suse_version} >= 1300
+%{_unitdir}/loolwsd.service
+/var/adm/fillup-templates/sysconfig.loolwsd
%endif
%config(noreplace) /etc/cron.d/loolwsd.cron
@@ -122,48 +165,84 @@ echo "0 0 */1 * * root find /var/cache/loolwsd -name \"*.png\" -a -atime +10 -ex
%doc README
%pre
-%if 0%{?suse_version}
+%if 0%{?suse_version} >= 1300
%service_add_pre loolwsd.service
%endif
getent group lool >/dev/null || groupadd -r lool
-getent passwd lool >/dev/null || useradd -g lool -r lool
+getent passwd lool >/dev/null || useradd -g lool -r lool -d /opt/lool -s /bin/bash
-%post
-setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
-setcap cap_sys_admin=ep /usr/bin/loolmount
+# for filename in `find /opt/lool/systemplate -type f`;do stripped=$(echo -ne $filename | sed -e "s|/opt/lool/systemplate||");rpm -qf --qf="%{NAME}\n" $stripped;done | grep -v devel | grep -v 32bit | grep -v -- -fonts | sort | uniq
+%triggerin -- Mesa arts atk atlas avahi-libs cairo cups-filters cups-libs dbus-1 dbus-1-glib dbus-glib dbus-libs dyninst enscript expat font-util fontconfig fonts-config freetype freetype2 gdk-pixbuf2 glib2 glibc glibc-locale gnutls graphviz gstreamer gstreamer-plugins-base gtk2 ifnteuro kernel keyutils-libs krb5 krb5-libs libICE libICE6 libSM libSM6 libX11 libX11-6 libXau libXau6 libXcomposite libXcomposite1 libXcursor libXcursor1 libXdamage libXdamage1 libXext libXext6 libXfixes libXfixes3 libXi libXi6 libXinerama libXinerama1 libXrandr libXrandr2 libXrender libXrender1 libXxf86vm libatk-1_0-0 libavahi-client3 libavahi-common3 libbz2-1 libcairo2 libcap libcap-ng libcap2 libcom_err libcom_err2 libdatrie1 libdbus-1-3 libdrm libexpat1 libffi libffi4 libfreetype6 libgcc libgcc_s1 libgcrypt libgdk_pixbuf-2_0-0 libgio-2_0-0 libglib-2_0-0 libgmodule-2_0-0 libgobject-2_0-0 libgpg-error libgraphite2-3 libgstinterfaces-0_10-0 libgstreamer-0_10-0 libgthread-2_0-0 libgtk-2_0-0 libharfbuzz0 li
biscsi libkeyutils1 liblangtag liblangtag1 libopenssl0_9_8 libopenssl1_0_0 libpango-1_0-0 libpcre1 libpixman-1-0 libpng libpng12 libpng12-0 libpng15-15 libpng16-16 libselinux libselinux1 libstdc++ libstdc++6 libtasn1 libthai0 libuuid libuuid1 libxcb libxcb-render0 libxcb-shm0 libxcb1 libxshmfence libz1 lsb mariadb-libs mesa-dri-drivers mesa-libEGL mesa-libGL mesa-libgbm mesa-libglapi mysql-libs netcfg nss-mdns nss-softokn-freebl openssl-libs pango pcre pixman qt3 redhat-lsb-core samba-client samba-winbind samba-winbind-clients setup sssd sssd-client systemd-libs timezone tzdata xorg-x11-libICE xorg-x11-libSM xorg-x11-libX11 xorg-x11-libXau xorg-x11-libXext xorg-x11-libXfixes xorg-x11-libXrender xorg-x11-libs xorg-x11-libxcb xterm xulrunner zlib
-mkdir -p /var/cache/loolwsd && chown lool:lool /var/cache/loolwsd
-rm -rf /var/cache/loolwsd/*
+echo -ne "Triggered update of loolwsd systemplate..."
+
+%if 0%{?rhel} == 6
+if [ -f /var/lock/subsys/loolwsd ]; then LOOLWSD_IS_ACTIVE=1; else LOOLWSD_IS_ACTIVE=0; fi
+%endif
+
+%if 0%{?suse_version} == 1110
+if [ -f /var/run/loolwsd.pid ]; then LOOLWSD_IS_ACTIVE=1; else LOOLWSD_IS_ACTIVE=0; fi
+%endif
+
+%if 0%{?rhel} == 6 || 0%{?suse_version} == 1110
+if [ $LOOLWSD_IS_ACTIVE == "1" ]; then /etc/init.d/loolwsd stop; fi
+%endif
+
+%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1300
+systemctl is-active -q loolwsd && LOOLWSD_IS_ACTIVE=1 || LOOLWSD_IS_ACTIVE=0
+if [ $LOOLWSD_IS_ACTIVE == "1" ]; then systemctl stop loolwsd; fi
+%endif
# Figure out where LO is installed, let's hope it is not a mount point
# Create a directory for loolwsd on the same file system
-loroot=%{loroot}
+loroot=/opt/collaboraoffice5.3
loolparent=`cd ${loroot} && cd .. && /bin/pwd`
rm -rf ${loolparent}/lool
mkdir -p ${loolparent}/lool/child-roots
+
chown lool:lool ${loolparent}/lool
chown lool:lool ${loolparent}/lool/child-roots
fc-cache ${loroot}/share/fonts/truetype
su lool -c "loolwsd-systemplate-setup ${loolparent}/lool/systemplate ${loroot} >/dev/null 2>&1"
+%if 0%{?rhel} == 6 || 0%{?suse_version} == 1110
+if [ $LOOLWSD_IS_ACTIVE == "1" ]; then /etc/init.d/loolwsd start; fi
+%endif
+
+%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1300
+if [ $LOOLWSD_IS_ACTIVE == "1" ]; then systemctl start loolwsd; fi
+%endif
+
+echo " Done."
+
+%post
+setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
+setcap cap_sys_admin=ep /usr/bin/loolmount
+
+mkdir -p /var/cache/loolwsd && chown lool:lool /var/cache/loolwsd
+rm -rf /var/cache/loolwsd/*
+
+%if 0%{?rhel} == 6 || 0%{?suse_version} == 1110
+touch /var/log/loolwsd.log && chown lool:lool /var/log/loolwsd.log
+%endif
+
%if 0%{?fedora} || 0%{?rhel} >= 7
%systemd_post loolwsd.service
%else
-%if 0%{?suse_version}
+%if 0%{?suse_version} >= 1300
%service_add_post loolwsd.service
%{fillup_only -n loolwsd}
%endif
%endif
-
%preun
%if 0%{?fedora} || 0%{?rhel} >= 7
%systemd_preun loolwsd.service
%else
-%if 0%{?suse_version}
+%if 0%{?suse_version} >= 1300
%service_del_preun loolwsd.service
%endif
%endif
@@ -172,7 +251,7 @@ su lool -c "loolwsd-systemplate-setup ${loolparent}/lool/systemplate ${loroot} >
%if 0%{?fedora} || 0%{?rhel} >= 7
%systemd_postun loolwsd.service
%else
-%if 0%{?suse_version}
+%if 0%{?suse_version} >= 1300
%service_del_postun loolwsd.service
%endif
%endif
More information about the Libreoffice-commits
mailing list