From c8328e0bd34e5a460c848d21a55374f9ac623916 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 12 Nov 2013 16:01:11 +0100 Subject: [PATCH] Initial import --- createlinks | 14 ++++ .../defaults/ooo/LocalNetworking | 1 + .../db/configuration/defaults/ooo/access | 1 + .../db/configuration/defaults/ooo/status | 1 + .../db/configuration/defaults/ooo/type | 1 + root/etc/e-smith/templates/etc/crontab/80ooo | 2 + root/var/service/ooo/logs/run | 26 +++++++ root/var/service/ooo/run | 41 +++++++++++ smeserver-ooo-headless.spec | 70 +++++++++++++++++++ 9 files changed, 157 insertions(+) create mode 100644 createlinks create mode 100644 root/etc/e-smith/db/configuration/defaults/ooo/LocalNetworking create mode 100644 root/etc/e-smith/db/configuration/defaults/ooo/access create mode 100644 root/etc/e-smith/db/configuration/defaults/ooo/status create mode 100644 root/etc/e-smith/db/configuration/defaults/ooo/type create mode 100644 root/etc/e-smith/templates/etc/crontab/80ooo create mode 100644 root/var/service/ooo/logs/run create mode 100644 root/var/service/ooo/run create mode 100644 smeserver-ooo-headless.spec diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..cf53a1e --- /dev/null +++ b/createlinks @@ -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'); + + diff --git a/root/etc/e-smith/db/configuration/defaults/ooo/LocalNetworking b/root/etc/e-smith/db/configuration/defaults/ooo/LocalNetworking new file mode 100644 index 0000000..7a68b11 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/ooo/LocalNetworking @@ -0,0 +1 @@ +disabled diff --git a/root/etc/e-smith/db/configuration/defaults/ooo/access b/root/etc/e-smith/db/configuration/defaults/ooo/access new file mode 100644 index 0000000..3e18ebf --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/ooo/access @@ -0,0 +1 @@ +private diff --git a/root/etc/e-smith/db/configuration/defaults/ooo/status b/root/etc/e-smith/db/configuration/defaults/ooo/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/ooo/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/ooo/type b/root/etc/e-smith/db/configuration/defaults/ooo/type new file mode 100644 index 0000000..24e1098 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/ooo/type @@ -0,0 +1 @@ +service diff --git a/root/etc/e-smith/templates/etc/crontab/80ooo b/root/etc/e-smith/templates/etc/crontab/80ooo new file mode 100644 index 0000000..194495c --- /dev/null +++ b/root/etc/e-smith/templates/etc/crontab/80ooo @@ -0,0 +1,2 @@ +# Restart OOo each night +30 2 * * * root /usr/bin/sv t /service/ooo diff --git a/root/var/service/ooo/logs/run b/root/var/service/ooo/logs/run new file mode 100644 index 0000000..aaab996 --- /dev/null +++ b/root/var/service/ooo/logs/run @@ -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 + diff --git a/root/var/service/ooo/run b/root/var/service/ooo/run new file mode 100644 index 0000000..0e83142 --- /dev/null +++ b/root/var/service/ooo/run @@ -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" + diff --git a/smeserver-ooo-headless.spec b/smeserver-ooo-headless.spec new file mode 100644 index 0000000..ba7edea --- /dev/null +++ b/smeserver-ooo-headless.spec @@ -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 - 0.2.0-1 +- Import in GIT + +* Fri Mar 09 2012 Daniel Berteaud - 0.1-3 +- Fix crontab entry + +* Tue Nov 29 2011 Daniel Berteaud - 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 +