aboutsummaryrefslogtreecommitdiffstats
path: root/finance
diff options
context:
space:
mode:
authorwen <wen@FreeBSD.org>2012-08-18 15:18:24 +0800
committerwen <wen@FreeBSD.org>2012-08-18 15:18:24 +0800
commitea8aa23b4f1d2bae3b7da58dd247300aa01f6403 (patch)
tree770c3de3a5166a5db71e7df175e451de5df04efb /finance
parent09cd4e5d232f6d018810e6b082dd0392b5d3232b (diff)
downloadfreebsd-ports-gnome-ea8aa23b4f1d2bae3b7da58dd247300aa01f6403.tar.gz
freebsd-ports-gnome-ea8aa23b4f1d2bae3b7da58dd247300aa01f6403.tar.zst
freebsd-ports-gnome-ea8aa23b4f1d2bae3b7da58dd247300aa01f6403.zip
- Add rc script [1]
- Improve Makefile by use PORTVERSION:R Submitted by: Matthias Petermann <matthias@d2ux.net> (via Email) [1] Reviewed by: dougb@ [1] Thanks to: danfe@ [2]
Diffstat (limited to 'finance')
-rw-r--r--finance/trytond/Makefile3
-rw-r--r--finance/trytond/files/trytond.in41
2 files changed, 43 insertions, 1 deletions
diff --git a/finance/trytond/Makefile b/finance/trytond/Makefile
index 14be34c62e9b..d619e5c30e67 100644
--- a/finance/trytond/Makefile
+++ b/finance/trytond/Makefile
@@ -7,8 +7,9 @@
PORTNAME= trytond
PORTVERSION= 2.4.1
+PORTREVISION= 1
CATEGORIES= finance python
-MASTER_SITES= http://downloads2.tryton.org/2.4/
+MASTER_SITES= http://downloads2.tryton.org/${PORTVERSION:R}/
MAINTAINER= wen@FreeBSD.org
COMMENT= A three-tiers high-level general purpose application platform
diff --git a/finance/trytond/files/trytond.in b/finance/trytond/files/trytond.in
new file mode 100644
index 000000000000..8a4b091c50c2
--- /dev/null
+++ b/finance/trytond/files/trytond.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: trytond
+# REQUIRE: postgresql LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable trytond
+#
+#
+# trytond_enable (bool): Set to "NO" by default,
+# Set it to "YES" to enable trytond
+
+. /etc/rc.subr
+
+name=trytond
+rcvar=trytond_enable
+
+load_rc_config $name
+
+trytond_enable="${trytond_enable:-"NO"}"
+trytond_config="${trytond_config:-"%%PREFIX%%/etc/trytond.conf"}"
+trytond_user="${trytond_user:-"trytond"}"
+trytond_logdir="${trytond_logdir:-"$(dirname `grep logfile %%PREFIX%%/etc/trytond.conf | awk -F "=" ' { print $2 } ' `)"}"
+
+command=%%PREFIX%%/bin/trytond
+command_args="--config=${trytond_config} >/dev/null 2>&1 &"
+
+pidfile="${trytond_pidfile:-"$(grep pidfile %%PREFIX%%/etc/trytond.conf | awk -F "=" ' { print $2 } ' |sed 's/[ ]//g' )"}"
+required_files="${trytond_config}"
+
+start_precmd="${name}_prestart"
+
+trytond_prestart ()
+{
+ install -d -o ${trytond_user} $(dirname "${trytond_pidfile}")
+ install -d -o ${trytond_user} ${trytond_logdir}
+}
+
+run_rc_command "$1"