2021-11-18 06:08:14 -06:00
|
|
|
# spec file for package coolwsd
|
2015-05-19 06:04:51 -05:00
|
|
|
#
|
2023-05-14 13:48:35 -05:00
|
|
|
# Copyright (c) 2023 Collabora
|
2015-05-19 06:04:51 -05:00
|
|
|
#
|
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
|
|
|
|
2021-11-17 04:16:49 -06:00
|
|
|
Name: coolwsd
|
2015-05-20 12:10:17 -05:00
|
|
|
Version: @PACKAGE_VERSION@
|
2023-02-26 09:44:19 -06:00
|
|
|
Release: 1
|
2023-04-27 05:34:50 -05:00
|
|
|
Vendor: Collabora Productivity Ltd.
|
2020-10-02 03:53:04 -05:00
|
|
|
Summary: Collabora Online WebSocket Daemon
|
2021-03-31 10:24:33 -05:00
|
|
|
License: EULA
|
2021-11-18 06:08:14 -06:00
|
|
|
Source0: coolwsd-@PACKAGE_VERSION@.tar.gz
|
2024-03-12 10:47:38 -05:00
|
|
|
BuildRequires: libcap-devel pam-devel rsync
|
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
|
2023-07-06 14:51:58 -05:00
|
|
|
Requires(post): coreutils grep sed cpio /usr/sbin/setcap
|
2021-11-18 06:08:14 -06:00
|
|
|
Provides: loolwsd
|
2023-06-11 11:10:32 -05:00
|
|
|
Obsoletes: loolwsd collaboraoffice-dict-br collaboraoffice-dict-et collaboraoffice-dict-gd collaboraoffice-dict-gu collaboraoffice-dict-hi collaboraoffice-dict-lt collaboraoffice-dict-lv collaboraoffice-dict-ro collaboraoffice-dict-sr collaboraoffice-dict-te collaboraofficebasis-as collaboraofficebasis-bn-IN collaboraofficebasis-ast collaboraofficebasis-br collaboraofficebasis-ca-valencia collaboraofficebasis-cy collaboraofficebasis-et collaboraofficebasis-ga collaboraofficebasis-gd collaboraofficebasis-gu collaboraofficebasis-hi collaboraofficebasis-km collaboraofficebasis-kn collaboraofficebasis-lt collaboraofficebasis-lv collaboraofficebasis-ml collaboraofficebasis-mr collaboraofficebasis-nn collaboraofficebasis-or collaboraofficebasis-pa-IN collaboraofficebasis-ro collaboraofficebasis-sr collaboraofficebasis-sr-Latn collaboraofficebasis-ta collaboraofficebasis-te
|
2021-11-18 06:08:14 -06:00
|
|
|
|
2015-05-19 09:04:24 -05:00
|
|
|
%description
|
2015-05-19 06:04:51 -05:00
|
|
|
|
|
|
|
%prep
|
2021-11-18 06:08:14 -06:00
|
|
|
%setup -n coolwsd-@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 \
|
2023-06-15 15:35:05 -05:00
|
|
|
--disable-tests \
|
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}
|
2023-05-14 13:48:35 -05:00
|
|
|
install -D -m 444 coolwsd.service %{buildroot}/usr/lib/systemd/system/coolwsd.service
|
|
|
|
# Apache webserver on RH-like distributions
|
2021-03-31 10:24:33 -05:00
|
|
|
install -d -m 755 %{buildroot}/etc/httpd/conf
|
2021-11-18 06:08:14 -06:00
|
|
|
install -D -m 755 etc/apache2/coolwsd.conf %{buildroot}/etc/httpd/conf
|
2018-01-22 04:57:39 -06:00
|
|
|
mkdir -p %{buildroot}/etc/pam.d
|
2021-11-18 06:08:14 -06:00
|
|
|
echo "auth required pam_unix.so" > %{buildroot}/etc/pam.d/coolwsd
|
|
|
|
echo "account required pam_unix.so" >> %{buildroot}/etc/pam.d/coolwsd
|
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-18 08:41:02 -06:00
|
|
|
/usr/bin/loolwsd
|
2021-11-17 15:09:50 -06:00
|
|
|
/usr/bin/coolwsd-systemplate-setup
|
2021-11-18 08:41:02 -06:00
|
|
|
/usr/bin/loolwsd-systemplate-setup
|
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-18 08:41:02 -06:00
|
|
|
/usr/bin/loolconfig
|
2022-09-01 14:44:11 -05:00
|
|
|
/usr/bin/coolstress
|
2021-11-17 11:08:27 -06:00
|
|
|
/usr/bin/coolmount
|
2021-11-18 06:08:14 -06:00
|
|
|
/usr/share/coolwsd/discovery.xml
|
|
|
|
/usr/share/coolwsd/favicon.ico
|
|
|
|
/usr/share/coolwsd/browser
|
2024-06-05 09:57:51 -05:00
|
|
|
/usr/share/doc/coolwsd/README.md
|
2021-11-18 06:08:14 -06:00
|
|
|
/usr/share/doc/coolwsd/README.vars
|
|
|
|
/usr/share/doc/coolwsd/metrics.txt
|
|
|
|
/usr/share/doc/coolwsd/protocol.txt
|
|
|
|
/usr/share/doc/coolwsd/reference.md
|
2024-02-27 03:49:13 -06:00
|
|
|
/usr/share/doc/coolwsd/THIRDPARTYLICENSES
|
2021-11-18 06:08:14 -06:00
|
|
|
/usr/share/man/man1/coolwsd.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
|
2022-09-01 14:44:11 -05:00
|
|
|
/usr/share/man/man1/coolstress.1.gz
|
2021-11-17 15:09:50 -06:00
|
|
|
/usr/share/man/man1/coolwsd-systemplate-setup.1.gz
|
2021-11-17 11:08:27 -06:00
|
|
|
/usr/share/man/man1/coolmount.1.gz
|
2023-05-14 13:48:35 -05:00
|
|
|
/usr/lib/systemd/system/coolwsd.service
|
2016-04-14 08:14:59 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
%config(noreplace) /etc/pam.d/coolwsd
|
|
|
|
%config(noreplace) %attr(640, cool, root) /etc/coolwsd/coolwsd.xml
|
|
|
|
%config /etc/coolwsd/coolkitconfig.xcu
|
|
|
|
%config(noreplace) /etc/nginx/snippets/coolwsd.conf
|
|
|
|
%config(noreplace) /etc/apache2/conf-available/coolwsd.conf
|
|
|
|
%config(noreplace) /etc/httpd/conf/coolwsd.conf
|
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
|
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
|
|
|
|
2023-05-14 13:48:35 -05:00
|
|
|
%post
|
2024-04-06 09:07:30 -05:00
|
|
|
setcap cap_fowner,cap_chown,cap_sys_chroot=ep /usr/bin/coolforkit
|
2023-05-14 13:48:35 -05:00
|
|
|
setcap cap_sys_admin=ep /usr/bin/coolmount
|
|
|
|
if [ -f /etc/loolwsd/loolwsd.xml ]; then /usr/bin/coolconfig migrateconfig --write; fi
|
2023-05-14 16:31:38 -05:00
|
|
|
# compatibility with older systemd versions
|
2024-02-02 04:30:52 -06:00
|
|
|
SYSTEMD_VERSION=$(busctl --system get-property org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager Version | grep -Eo [0-9]{3} | head -n 1)
|
2023-05-14 16:31:38 -05:00
|
|
|
if [[ "$SYSTEMD_VERSION" -lt "228" ]]; then
|
|
|
|
sed -i "/^ProtectSystem/d" /usr/lib/systemd/system/coolwsd.service
|
|
|
|
fi
|
|
|
|
if [[ "$SYSTEMD_VERSION" -lt "231" ]]; then
|
|
|
|
sed -i "/^ReadWritePaths/d" /usr/lib/systemd/system/coolwsd.service
|
|
|
|
fi
|
|
|
|
if [[ "$SYSTEMD_VERSION" -lt "232" ]]; then
|
|
|
|
sed -i "/^ProtectControlGroups/d" /usr/lib/systemd/system/coolwsd.service
|
2023-05-14 13:48:35 -05:00
|
|
|
fi
|
2021-03-31 10:24:33 -05:00
|
|
|
|
2023-05-14 13:48:35 -05:00
|
|
|
if [ $1 -eq 1 ] ; then
|
|
|
|
# Initial installation
|
|
|
|
systemctl preset coolwsd.service >/dev/null 2>&1 || :
|
|
|
|
fi
|
2021-03-31 10:24:33 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
systemctl is-active -q coolwsd && COOLWSD_IS_ACTIVE=1 || COOLWSD_IS_ACTIVE=0
|
|
|
|
if [ $COOLWSD_IS_ACTIVE == "1" ]; then systemctl stop coolwsd; fi
|
2019-12-09 11:09:48 -06:00
|
|
|
|
2023-05-14 13:48:35 -05:00
|
|
|
# Figure out where LOKit is installed, let's hope it is not a mount point
|
2021-11-18 06:08:14 -06:00
|
|
|
# Create a directory for coolwsd on the same file system
|
2023-05-14 13:48:35 -05:00
|
|
|
lokitroot=/opt/collaboraoffice
|
|
|
|
coolparent=`cd ${lokitroot} && cd .. && /bin/pwd`
|
2015-05-27 08:28:22 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
rm -rf ${coolparent}/cool
|
|
|
|
mkdir -p ${coolparent}/cool/child-roots
|
|
|
|
chown cool:cool ${coolparent}/cool
|
|
|
|
chown cool:cool ${coolparent}/cool/child-roots
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2023-05-14 13:48:35 -05:00
|
|
|
fc-cache ${lokitroot}/share/fonts/truetype
|
|
|
|
coolwsd-systemplate-setup ${coolparent}/cool/systemplate ${lokitroot} >/dev/null 2>&1
|
2023-07-06 14:51:58 -05:00
|
|
|
coolconfig generate-proof-key >/dev/null 2>&1
|
2015-05-19 09:04:24 -05:00
|
|
|
|
2021-11-18 06:08:14 -06:00
|
|
|
if [ $COOLWSD_IS_ACTIVE == "1" ]; then systemctl start coolwsd; fi
|
2016-04-21 03:14:17 -05:00
|
|
|
|
2020-01-10 05:17:43 -06:00
|
|
|
|
2015-06-01 11:53:29 -05:00
|
|
|
%preun
|
2024-02-02 04:18:19 -06:00
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
systemctl --no-reload disable coolwsd.service > /dev/null 2>&1 || :
|
|
|
|
systemctl stop coolwsd.service > /dev/null 2>&1 || :
|
|
|
|
fi
|
2015-06-01 11:53:29 -05:00
|
|
|
|
|
|
|
%postun
|
2024-02-02 04:18:19 -06:00
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
|
|
|
fi
|
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
|