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}
|
2021-11-17 04:16:49 -06:00
|
|
|
Name: coolwsd%{name_suffix}
|
2016-08-04 18:15:33 -05:00
|
|
|
%else
|
2021-11-17 04:16:49 -06:00
|
|
|
Name: coolwsd
|
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}
|
2020-10-02 03:53:04 -05:00
|
|
|
Summary: Collabora Online WebSocket Daemon
|
2021-03-31 10:24:33 -05:00
|
|
|
License: EULA
|
2015-05-20 12:10:17 -05:00
|
|
|
Source0: loolwsd-@PACKAGE_VERSION@.tar.gz
|
2021-03-31 10:24:33 -05:00
|
|
|
BuildRequires: libcap-devel libpng-devel pam-devel gcc-c++ cppunit-devel pam-devel fontconfig make
|
|
|
|
|
|
|
|
# Red Hat and CentOS
|
|
|
|
%if 0%{?rhel} == 7
|
|
|
|
BuildRequires: libpcap kernel-headers python36-polib python36-lxml
|
2020-01-10 05:17:43 -06:00
|
|
|
%endif
|
2021-03-31 10:24:33 -05:00
|
|
|
|
|
|
|
%if 0%{?rhel} == 8
|
|
|
|
BuildRequires: libpcap kernel-headers python3-polib python3-lxml
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
|
|
|
|
2021-03-31 10:24:33 -05:00
|
|
|
# openSUSE Leap 15.x, SLES12, SLES15
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: libcap-progs linux-glibc-devel systemd-rpm-macros python3-polib python3-lxml
|
|
|
|
%endif
|
|
|
|
|
2021-09-22 03:00:46 -05:00
|
|
|
Requires: collaboraoffice collaboraoffice-ure collaboraofficebasis-core collaboraofficebasis-writer collaboraofficebasis-impress collaboraofficebasis-graphicfilter collaboraofficebasis-en-US collaboraofficebasis-calc collaboraofficebasis-ooofonts collaboraofficebasis-images collaboraofficebasis-draw collaboraofficebasis-extension-pdf-import collaboraofficebasis-ooolinguistic collaboraofficebasis-math
|
2020-11-23 08:25:32 -06:00
|
|
|
Requires(post): coreutils grep sed cpio
|
2021-03-31 10:24:33 -05:00
|
|
|
%if 0%{?rhel}
|
2016-04-27 07:32:37 -05:00
|
|
|
# loolwsd dependencies
|
2021-03-31 10:24:33 -05:00
|
|
|
Requires: systemd expat keyutils-libs krb5-libs libattr libcap libcom_err libgcc libpng libselinux openssh-clients openssl-libs pcre xz-libs zlib
|
|
|
|
# Collabora Office dependencies (unfortunately Collabora Office RPM packages do not have real dependencies)
|
|
|
|
Requires: expat fontconfig freetype libuuid bzip2-libs
|
|
|
|
%endif
|
|
|
|
|
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
|
2021-03-31 10:24:33 -05:00
|
|
|
Requires: systemd libopenssl1_0_0 libpcre1 libz1 libcap2 libpng12-0 %{fillup_prereq}
|
|
|
|
# Collabora Office dependencies (unfortunately Collabora Office RPM packages do not have real dependencies)
|
2021-05-04 06:13:59 -05:00
|
|
|
# cd /opt/collaboraoffice/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
|
2021-03-31 10:24:33 -05:00
|
|
|
Requires: fontconfig libbz2-1 libexpat1 libfreetype6 libpng16-16 libuuid1 openssh
|
2016-04-21 03:14:17 -05:00
|
|
|
%endif
|
2021-03-31 10:24:33 -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 \
|
2021-05-04 06:13:59 -05:00
|
|
|
--with-lo-path=/opt/collaboraoffice \
|
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
|
|
|
|
2021-03-31 10:24:33 -05:00
|
|
|
env BUILDING_FROM_RPMBUILD=yes make %{?_smp_mflags}
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%check
|
2021-03-31 10:24:33 -05:00
|
|
|
#env BUILDING_FROM_RPMBUILD=yes make check
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%install
|
2021-03-31 10:24:33 -05:00
|
|
|
env BUILDING_FROM_RPMBUILD=yes make install DESTDIR=%{buildroot}
|
2015-06-01 11:53:29 -05:00
|
|
|
install -d -m 755 %{buildroot}/var/adm/fillup-templates
|
2021-03-31 10:24:33 -05:00
|
|
|
%if 0%{?rhel}
|
|
|
|
install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service
|
|
|
|
# systemd in RHEL 7 does not understand these options
|
|
|
|
%if 0%{?rhel} <= 7
|
|
|
|
sed -i "/^ReadWritePaths/d;/^ProtectControlGroups/d;/^ProtectSystem/d" %{buildroot}%{_unitdir}/loolwsd.service
|
|
|
|
%endif
|
2016-04-21 03:14:17 -05:00
|
|
|
install -D -m 644 sysconfig.loolwsd %{buildroot}/etc/sysconfig/loolwsd
|
2021-03-31 10:24:33 -05:00
|
|
|
install -d -m 755 %{buildroot}/etc/httpd/conf
|
|
|
|
install -D -m 755 etc/apache2/loolwsd.conf %{buildroot}/etc/httpd/conf
|
|
|
|
rm %{buildroot}/etc/apache2/conf-available/loolwsd.conf
|
|
|
|
%endif
|
2016-04-21 03:14:17 -05:00
|
|
|
%if 0%{?suse_version}
|
2021-03-31 10:24:33 -05:00
|
|
|
install -D -m 444 loolwsd.service %{buildroot}%{_unitdir}/loolwsd.service
|
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
|
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
|
2021-03-31 10:24:33 -05:00
|
|
|
%defattr(-,root,root,-)
|
2021-11-17 04:16:49 -06:00
|
|
|
/usr/bin/coolwsd
|
2021-11-17 15:09:50 -06:00
|
|
|
/usr/bin/coolwsd-systemplate-setup
|
2021-11-17 15:06:34 -06:00
|
|
|
/usr/bin/coolwsd-generate-proof-key
|
2021-11-16 03:59:05 -06:00
|
|
|
/usr/bin/coolforkit
|
2021-11-17 11:44:09 -06:00
|
|
|
/usr/bin/coolconvert
|
2021-11-15 07:47:53 -06:00
|
|
|
/usr/bin/coolconfig
|
2021-11-16 02:43:37 -06:00
|
|
|
/usr/bin/loolconfig
|
2021-11-17 11:08:27 -06:00
|
|
|
/usr/bin/coolmount
|
2019-05-22 03:41:25 -05:00
|
|
|
/usr/share/loolwsd/discovery.xml
|
|
|
|
/usr/share/loolwsd/favicon.ico
|
2021-11-03 08:35:45 -05:00
|
|
|
/usr/share/loolwsd/browser
|
2019-05-22 03:41:25 -05:00
|
|
|
/usr/share/doc/loolwsd/README
|
|
|
|
/usr/share/doc/loolwsd/README.vars
|
2021-03-31 10:24:33 -05:00
|
|
|
/usr/share/doc/loolwsd/metrics.txt
|
2019-05-22 03:41:25 -05:00
|
|
|
/usr/share/doc/loolwsd/protocol.txt
|
|
|
|
/usr/share/doc/loolwsd/reference.md
|
2021-03-31 10:24:33 -05:00
|
|
|
/usr/share/man/man1/loolwsd.1.gz
|
2021-11-16 03:59:05 -06:00
|
|
|
/usr/share/man/man1/coolforkit.1.gz
|
2021-11-17 11:44:09 -06:00
|
|
|
/usr/share/man/man1/coolconvert.1.gz
|
2021-11-15 07:47:53 -06:00
|
|
|
/usr/share/man/man1/coolconfig.1.gz
|
2021-11-17 15:09:50 -06:00
|
|
|
/usr/share/man/man1/coolwsd-systemplate-setup.1.gz
|
2021-11-17 15:06:34 -06:00
|
|
|
/usr/share/man/man1/coolwsd-generate-proof-key.1.gz
|
2021-11-17 11:08:27 -06:00
|
|
|
/usr/share/man/man1/coolmount.1.gz
|
2015-06-01 11:53:29 -05:00
|
|
|
%{_unitdir}/loolwsd.service
|
2021-03-31 10:24:33 -05:00
|
|
|
%if 0%{?rhel}
|
2016-04-21 03:14:17 -05:00
|
|
|
%config(noreplace) /etc/sysconfig/loolwsd
|
2021-03-31 10:24:33 -05:00
|
|
|
%endif
|
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
|
2016-04-14 08:14:59 -05:00
|
|
|
|
2018-01-22 04:57:39 -06:00
|
|
|
%config(noreplace) /etc/pam.d/loolwsd
|
2021-11-15 10:26:31 -06:00
|
|
|
%config(noreplace) %attr(640, cool, root) /etc/loolwsd/loolwsd.xml
|
2019-05-22 03:41:25 -05:00
|
|
|
%config /etc/loolwsd/loolkitconfig.xcu
|
2021-03-31 10:24:33 -05:00
|
|
|
%config(noreplace) /etc/nginx/snippets/loolwsd.conf
|
|
|
|
%if 0%{?suse_version} > 0
|
|
|
|
%config(noreplace) /etc/apache2/conf-available/loolwsd.conf
|
|
|
|
%endif
|
|
|
|
%if 0%{?rhel} > 0
|
|
|
|
%config(noreplace) /etc/httpd/conf/loolwsd.conf
|
|
|
|
%endif
|
2015-05-19 06:04:51 -05:00
|
|
|
|
2021-03-31 10:24:33 -05:00
|
|
|
%doc README.md
|
2015-05-19 06:04:51 -05:00
|
|
|
|
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
|
|
|
|
2021-11-15 09:57:33 -06:00
|
|
|
getent group cool >/dev/null || groupadd -r cool
|
|
|
|
getent passwd cool >/dev/null || useradd -g cool -r cool -d /opt/cool -s /bin/bash
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2021-11-15 09:51:11 -06:00
|
|
|
# for filename in `find /opt/cool/systemplate -type f`;do stripped=$(echo -ne $filename | sed -e "s|/opt/cool/systemplate||");rpm -qf --qf="%{NAME}\n" $stripped;done | grep -v devel | grep -v 32bit | grep -v -- -fonts | sort | uniq
|
2021-03-31 10:24:33 -05:00
|
|
|
%triggerin -- expat fontconfig freetype freetype2 glibc glibc-locale kernel keyutils-libs krb5 krb5-libs libbz2-1 libcap libcap-ng libcap2 libexpat1 libfreetype6 libgcc libgcc_s1 libgcrypt libiscsi libpng libpng12 libpng12-0 libpng15-15 libpng16-16 libstdc++ libstdc++6 libuuid libuuid1 libz1 lsb nss-mdns nss-softokn-freebl pcre sssd sssd-client systemd-libs timezone tzdata zlib
|
|
|
|
|
|
|
|
echo -ne "Triggered update of loolwsd systemplate..."
|
|
|
|
|
|
|
|
%if 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
|
2019-12-09 11:09:48 -06: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
|
2021-05-04 06:13:59 -05:00
|
|
|
loroot=/opt/collaboraoffice
|
2015-05-27 08:28:22 -05:00
|
|
|
loolparent=`cd ${loroot} && cd .. && /bin/pwd`
|
|
|
|
|
2021-11-15 09:51:11 -06:00
|
|
|
rm -rf ${loolparent}/cool
|
|
|
|
mkdir -p ${loolparent}/cool/child-roots
|
2021-11-15 10:04:57 -06:00
|
|
|
chown cool:cool ${loolparent}/cool
|
|
|
|
chown cool:cool ${loolparent}/cool/child-roots
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2017-04-04 05:12:22 -05:00
|
|
|
fc-cache ${loroot}/share/fonts/truetype
|
2021-11-17 15:09:50 -06:00
|
|
|
coolwsd-systemplate-setup ${loolparent}/cool/systemplate ${loroot} >/dev/null 2>&1
|
2021-11-17 15:06:34 -06:00
|
|
|
coolwsd-generate-proof-key >/dev/null 2>&1
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2021-03-31 10:24:33 -05:00
|
|
|
%if 0%{?rhel} || 0%{?suse_version}
|
|
|
|
if [ $LOOLWSD_IS_ACTIVE == "1" ]; then systemctl start loolwsd; fi
|
|
|
|
%endif
|
|
|
|
|
|
|
|
echo " Done."
|
|
|
|
|
|
|
|
%post
|
2021-11-16 03:59:05 -06:00
|
|
|
setcap cap_fowner,cap_chown,cap_mknod,cap_sys_chroot=ep /usr/bin/coolforkit
|
2021-11-17 11:08:27 -06:00
|
|
|
setcap cap_sys_admin=ep /usr/bin/coolmount
|
2021-03-31 10:24:33 -05:00
|
|
|
|
|
|
|
%if 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
|
2021-03-31 10:24:33 -05:00
|
|
|
%if 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
|
2021-03-31 10:24:33 -05:00
|
|
|
%if 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
|