1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00

- 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]
This commit is contained in:
Wen Heping 2012-08-18 07:18:24 +00:00
parent dfe7a32277
commit bd251b6b76
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=302704
2 changed files with 43 additions and 1 deletions

View File

@ -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

View File

@ -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"