Initial import

This commit is contained in:
Daniel Berteaud 2013-11-12 16:01:11 +01:00
commit c8328e0bd3
9 changed files with 157 additions and 0 deletions

14
createlinks Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
service_link_enhanced("ooo", "S99", "7");
service_link_enhanced("ooo", "K01", "6");
service_link_enhanced("ooo", "K01", "0");
service_link_enhanced("ooo", "K01", "1");
safe_touch("root/var/service/ooo/down");
safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/ooo');
safe_symlink("/var/service/ooo" , 'root/service/ooo');

View File

@ -0,0 +1 @@
disabled

View File

@ -0,0 +1 @@
private

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
service

View File

@ -0,0 +1,2 @@
# Restart OOo each night
30 2 * * * root /usr/bin/sv t /service/ooo

View File

@ -0,0 +1,26 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 2010-2011 Firewall-Services
# daniel@firewall-services.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
exec \
/usr/local/bin/setuidgid smelog \
/usr/local/bin/multilog t s5000000 \
/var/log/ooo

41
root/var/service/ooo/run Normal file
View File

@ -0,0 +1,41 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 2010-2011 Firewall-Services
# daniel@firewall-services.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
PORT=$(/sbin/e-smith/db configuratin getprop ooo TCPPort || echo '2002')
NET=$(/sbin/e-smith/db configuratin getprop ooo LocalNetworking || echo 'disabled')
LISTEN='127.0.0.1'
if [ "$NET" == "enabled" ]; then
LISTEN=$(/sbin/e-smith/db configuration get LocalIP)
fi
exec 2>&1
HOME=/var/cache/ooo exec \
/usr/local/bin/setuidgid www \
/usr/lib/openoffice.org3/program/soffice.bin \
-headless \
-invisible \
-nocrashreport \
-nodefault \
-nofirststartwizard \
-nologo -norestore \
-accept="socket,host=$LISTEN,port=$PORT;urp;StarOffice.ComponentContext"

View File

@ -0,0 +1,70 @@
%define version 0.2.0
%define release 1
%define name smeserver-ooo-headless
Summary: Run a headless instance of OpenOffice.Org
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
Requires: e-smith-base >= 5.2.0
Requires: openoffice.org-headless
Requires: openoffice.org-writer
Requires: openoffice.org-impress
Requires: openoffice.org-calc
Requires: unoconv
%description
Run OpenOffice as a headless daemon. Can be used to convert
office document to PDF. It can be used by web applications
to create preview of office documents
%changelog
* Tue Nov 12 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.0-1
- Import in GIT
* Fri Mar 09 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.1-3
- Fix crontab entry
* Tue Nov 29 2011 Daniel Berteaud <daniel@firewall-services.com> - 0.1-1
- initial release
%prep
%setup -q -n %{name}-%{version}
%build
%{__mkdir_p} root/var/log/ooo
%{__mkdir_p} root/var/cache/ooo
perl createlinks
%install
/bin/rm -rf $RPM_BUILD_ROOT
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--file /var/service/ooo/run 'attr(0755,root,root)' \
--file /var/service/ooo/log/run 'attr(0755,root,root)' \
--dir /var/log/ooo 'attr(0750,smelog,smelog)' \
--dir /var/cache/ooo 'attr(0750,www,www)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
%preun