Create a 'lool' user and run the systemplate setup script upon installation

Not sure if this is the right thing to do, but should work for our purposes
for now. If and when somebody else wants to fine-tune this stuff, feel free.
private/hcvcastro/forking
Tor Lillqvist 2015-05-19 17:04:24 +03:00
parent 873e7c5102
commit 3e9531f90a
1 changed files with 18 additions and 1 deletions

View File

@ -25,8 +25,14 @@ Source0: loolwsd-1.0.12.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
%description
%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
@ -50,8 +56,19 @@ make install DESTDIR=%{buildroot}
%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} -m -r %{owner}
mkdir -p /var/cache/loolwsd && chmod og+w /var/cache/loolwsd
su - %{owner} -c 'mkdir lool-child-roots'
# Figure out where LO is installed
loroot=`rpm -ql %{sofficepackage} | grep '/soffice$' | sed -e 's-/program/soffice--'`
su - %{owner} -c "loolwsd-systemplate-setup /home/lool/lool-systemplate ${loroot} >/dev/null"
%changelog
* Tue May 19 2015 Tor Lillqvist
- Initial RPM release