2015-05-19 06:04:51 -05:00
|
|
|
# spec file for package loolwsd
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 Collabora
|
|
|
|
#
|
2016-04-21 03:14:17 -05:00
|
|
|
# This file is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2016-08-04 18:15:33 -05:00
|
|
|
%if 0%{?name_suffix:1}
|
|
|
|
Name: loolwsd%{name_suffix}
|
|
|
|
%else
|
2015-05-19 06:04:51 -05:00
|
|
|
Name: loolwsd
|
2016-08-04 18:15:33 -05:00
|
|
|
%endif
|
2015-05-20 12:10:17 -05:00
|
|
|
Version: @PACKAGE_VERSION@
|
2020-01-10 05:17:43 -06:00
|
|
|
Release: 1%{?dist}
|
2017-03-20 14:24:50 -05:00
|
|
|
Vendor: %{vendor}
|
2017-02-03 07:28:48 -06:00
|
|
|
Summary: LibreOffice Online WebSocket Daemon
|
2015-05-19 06:04:51 -05:00
|
|
|
License: MPL
|
2015-05-20 12:10:17 -05:00
|
|
|
Source0: loolwsd-@PACKAGE_VERSION@.tar.gz
|
2020-01-10 05:17:43 -06:00
|
|
|
BuildRequires: libcap-devel libpng-devel poco-devel >= 1.7.5 m4
|
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
BuildRequires: libpcap kernel-headers
|
|
|
|
%else
|
2019-12-09 11:09:48 -06:00
|
|
|
%if 0%{?suse_version}
|
2020-01-10 05:17:43 -06:00
|
|
|
BuildRequires: libcap-progs linux-glibc-devel systemd-rpm-macros
|
|
|
|
%endif
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
Requires: %{lo_rpm_list}
|
|
|
|
Requires: systemd
|
2016-04-27 07:32:37 -05:00
|
|
|
Requires(post): coreutils grep sed
|
2020-01-10 05:17:43 -06:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
2016-04-27 07:32:37 -05:00
|
|
|
# loolwsd dependencies
|
2020-01-10 05:17:43 -06:00
|
|
|
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)
|
|
|
|
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
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?suse_version}
|
2016-04-27 07:32:37 -05:00
|
|
|
# loolwsd dependencies
|
|
|
|
Requires(post): libcap-progs
|
2020-01-10 05:17:43 -06:00
|
|
|
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: 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
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
2016-08-05 06:26:52 -05:00
|
|
|
%if 0%{?name_suffix:1}
|
2016-08-04 18:15:33 -05:00
|
|
|
Provides: loleaflet = 1.5.8, loolwsd
|
2016-08-05 06:26:52 -05:00
|
|
|
%else
|
|
|
|
Provides: loleaflet = 1.5.8
|
|
|
|
%endif
|
2016-04-14 10:08:42 -05:00
|
|
|
Obsoletes: loleaflet <= 1.5.8
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2015-05-19 09:04:24 -05:00
|
|
|
%description
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2016-11-02 05:00:50 -05:00
|
|
|
%if 0%{?suse_version}
|
2016-10-28 12:32:07 -05:00
|
|
|
%debug_package
|
2016-11-02 05:00:50 -05:00
|
|
|
%endif
|
2015-05-19 06:04:51 -05:00
|
|
|
%prep
|
2016-08-04 18:15:33 -05:00
|
|
|
%setup -n loolwsd-@PACKAGE_VERSION@
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%build
|
2016-04-08 04:24:52 -05:00
|
|
|
%configure \
|
2017-05-30 06:34:39 -05:00
|
|
|
--enable-silent-rules \
|
2016-04-08 04:24:52 -05:00
|
|
|
--with-lokit-path=bundled/include \
|
2020-01-10 05:17:43 -06:00
|
|
|
--with-lo-path=%{loroot} \
|
2018-02-01 07:49:44 -06:00
|
|
|
--disable-setcap \
|
2016-08-05 06:26:52 -05:00
|
|
|
%if 0%{?config_options:1}
|
|
|
|
%{config_options}
|
2016-04-08 04:24:52 -05:00
|
|
|
%endif
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
make %{?_smp_mflags}
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%check
|
2020-01-10 05:17:43 -06:00
|
|
|
#make check
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%install
|
2020-01-10 05:17:43 -06:00
|
|
|
make install DESTDIR=%{buildroot}
|
|
|
|
%__install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service
|
2015-06-01 11:53:29 -05:00
|
|
|
install -d -m 755 %{buildroot}/var/adm/fillup-templates
|
2020-01-10 05:17:43 -06:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
2016-04-21 03:14:17 -05:00
|
|
|
install -D -m 644 sysconfig.loolwsd %{buildroot}/etc/sysconfig/loolwsd
|
2020-01-10 05:17:43 -06:00
|
|
|
%else
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?suse_version}
|
2015-06-09 14:33:46 -05:00
|
|
|
install -D -m 644 sysconfig.loolwsd %{buildroot}/var/adm/fillup-templates
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
2020-01-10 05:17:43 -06:00
|
|
|
%endif
|
2015-08-03 14:01:11 -05:00
|
|
|
mkdir -p %{buildroot}/etc/cron.d
|
|
|
|
echo "#Remove old tiles once every 10 days at midnight" > %{buildroot}/etc/cron.d/loolwsd.cron
|
2018-05-30 13:03:21 -05:00
|
|
|
echo "0 0 */1 * * root find /var/cache/loolwsd -type f -a -atime +10 -exec rm {} \;" >> %{buildroot}/etc/cron.d/loolwsd.cron
|
2018-01-22 04:57:39 -06:00
|
|
|
mkdir -p %{buildroot}/etc/pam.d
|
|
|
|
echo "auth required pam_unix.so" > %{buildroot}/etc/pam.d/loolwsd
|
|
|
|
echo "account required pam_unix.so" >> %{buildroot}/etc/pam.d/loolwsd
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%files
|
|
|
|
/usr/bin/loolwsd
|
|
|
|
/usr/bin/loolwsd-systemplate-setup
|
2020-04-23 08:55:32 -05:00
|
|
|
/usr/bin/loolwsd-generate-proof-key
|
2016-04-05 08:37:10 -05:00
|
|
|
/usr/bin/loolforkit
|
2018-05-09 05:05:06 -05:00
|
|
|
/usr/bin/loolconvert
|
2017-05-29 09:25:13 -05:00
|
|
|
/usr/bin/loolconfig
|
wsd: faster jail setup via bind-mount
loolmount now works and supports mounting and
unmounting, plus numerous improvements,
refactoring, logging, etc.. When enabled,
binding improves the jail setup time by anywhere
from 2x to orders of magnitude (in docker, f.e.).
A new config entry mount_jail_tree controls
whether mounting is used or the old method of
linking/copying of jail contents. It is set to
true by default and falls back to linking/copying.
A test mount is done when the setting is enabled,
and if mounting fails, it's disabled to avoid noise.
Temporarily disabled for unit-tests until we can
cleanup lingering mounts after Jenkins aborts our
build job. In a future patch we will have mount/jail
cleanup as part of make.
The network/system files in /etc that need frequent
refreshing are now updated in systemplate to make
their most recent version available in the jails.
These files can change during the course of loolwsd
lifetime, and are unlikely to be updated in
systemplate after installation at all. We link to
them in the systemplate/etc directory, and if that
fails, we copy them before forking each kit
instance to have the latest.
This reworks the approach used to bind-mount the
jails and the templates such that the total is
now down to only three mounts: systemplate, lo, tmp.
As now systemplate and lotemplate are shared, they
must be mounted as readonly, this means that user/
must now be moved into tmp/user/ which is writable.
The mount-points must be recursive, because we mount
lo/ within the mount-point of systemplate (which is
the root of the jail). But because we (re)bind
recursively, and because both systemplate and
lotemplate are mounted for each jails, we need to
make them unbindable, so they wouldn't multiply the
mount-points for each jails (an explosive growth!)
Contrarywise, we don't want the mount-points to
be shared, because we don't expect to add/remove
mounts after a jail is created.
The random temp directory is now created and set
correctly, plus many logging and other improvements.
Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-04-09 08:02:58 -05:00
|
|
|
/usr/bin/loolmount
|
2019-05-22 03:41:25 -05:00
|
|
|
/usr/share/loolwsd/discovery.xml
|
|
|
|
/usr/share/loolwsd/favicon.ico
|
|
|
|
/usr/share/loolwsd/loleaflet
|
|
|
|
/usr/share/doc/loolwsd/README
|
|
|
|
/usr/share/doc/loolwsd/README.vars
|
|
|
|
/usr/share/doc/loolwsd/protocol.txt
|
|
|
|
/usr/share/doc/loolwsd/reference.md
|
2020-01-10 05:17:43 -06:00
|
|
|
/usr/share/doc/loolwsd/metrics.txt
|
|
|
|
/usr/share/man/man1/loolwsd.1
|
|
|
|
/usr/share/man/man1/loolforkit.1
|
|
|
|
/usr/share/man/man1/loolconvert.1
|
|
|
|
/usr/share/man/man1/loolconfig.1
|
|
|
|
/usr/share/man/man1/loolwsd-systemplate-setup.1
|
2020-04-23 08:55:32 -05:00
|
|
|
/usr/share/man/man1/loolwsd-generate-proof-key.1
|
2015-06-01 11:53:29 -05:00
|
|
|
%{_unitdir}/loolwsd.service
|
2020-01-10 05:17:43 -06:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
2016-04-21 03:14:17 -05:00
|
|
|
%config(noreplace) /etc/sysconfig/loolwsd
|
2020-01-10 05:17:43 -06:00
|
|
|
%else
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?suse_version}
|
2015-06-01 11:53:29 -05:00
|
|
|
/var/adm/fillup-templates/sysconfig.loolwsd
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
2020-01-10 05:17:43 -06:00
|
|
|
%endif
|
2016-04-14 08:14:59 -05:00
|
|
|
|
2016-04-14 10:08:42 -05:00
|
|
|
%config(noreplace) /etc/cron.d/loolwsd.cron
|
2018-01-22 04:57:39 -06:00
|
|
|
%config(noreplace) /etc/pam.d/loolwsd
|
2019-05-22 03:41:25 -05:00
|
|
|
%config(noreplace) %attr(640, lool, root) /etc/loolwsd/loolwsd.xml
|
|
|
|
%config /etc/loolwsd/loolkitconfig.xcu
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%doc README
|
|
|
|
|
2015-06-01 11:53:29 -05:00
|
|
|
%pre
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?suse_version}
|
2015-06-01 11:53:29 -05:00
|
|
|
%service_add_pre loolwsd.service
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
2015-06-01 11:53:29 -05:00
|
|
|
|
2016-04-21 03:14:17 -05:00
|
|
|
getent group lool >/dev/null || groupadd -r lool
|
2020-01-10 05:17:43 -06:00
|
|
|
getent passwd lool >/dev/null || useradd -g lool -r lool
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
%post
|
|
|
|
setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
|
wsd: faster jail setup via bind-mount
loolmount now works and supports mounting and
unmounting, plus numerous improvements,
refactoring, logging, etc.. When enabled,
binding improves the jail setup time by anywhere
from 2x to orders of magnitude (in docker, f.e.).
A new config entry mount_jail_tree controls
whether mounting is used or the old method of
linking/copying of jail contents. It is set to
true by default and falls back to linking/copying.
A test mount is done when the setting is enabled,
and if mounting fails, it's disabled to avoid noise.
Temporarily disabled for unit-tests until we can
cleanup lingering mounts after Jenkins aborts our
build job. In a future patch we will have mount/jail
cleanup as part of make.
The network/system files in /etc that need frequent
refreshing are now updated in systemplate to make
their most recent version available in the jails.
These files can change during the course of loolwsd
lifetime, and are unlikely to be updated in
systemplate after installation at all. We link to
them in the systemplate/etc directory, and if that
fails, we copy them before forking each kit
instance to have the latest.
This reworks the approach used to bind-mount the
jails and the templates such that the total is
now down to only three mounts: systemplate, lo, tmp.
As now systemplate and lotemplate are shared, they
must be mounted as readonly, this means that user/
must now be moved into tmp/user/ which is writable.
The mount-points must be recursive, because we mount
lo/ within the mount-point of systemplate (which is
the root of the jail). But because we (re)bind
recursively, and because both systemplate and
lotemplate are mounted for each jails, we need to
make them unbindable, so they wouldn't multiply the
mount-points for each jails (an explosive growth!)
Contrarywise, we don't want the mount-points to
be shared, because we don't expect to add/remove
mounts after a jail is created.
The random temp directory is now created and set
correctly, plus many logging and other improvements.
Change-Id: Iae3fda5e876cf47d2cae6669a87b5b826a8748df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92829
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-04-09 08:02:58 -05:00
|
|
|
setcap cap_sys_admin=ep /usr/bin/loolmount
|
2019-12-09 11:09:48 -06:00
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
mkdir -p /var/cache/loolwsd && chown lool:lool /var/cache/loolwsd
|
|
|
|
rm -rf /var/cache/loolwsd/*
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2015-05-27 08:28:22 -05:00
|
|
|
# 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
|
2020-01-10 05:17:43 -06:00
|
|
|
loroot=%{loroot}
|
2015-05-27 08:28:22 -05:00
|
|
|
loolparent=`cd ${loroot} && cd .. && /bin/pwd`
|
|
|
|
|
|
|
|
rm -rf ${loolparent}/lool
|
|
|
|
mkdir -p ${loolparent}/lool/child-roots
|
2016-04-21 03:14:17 -05:00
|
|
|
chown lool:lool ${loolparent}/lool
|
|
|
|
chown lool:lool ${loolparent}/lool/child-roots
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2017-04-04 05:12:22 -05:00
|
|
|
fc-cache ${loroot}/share/fonts/truetype
|
2019-02-05 13:55:57 -06:00
|
|
|
loolwsd-systemplate-setup ${loolparent}/lool/systemplate ${loroot} >/dev/null 2>&1
|
2020-04-23 08:55:32 -05:00
|
|
|
loolwsd-generate-proof-key >/dev/null 2>&1
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
2016-04-21 03:14:17 -05:00
|
|
|
%systemd_post loolwsd.service
|
|
|
|
%else
|
|
|
|
%if 0%{?suse_version}
|
2015-06-01 11:53:29 -05:00
|
|
|
%service_add_post loolwsd.service
|
|
|
|
%{fillup_only -n loolwsd}
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
|
2015-06-01 11:53:29 -05:00
|
|
|
%preun
|
2020-01-10 05:17:43 -06:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
2016-04-21 03:14:17 -05:00
|
|
|
%systemd_preun loolwsd.service
|
|
|
|
%else
|
|
|
|
%if 0%{?suse_version}
|
2015-06-01 11:53:29 -05:00
|
|
|
%service_del_preun loolwsd.service
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
|
|
|
%endif
|
2015-06-01 11:53:29 -05:00
|
|
|
|
|
|
|
%postun
|
2020-01-10 05:17:43 -06:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
2016-04-21 03:14:17 -05:00
|
|
|
%systemd_postun loolwsd.service
|
|
|
|
%else
|
|
|
|
%if 0%{?suse_version}
|
2015-06-01 11:53:29 -05:00
|
|
|
%service_del_postun loolwsd.service
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
|
|
|
%endif
|
2015-06-01 11:53:29 -05:00
|
|
|
|
2015-05-19 06:04:51 -05:00
|
|
|
%changelog
|
2015-08-03 14:01:11 -05:00
|
|
|
* Mon Aug 03 2015 Mihai Varga
|
|
|
|
- added the cronjob
|
2015-05-19 06:04:51 -05:00
|
|
|
* Tue May 19 2015 Tor Lillqvist
|
|
|
|
- Initial RPM release
|