diff options
Diffstat (limited to 'business/trytond')
-rw-r--r-- | business/trytond/README | 33 | ||||
-rw-r--r-- | business/trytond/doinst.sh | 22 | ||||
-rw-r--r-- | business/trytond/rc.trytond | 48 | ||||
-rw-r--r-- | business/trytond/slack-desc | 19 | ||||
-rw-r--r-- | business/trytond/trytond.SlackBuild | 105 | ||||
-rw-r--r-- | business/trytond/trytond.info | 10 |
6 files changed, 237 insertions, 0 deletions
diff --git a/business/trytond/README b/business/trytond/README new file mode 100644 index 0000000000..e62ca86b55 --- /dev/null +++ b/business/trytond/README @@ -0,0 +1,33 @@ +Tryton is a complete ERP. The main features are accounting +(analytic and financial), stock management, sales and purchases management, +POS, etc. Technical features include a distributed server, flexible workflows, +an object database, a dynamic GUI, customizable reports, and SOAP and XML-RPC +interfaces. + +To add modules, you will need pip. + +Before you can use the tryton server, you will have to set up postgresql. All +you have to do is issue the following command: + createuser -U postgres --createdb --no-adduser tryton + +This will setup trytond for use with postgresql on localhost. There is +no need to set a password on localhost. However, if you are going to run +postgresql on a different server, you will have to run createuser like this: + createuser -U postgres --createdb --no-adduser -P tryton + +After initializing postgres, modify /etc/trytond/trytond.conf to match your +local setup. After trytond is setup, then you can run + /etc/rc.d/rc.trytond start + +If you want to install the documentation, optional dependency is Sphinx +documentation program (development/Sphinx). + +For a list of modules that can be added to trytond, at cli type: + pip search trytond + +then to add module, type: + pip install trytond_module_name + +where trydond_module_name is the name of the module. For example, to add +the account package, type: + pip install trytond_account diff --git a/business/trytond/doinst.sh b/business/trytond/doinst.sh new file mode 100644 index 0000000000..b158529247 --- /dev/null +++ b/business/trytond/doinst.sh @@ -0,0 +1,22 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +# Keep same perms on rc.openerp-server.new: +if [ -e etc/rc.d/rc.trytond ]; then + cp -a etc/rc.d/rc.trytond etc/rc.d/rc.trytond.new.incoming + cat etc/rc.d/rc.trytond.new > etc/rc.d/rc.trytond.new.incoming + mv etc/rc.d/rc.trytond.new.incoming etc/rc.d/rc.trytond.new +fi + +config etc/rc.d/rc.trytond.new +config etc/trytond/trytond.conf.new diff --git a/business/trytond/rc.trytond b/business/trytond/rc.trytond new file mode 100644 index 0000000000..8d821a3909 --- /dev/null +++ b/business/trytond/rc.trytond @@ -0,0 +1,48 @@ +#!/bin/sh +# Start/stop/restart trytond server. +# Author: Ken Roberts <alisonken1@juno.com> +# --------------------------------------------------------------------------- + +PIDFILE=/var/spool/trytond/trytond.pid +LOGFILE=/var/log/trytond/trytond.log + +# Start openerp: +trytond_start() { + if [ -x /usr/bin/trytond ]; then + echo "Starting trytond server: /usr/bin/trytond " + if [ -e "$PIDFILE" ]; then + echo "trytond server already running!" + echo "If trytond is not running (improper shutdown?), then remove ${PIDFILE}" + else + /usr/bin/trytond --pidfile=$PIDFILE --logfile=$LOGFILE \ + -c /etc/trytond/trytond.conf & + fi + fi +} + +# Stop trytond: +trytond_stop() { + echo "Stopping openerp-server" + kill -TERM $(cat $PIDFILE) > /dev/null 2>&1 +} + +# Restart trytond: +trytond_restart() { + trytond_stop + sleep 1 + trytond_start +} + +case "$1" in +'start') + trytond_start + ;; +'stop') + trytond_stop + ;; +'restart') + trytond_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac diff --git a/business/trytond/slack-desc b/business/trytond/slack-desc new file mode 100644 index 0000000000..727755ffab --- /dev/null +++ b/business/trytond/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +trytond: trytond (ERP -server part) +trytond: +trytond: Tryton is a complete ERP written in Python. +trytond: This package is for the server only - the modules needed for actual +trytond: usage must be installed separately. +trytond: +trytond: Homepage: http://www.tryton.org +trytond: +trytond: +trytond: +trytond: diff --git a/business/trytond/trytond.SlackBuild b/business/trytond/trytond.SlackBuild new file mode 100644 index 0000000000..fe3ebae9dd --- /dev/null +++ b/business/trytond/trytond.SlackBuild @@ -0,0 +1,105 @@ +#!/bin/sh + +# Slackware build script for Tryton ERP server + +# Copyright 2014, Ken Roberts, California, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=trytond +VERSION=${VERSION:-3.0.3} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +python setup.py install --root=$PKG + +mkdir -p $PKG/etc/{rc.d,trytond} +cp -f $CWD/rc.trytond $PKG/etc/rc.d/rc.trytond.new +cp -f $TMP/$PRGNAM-$VERSION/etc/trytond.conf $PKG/etc/trytond/trytond.conf.new + +mkdir -p $PKG/var/{spool,log}/trytond + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYRIGHT CHANGELOG INSTALL LICENSE README TODO $PKG/usr/doc/$PRGNAM-$VERSION/ +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +# Don't fail if sphinx not installed +if [ -x /usr/bin/sphinx-build ] ; then + ( cd $TMP/$PRGNAM-$VERSION/doc + make html + make pickle + make json + make htmlhelp + make qthelp + PAPER=letter make latex + mv ./_build/* $PKG/usr/doc/$PRGNAM-$VERSION/ + ) +else + echo "Sphinx documenting program not found" + echo "Skipping document building" +fi + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/business/trytond/trytond.info b/business/trytond/trytond.info new file mode 100644 index 0000000000..497efc7f46 --- /dev/null +++ b/business/trytond/trytond.info @@ -0,0 +1,10 @@ +PRGNAM="trytond" +VERSION="3.0.3" +HOMEPAGE="http://www.tryton.org" +DOWNLOAD="http://downloads.tryton.org/3.0/trytond-3.0.3.tar.gz" +MD5SUM="f04432b92fb8fc21438fdffcbeecb256" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="lxml polib psycopg2 pydot python-dateutil pytz relatorio simplejson sql" +MAINTAINER="Ken Roberts" +EMAIL="alisonken1@juno.com" |