libreoffice-online/loolwsd/loolwsd.spec.in
Tor Lillqvist 2e6719faaf Tweak where the systemplate and child-root directories are put
They must be on the same file system where LO is installed, and the TDF
tarballs puts that in /opt, and on some Linuxes in default configuration /opt
is on a different file system from /home, so we should not really use
/home/lool.
2015-05-27 16:28:36 +03:00

80 lines
2.3 KiB
RPMSpec

#
# spec file for package loolwsd
#
# Copyright (c) 2015 Collabora
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# See also http://en.opensuse.org/openSUSE:Specfile_guidelines
Name: loolwsd
Version: @PACKAGE_VERSION@
Release: 0
Vendor: Collabora
Summary: LibreOffice On-Line WebSocket Daemon
License: MPL
Source0: loolwsd-@PACKAGE_VERSION@.tar.gz
BuildRequires: libcap-progs libcap-devel libpng-devel poco-devel >= 1.6.0
Requires: libcap libcap-progs libpng libPocoFoundation30 >= 1.6.0 libPocoNet30 >= 1.6.0
%define owner lool
%define group lool
# This works for now only with the TDF nightly builds or similar, I think
%define sofficeversion 5.0
%define sofficepackage libreofficedev%{sofficeversion}
%description
%prep
%setup -q
%build
%configure --with-lokit-path=bundled/include
make %{?_smp_mflags}
%check
make check
%install
make install DESTDIR=%{buildroot}
%files
/usr/bin/loolwsd
/usr/bin/loolwsd-systemplate-setup
%doc README
%post
setcap cap_fowner,cap_sys_chroot=ep /usr/bin/loolwsd
getent group %{group} >/dev/null || groupadd -r %{group}
getent passwd %{owner} >/dev/null || useradd -g %{group} -r %{owner}
mkdir -p /var/cache/loolwsd && chmod og+w /var/cache/loolwsd
# 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=`rpm -ql %{sofficepackage} | grep '/soffice$' | sed -e 's-/program/soffice--'`
loolparent=`cd ${loroot} && cd .. && /bin/pwd`
rm -rf ${loolparent}/lool
mkdir -p ${loolparent}/lool/child-roots
chown %{owner} ${loolparent}/lool
chown %{owner} ${loolparent}/lool/child-roots
su %{owner} -c "loolwsd-systemplate-setup ${loolparent}/lool/systemplate ${loroot} >/dev/null"
%changelog
* Tue May 19 2015 Tor Lillqvist
- Initial RPM release