diff --git a/README.md b/README.md index e8b5311..764eeda 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,7 @@ https://github.com/aeroo/aeroo_docs/wiki/Installation-example-for-Ubuntu-14.04-L for help: ./aeroo-docs --help + +Debian users can build .deb package with: +dpkg-buildpackage + diff --git a/debian/aeroo-docs b/debian/aeroo-docs new file mode 100755 index 0000000..a4a58f7 --- /dev/null +++ b/debian/aeroo-docs @@ -0,0 +1,62 @@ +#!/bin/bash -e +# /etc/init.d script for aeroo-docs +# + +### BEGIN INIT INFO +# Provides: office +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start daemon at boot time +# Description: Enable service provided by daemon. +### END INIT INFO + + +. /lib/lsb/init-functions + +EXECUTABLE=/usr/bin/aeroo-docs +PIDFILE=/var/run/aeroo-docs.pid + +. /etc/aeroo-docs.conf + +function start { + echo "Starting Aeroo_docs server" + $EXECUTABLE start +} + +function stop { + echo "Stopping Aeroo_docs server." + $EXECUTABLE stop +} + +function stop9 { + echo "Stopping Aeroo_docs server." + kill -9 $(cat $PIDFILE) + rm -f $PIDFILE +} + +case "$1" in +start) + if [ -f $PIDFILE ]; then + echo "Aeroo_docs server has already started." + exit + fi + start +;; +stop) + stop +;; +restart) + stop + start +;; +force-reload) + stop9 + start +;; +*) +echo "Usage: $0 {start|stop|restart|force-reload}" +exit 1 +esac +exit 0 diff --git a/debian/aeroo-docs.conf b/debian/aeroo-docs.conf new file mode 100644 index 0000000..f0bf89a --- /dev/null +++ b/debian/aeroo-docs.conf @@ -0,0 +1,12 @@ +[start] +interface = localhost +port = 8989 +oo-server = localhost +oo-port = 8100 +spool-directory = /var/spool/aeroo-docs +spool-expire = 1800 +log-file = /var/log/aeroo-docs/aeroo_docs.log +pid-file = /var/run/aeroo-docs.pid +[simple-auth] +username = anonymous +password = anonymous diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..2b2b46b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +aeroodocs-server (1.0) unstable; urgency=low + + * Initial release + + -- Luca Vercelli Thu, 17 Sep 2015 22:06:00 +0200 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f11c82a --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 \ No newline at end of file diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..38462df --- /dev/null +++ b/debian/control @@ -0,0 +1,35 @@ +Source: aeroodocs-server +Section: net +Priority: optional +Maintainer: Luca Vercelli +Uploaders: +Build-Depends: debhelper (>= 9.0), python, rsync +X-Python-Version: 2.7 +Standards-Version: 3.9.5.0 +Homepage: http://www.alistek.com/ +Vcs-Git: https://github.com/aeroo/aeroo_docs + +Package: aeroodocs-server +Architecture: all +Depends: + ${misc:Depends}, + python-aeroo, + python3, + python3-pip, + libreoffice-script-provider-python, + libreoffice-base|openoffice.org-base, +Recommends: + aeroo-docs +Description: Python library for Aeroo Reports + Aeroo Library is a templating library which provides a way to easily + output several kinds of files (odt, ods). Support for more filetypes + can be easily added by creating plugins for them. + . + Aeroo Library also provides a report repository allowing you to link + python objects and report together, find reports by mimetype/name/python + object. + . + This package include the server that takes HTTP request from Odoo + and wrap them to Openoffice/Libreoffice Headless server, and an init script + for the latter. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..a747c88 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,19 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Contact: + +Files: * +Copyright: (C) 2010 Alistek Ltd. (http://www.alistek.com) +License: AGPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 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 Affero General Public License for more details. + . + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..ade60bc --- /dev/null +++ b/debian/install @@ -0,0 +1,6 @@ +debian/office /etc/init.d +debian/aeroo-docs /etc/init.d +debian/aeroo-docs.conf /etc +aeroo-docs /usr/lib/aeroo_docs +aeroo_docs_fncs.py /usr/lib/aeroo_docs +DocumentConverter.py /usr/lib/aeroo_docs diff --git a/debian/links b/debian/links new file mode 100644 index 0000000..91dc814 --- /dev/null +++ b/debian/links @@ -0,0 +1,2 @@ +/usr/lib/aeroo_docs/aeroo-docs /usr/bin/aeroo-docs + diff --git a/debian/office b/debian/office new file mode 100755 index 0000000..b6fa71e --- /dev/null +++ b/debian/office @@ -0,0 +1,72 @@ +#!/bin/bash -e +# openoffice.org headless server script +# +# chkconfig: 2345 80 30 +# description: headless openoffice server script +# processname: openoffice +# +# Author: Vic Vijayakumar +# Modified by Federico Ch. Tomasczik +# Modified by Luca Vercelli +# + +### BEGIN INIT INFO +# Provides: office +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start daemon at boot time +# Description: Enable service provided by daemon. +### END INIT INFO + + +. /lib/lsb/init-functions + +OOo_HOME=/usr/bin +SOFFICE_PATH=$OOo_HOME/soffice +PIDFILE=/var/run/openoffice-server.pid + + +function start { + echo "Starting OpenOffice headless server" + $SOFFICE_PATH --headless --nologo --nofirststartwizard --accept="socket,host=127.0.0.1,port=8100;urp" & > /dev/null 2>&1 + echo $! > $PIDFILE +} + +function stop { + echo "Stopping OpenOffice headless server." + killall soffice && killall soffice.bin + rm -f $PIDFILE +} + +function stop9 { + echo "Stopping OpenOffice headless server." + killall -9 soffice && killall -9 soffice.bin + rm -f $PIDFILE +} + +case "$1" in +start) + if [ -f $PIDFILE ]; then + echo "OpenOffice headless server has already started." + exit + fi + start +;; +stop) + stop +;; +restart) + stop + start +;; +force-reload) + stop9 + start +;; +*) +echo "Usage: $0 {start|stop|restart|force-reload}" +exit 1 +esac +exit 0 diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..0130841 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,10 @@ +#!/bin/bash -e + +update-rc.d office defaults +update-rc.d aeroo-docs defaults + +#As far as I can see, these eggs are not packaged in Debian: +pip3 install jsonrpc2 daemonize + +#DEBHELPER# + diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..3267a6d --- /dev/null +++ b/debian/postrm @@ -0,0 +1,5 @@ +#!/bin/bash -e +update-rc.d office defaults +update-rc.d aeroo-docs defaults + +#DEBHELPER# diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..8b614ba --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +# vim:noet: + +%: + dh ${@}