aboutsummaryrefslogtreecommitdiff
path: root/databases/kyototycoon
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2017-05-20 21:51:02 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2017-05-20 21:51:02 +0000
commit63aa7d5634d99d57ee8bc99037b88f2a14641b30 (patch)
tree56ff41b3c880d3e9eb202c63f6781a3e26cdf6c0 /databases/kyototycoon
parentb7f247b637384d99d8dc7543874956844dfeb2dd (diff)
downloadports-63aa7d5634d99d57ee8bc99037b88f2a14641b30.tar.gz
ports-63aa7d5634d99d57ee8bc99037b88f2a14641b30.zip
Notes
Diffstat (limited to 'databases/kyototycoon')
-rw-r--r--databases/kyototycoon/Makefile23
-rw-r--r--databases/kyototycoon/files/kyototycoon.in56
2 files changed, 78 insertions, 1 deletions
diff --git a/databases/kyototycoon/Makefile b/databases/kyototycoon/Makefile
index 43f4db831c2b..d437fcf28c1e 100644
--- a/databases/kyototycoon/Makefile
+++ b/databases/kyototycoon/Makefile
@@ -3,7 +3,7 @@
PORTNAME= kyototycoon
PORTVERSION= 0.9.56
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= databases
MASTER_SITES= http://fallabs.com/${PORTNAME}/pkg/ \
LOCAL/sunpoet
@@ -26,9 +26,30 @@ MAKE_ARGS= PCDIR=${PREFIX}/libdata/pkgconfig
REINPLACE_ARGS= -i ''
TEST_TARGET= check
USE_LDCONFIG= yes
+USE_RC_SUBR= ${PORTNAME}
USES= gmake pkgconfig
+PLIST_SUB= KYOTOTYCOON_USER=${KYOTOTYCOON_USER} \
+ KYOTOTYCOON_GROUP=${KYOTOTYCOON_GROUP} \
+ KYOTOTYCOON_DBDIR=${KYOTOTYCOON_DBDIR} \
+ KYOTOTYCOON_LOGDIR=${KYOTOTYCOON_LOGDIR} \
+ KYOTOTYCOON_PIDFILE=${KYOTOTYCOON_PIDFILE}
PORTDOCS= *
+SUB_FILES= ${PORTNAME}
+SUB_LIST= KYOTOTYCOON_USER=${KYOTOTYCOON_USER} \
+ KYOTOTYCOON_GROUP=${KYOTOTYCOON_GROUP} \
+ KYOTOTYCOON_DBDIR=${KYOTOTYCOON_DBDIR} \
+ KYOTOTYCOON_LOGDIR=${KYOTOTYCOON_LOGDIR} \
+ KYOTOTYCOON_PIDFILE=${KYOTOTYCOON_PIDFILE}
+
+USERS= ${KYOTOTYCOON_USER}
+GROUPS= ${KYOTOTYCOON_GROUP}
+
+KYOTOTYCOON_USER?= ${PORTNAME}
+KYOTOTYCOON_GROUP?= ${PORTNAME}
+KYOTOTYCOON_DBDIR?= /var/db/${PORTNAME}
+KYOTOTYCOON_LOGDIR?= /var/log/${PORTNAME}
+KYOTOTYCOON_PIDFILE?= /var/run/${PORTNAME}.pid
LZO_CONFIGURE_OFF= ac_cv_lib_lzo2_main=no
LZO_CONFIGURE_ON= ac_cv_lib_lzo2_main=yes
diff --git a/databases/kyototycoon/files/kyototycoon.in b/databases/kyototycoon/files/kyototycoon.in
new file mode 100644
index 000000000000..fa45f0efb9c6
--- /dev/null
+++ b/databases/kyototycoon/files/kyototycoon.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: kyototycoon
+# REQUIRE: LOGIN NETWORKING SERVERS
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# kyototycoon_enable (bool): Set to NO by default.
+# Set it to YES to enable kyototycoon.
+#
+# kyototycoon_user (user): Set to kyototycoon by default.
+# kyototycoon_group (group): Set to kyototycoon by default.
+# kyototycoon_dbdir (path): Path to database files.
+# kyototycoon_log (path): Path to log file.
+# kyototycoon_sid (int): ServerID - 0-65535
+# kyototycoon_opts (args): Additional command-line arguments.
+
+. /etc/rc.subr
+
+name="kyototycoon"
+rcvar=kyototycoon_enable
+
+load_rc_config $name
+
+: ${kyototycoon_enable="NO"}
+: ${kyototycoon_user:="%%KYOTOTYCOON_USER%%"}
+: ${kyototycoon_group:="%%KYOTOTYCOON_GROUP%%"}
+: ${kyototycoon_dbdir="%%KYOTOTYCOON_DBDIR%%"}
+: ${kyototycoon_log="%%KYOTOTYCOON_LOGDIR%%/kyoto.log"}
+: ${kyototycoon_sid="1"}
+: ${kyototycoon_opts:=" -li"}
+
+command="/usr/sbin/daemon"
+command_args="-f -c -r -t ${name} -P ${pidfile} \
+ %%PREFIX%%/bin/ktserver \
+ -bgs ${kyototycoon_dbdir}/snapshots \
+ -ulog ${kyototycoon_dbdir}/updates \
+ -log ${kyototycoon_log} \
+ -sid ${kyototycoon_sid} \
+ ${kyototycoon_opts}"
+pidfile="%%KYOTOTYCOON_PIDFILE%%"
+
+required_dirs="${kyototycoon_dbdir}/snapshots ${kyototycoon_dbdir}/updates"
+required_files="${kyototycoon_log}"
+
+kyototycoon_prestart()
+{
+ install -o ${kyototycoon_user} /dev/null ${pidfile}
+}
+start_precmd=${name}_prestart
+
+run_rc_command "$1"