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
|
|
|
|
|
|
|
Name: loolwsd
|
2015-05-20 12:10:17 -05:00
|
|
|
Version: @PACKAGE_VERSION@
|
2016-04-25 03:39:14 -05:00
|
|
|
Release: 1%{?dist}
|
2015-05-19 06:04:51 -05:00
|
|
|
Vendor: Collabora
|
|
|
|
Summary: LibreOffice On-Line WebSocket Daemon
|
|
|
|
License: MPL
|
2015-05-20 12:10:17 -05:00
|
|
|
Source0: loolwsd-@PACKAGE_VERSION@.tar.gz
|
2016-04-14 10:08:42 -05:00
|
|
|
Source1: loleaflet-@PACKAGE_VERSION@.tar.gz
|
2016-04-21 03:14:17 -05:00
|
|
|
BuildRequires: libcap-devel libpng-devel poco-devel >= 1.7.1
|
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
BuildRequires: libpcap
|
|
|
|
%else
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: libcap-progs systemd-rpm-macros
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Requires: collaboraoffice5.0 collaboraoffice5.0-en-US collaboraoffice5.0-ure collaboraofficebasis5.0-core collaboraofficebasis5.0-writer collaboraofficebasis5.0-impress collaboraofficebasis5.0-graphicfilter collaboraofficebasis5.0-en-US collaboraofficebasis5.0-calc collaboraofficebasis5.0-en-US-res collaboraofficebasis5.0-en-US-calc collaboraofficebasis5.0-ooofonts collaboraofficebasis5.0-images collaboraofficebasis5.0-filter-data collaboraofficebasis5.0-draw collaboraofficebasis5.0-base collaboraofficebasis5.0-en-US-writer collaboraofficebasis5.0-en-US-math collaboraofficebasis5.0-en-US-base
|
|
|
|
Requires: systemd
|
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
Requires: expat keyutils-libs krb5-libs libattr libcap libcom_err libgcc libpng libselinux openssl-libs pcre xz-libs zlib
|
|
|
|
Requires: poco-crypto >= 1.7.1 poco-foundation >= 1.7.1 poco-json >= 1.7.1 poco-net >= 1.7.1 poco-netssl >= 1.7.1 poco-util >= 1.7.1 poco-xml >= 1.7.1
|
|
|
|
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
|
|
|
|
%if 0%{?suse_version}
|
2016-04-26 03:16:19 -05:00
|
|
|
Requires: libcap2 libpng12-0 libpcre1 libz1 %{?systemd_requires} %{fillup_prereq}
|
2016-04-21 03:14:17 -05:00
|
|
|
Requires: libPocoCrypto42 >= 1.7.1 libPocoFoundation42 >= 1.7.1 libPocoJSON42 >= 1.7.1 libPocoNet42 >= 1.7.1 libPocoNetSSL42 >= 1.7.1 libPocoUtil42 >= 1.7.1 libPocoXML42 >= 1.7.1
|
2016-04-26 03:16:19 -05:00
|
|
|
Requires: Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0 cups-libs dbus-1-glib fontconfig krb5 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
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
|
|
|
%endif
|
2016-04-14 10:08:42 -05:00
|
|
|
Provides: loleaflet = 1.5.8
|
|
|
|
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
|
|
|
|
|
|
|
%prep
|
2016-04-14 10:08:42 -05:00
|
|
|
%setup
|
|
|
|
%setup -T -D -a 1
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%build
|
2016-04-08 04:24:52 -05:00
|
|
|
%configure \
|
|
|
|
--with-lokit-path=bundled/include \
|
|
|
|
%if %{ssl_support} == "NO"
|
|
|
|
--disable-ssl
|
|
|
|
%endif
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2015-05-29 01:56:32 -05:00
|
|
|
env BUILDING_FROM_RPMBUILD=yes make %{?_smp_mflags}
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%check
|
2015-10-29 10:32:03 -05:00
|
|
|
#env BUILDING_FROM_RPMBUILD=yes make check
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%install
|
2015-05-29 01:56:32 -05:00
|
|
|
env BUILDING_FROM_RPMBUILD=yes make install DESTDIR=%{buildroot}
|
2016-04-19 04:39:02 -05:00
|
|
|
%if %{default_admin} == "YES"
|
|
|
|
sed -i "s|ExecStart=/usr/bin/loolwsd --version --systemplate=/opt/lool/systemplate --lotemplate=/opt/collaboraoffice5.0 --childroot=/opt/lool/child-roots --numprespawns=5 --fileserverroot=/usr/share/loolwsd|ExecStart=/usr/bin/loolwsd --version --systemplate=/opt/lool/systemplate --lotemplate=/opt/collaboraoffice5.0 --childroot=/opt/lool/child-roots --numprespawns=5 --fileserverroot=/usr/share/loolwsd --admincreds=admin/admin|" loolwsd.service
|
|
|
|
%endif
|
2015-06-09 14:33:46 -05:00
|
|
|
%__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
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
install -D -m 644 sysconfig.loolwsd %{buildroot}/etc/sysconfig/loolwsd
|
|
|
|
%else
|
|
|
|
%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
|
|
|
|
%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
|
|
|
|
echo "0 0 */1 * * root find /var/cache/loolwsd -name \"*.png\" -a -atime +10 -exec rm {} \;" >> %{buildroot}/etc/cron.d/loolwsd.cron
|
2016-04-14 10:08:42 -05:00
|
|
|
cd loleaflet-@PACKAGE_VERSION@
|
|
|
|
mkdir -p %{buildroot}/usr/share/loolwsd/loleaflet
|
|
|
|
tar cf - . | (cd %{buildroot}/usr/share/loolwsd/loleaflet && tar xf -)
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%files
|
|
|
|
/usr/bin/loolwsd
|
|
|
|
/usr/bin/loolwsd-systemplate-setup
|
2016-01-14 06:45:33 -06:00
|
|
|
/usr/bin/loolmap
|
2016-04-05 08:37:10 -05:00
|
|
|
/usr/bin/loolforkit
|
2016-04-14 07:43:13 -05:00
|
|
|
/usr/bin/loolmount
|
2016-04-18 03:31:31 -05:00
|
|
|
/usr/bin/looltool
|
2016-04-14 07:43:13 -05:00
|
|
|
/usr/share/loolwsd/discovery.xml
|
2016-04-14 10:08:42 -05:00
|
|
|
/usr/share/loolwsd/loleaflet
|
2015-06-01 11:53:29 -05:00
|
|
|
%{_unitdir}/loolwsd.service
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
%config(noreplace) /etc/sysconfig/loolwsd
|
|
|
|
%else
|
|
|
|
%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
|
|
|
|
%endif
|
2016-04-14 08:14:59 -05:00
|
|
|
|
2016-04-14 10:08:42 -05:00
|
|
|
%config(noreplace) /etc/cron.d/loolwsd.cron
|
|
|
|
%config(noreplace) /etc/loolwsd/loolwsd.xml
|
2016-04-21 03:14:17 -05:00
|
|
|
%config(noreplace) %attr(400, lool, lool) /etc/loolwsd/key.pem
|
2016-04-19 04:42:41 -05:00
|
|
|
%if %{ssl_support} == "YES"
|
2016-04-14 11:47:35 -05:00
|
|
|
%config(noreplace) /etc/loolwsd/cert.pem
|
|
|
|
%config(noreplace) /etc/loolwsd/ca-chain.cert.pem
|
|
|
|
%endif
|
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
|
|
|
|
2015-05-19 06:04:51 -05:00
|
|
|
%post
|
2016-04-07 03:49:26 -05:00
|
|
|
setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2016-04-21 03:14:17 -05:00
|
|
|
getent group lool >/dev/null || groupadd -r lool
|
|
|
|
getent passwd lool >/dev/null || useradd -g lool -r lool
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2016-04-21 03:14:17 -05:00
|
|
|
mkdir -p /var/cache/loolwsd && chown lool:lool /var/cache/loolwsd
|
2016-01-08 02:11:58 -06:00
|
|
|
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
|
2015-10-30 07:18:35 -05:00
|
|
|
loroot=`rpm -ql collaboraoffice5.0 | grep '/soffice$' | sed -e 's-/program/soffice--'`
|
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
|
|
|
|
2016-04-21 03:14:17 -05:00
|
|
|
su lool -c "loolwsd-systemplate-setup ${loolparent}/lool/systemplate ${loroot} >/dev/null"
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
%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
|
|
|
|
|
2015-06-01 11:53:29 -05:00
|
|
|
|
|
|
|
%preun
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
%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
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?fedora} || 0%{?rhel} >= 7
|
|
|
|
%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
|
|
|
|
|