diff options
author | wen <wen@FreeBSD.org> | 2012-09-18 08:57:12 +0800 |
---|---|---|
committer | wen <wen@FreeBSD.org> | 2012-09-18 08:57:12 +0800 |
commit | 4015064b3ddf5f1fe372b605513f9bc4ab27d06d (patch) | |
tree | 40bf37c6548bf3a94661cdfb71dbb31bab08abc2 | |
parent | c08bc0fa5e6f48890de4c91143e031dc912202b8 (diff) | |
download | freebsd-ports-gnome-4015064b3ddf5f1fe372b605513f9bc4ab27d06d.tar.gz freebsd-ports-gnome-4015064b3ddf5f1fe372b605513f9bc4ab27d06d.tar.zst freebsd-ports-gnome-4015064b3ddf5f1fe372b605513f9bc4ab27d06d.zip |
- Create gid and uid for tryton daemon and use them via USERS and GROUPS variables at Makefile
- Install the existing rc.d script (define USE_RC_SUBR at Makefile)
- Define the command_interpreter variable at the rc.d script (stop and status commands need it)
- Create needed directories at trytond_prestart (rc.d script) with appropriate gid and launch install once
- Rename option OPENSSL -> PYOPENSSL
- Make use of configuration and sample file (both for the port and for the package)
PR: 171716
Submitted by: bsam@, Matthias Petermann <matthias@d2ux.net>(via Email)
-rw-r--r-- | GIDs | 1 | ||||
-rw-r--r-- | UIDs | 1 | ||||
-rw-r--r-- | finance/trytond/Makefile | 22 | ||||
-rw-r--r-- | finance/trytond/files/pkg-message.in | 5 | ||||
-rw-r--r-- | finance/trytond/files/trytond.in | 6 | ||||
-rw-r--r-- | finance/trytond/pkg-plist | 3 |
6 files changed, 26 insertions, 12 deletions
@@ -238,5 +238,6 @@ pandora:*:956: razorback:*:957: gnunet:*:958: c_icap:*:959: +trytond:*:960: nogroup:*:65533: nobody:*:65534: @@ -242,4 +242,5 @@ pandora:*:956:956::0:0:Pandora FMS user:/usr/local/etc/pandora/home:/usr/sbin/no razorback:*:957:957::0:0:Razorback user:/var/run/razorback:/usr/sbin/nologin gnunet:*:958:958::0:0:GNUnet daemon:/var/lib/gnunet:/usr/sbin/nologin c_icap:*:959:959::0:0:c-icap daemon:/var/empty:/usr/sbin/nologin +trytond:*:960:960::0:0:trytond daemon:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin diff --git a/finance/trytond/Makefile b/finance/trytond/Makefile index d619e5c30e67..3ecef626a5fc 100644 --- a/finance/trytond/Makefile +++ b/finance/trytond/Makefile @@ -7,7 +7,7 @@ PORTNAME= trytond PORTVERSION= 2.4.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= finance python MASTER_SITES= http://downloads2.tryton.org/${PORTVERSION:R}/ @@ -24,15 +24,20 @@ BUILD_DEPENDS= ${PYTHON_SITELIBDIR}/mx/__init__.py:${PORTSDIR}/lang/py-mx-base \ ${PYTHON_PKGNAMEPREFIX}polib>=0.7.0:${PORTSDIR}/devel/py-polib RUN_DEPENDS:= ${BUILD_DEPENDS} -OPTIONS_DEFINE= WEBDAV OPENSSL PYDOT PYTZ +USERS= trytond +GROUPS= trytond + +OPTIONS_DEFINE= WEBDAV PYOPENSSL PYDOT PYTZ WEBDAV_DESC= Add support for pywebdav -OPENSSL_DESC= Add support for pyOpenSSL +PYOPENSSL_DESC= Add support for pyOpenSSL PYDOT_DESC= Add support for pydot PYTZ_DESC= Add support for pytz +USE_RC_SUBR= ${PORTNAME} SUB_FILES= pkg-message SUB_LIST= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} \ - PYEASYINSTALL_EGG=${PYEASYINSTALL_EGG} + PYEASYINSTALL_EGG=${PYEASYINSTALL_EGG} \ + PYTHON=${PYTHON_CMD} USE_PYTHON= yes USE_PYDISTUTILS=easy_install @@ -43,7 +48,7 @@ USE_PYDISTUTILS=easy_install RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}PyWebDAV>=0:${PORTSDIR}/www/py-pywebdav .endif -.if ${PORT_OPTIONS:MOPENSSL} +.if ${PORT_OPTIONS:MPYOPENSSL} RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}openssl>=0:${PORTSDIR}/security/py-openssl .endif @@ -56,6 +61,11 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}pytz>=0:${PORTSDIR}/devel/py-pytz .endif post-install: - @${CAT} ${PKGMESSAGE} + ${CP} -p ${WRKSRC}/etc/${PORTNAME}.conf ${PREFIX}/etc/${PORTNAME}.conf.sample + @if [ ! -f ${PREFIX}/etc/${PORTNAME}.conf ]; then \ + ${CP} -p ${PREFIX}/etc/${PORTNAME}.conf.sample ${PREFIX}/etc/${PORTNAME}.conf ; \ + fi + + @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/finance/trytond/files/pkg-message.in b/finance/trytond/files/pkg-message.in index f60ed91cd7d5..e9b0d18b9522 100644 --- a/finance/trytond/files/pkg-message.in +++ b/finance/trytond/files/pkg-message.in @@ -5,9 +5,8 @@ Before you start the trytond server, you should: 1) Install a PostgreSQL server. -2) Edit the file : -%%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/config.py -based on the configuration of your PostgreSQL server. +2) Use the configuration file %%PREFIX%%/etc/trytond.conf +to customize the daemon. For more information, see the DOCUMENTATION: diff --git a/finance/trytond/files/trytond.in b/finance/trytond/files/trytond.in index 8a4b091c50c2..2947faa50f04 100644 --- a/finance/trytond/files/trytond.in +++ b/finance/trytond/files/trytond.in @@ -1,6 +1,6 @@ #!/bin/sh -# $FreeBSD$ +# $FreeBSD: ports/finance/trytond/files/trytond.in,v 1.1 2012/08/18 07:18:24 wen Exp $ # # PROVIDE: trytond # REQUIRE: postgresql LOGIN @@ -25,6 +25,7 @@ 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_interpreter=%%PYTHON%% 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' )"}" @@ -34,8 +35,7 @@ start_precmd="${name}_prestart" trytond_prestart () { - install -d -o ${trytond_user} $(dirname "${trytond_pidfile}") - install -d -o ${trytond_user} ${trytond_logdir} + install -d -o ${trytond_user} -g ${trytond_user} $(dirname "${pidfile}") "${trytond_logdir}" } run_rc_command "$1" diff --git a/finance/trytond/pkg-plist b/finance/trytond/pkg-plist index ba3e6720f69a..9db54b61b9b9 100644 --- a/finance/trytond/pkg-plist +++ b/finance/trytond/pkg-plist @@ -494,6 +494,9 @@ bin/trytond %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/wizard/wizard.py %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/wizard/wizard.pyc %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/wizard/wizard.pyo +@unexec if cmp -s %D/etc/trytond.conf.sample %D/etc/trytond.conf; then rm -f %D/etc/trytond.conf; fi +etc/trytond.conf.sample +@exec if [ ! -f %D/etc/trytond.conf ] ; then cp -p %D/%F %B/trytond.conf; fi @dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/wizard @dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/webdav/locale @dirrm %%PYTHON_SITELIBDIR%%/%%PYEASYINSTALL_EGG%%/trytond/webdav |