aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
authorsunpoet <sunpoet@FreeBSD.org>2010-10-13 17:32:34 +0800
committersunpoet <sunpoet@FreeBSD.org>2010-10-13 17:32:34 +0800
commit68a69d5c6fde20bbb4113730e77061e5c86d6a53 (patch)
tree9cf2c41eb34d79f483986c031c72242743b8f220 /astro
parentc1407c1abb07e912d12cb2bd41d4a6acbe18e12f (diff)
downloadfreebsd-ports-gnome-68a69d5c6fde20bbb4113730e77061e5c86d6a53.tar.gz
freebsd-ports-gnome-68a69d5c6fde20bbb4113730e77061e5c86d6a53.tar.zst
freebsd-ports-gnome-68a69d5c6fde20bbb4113730e77061e5c86d6a53.zip
- Add rc.d script
- Bump PORTREVISION Submitted by: glebius (maintainer) Approved by: pgollucci (mentor, implicit)
Diffstat (limited to 'astro')
-rw-r--r--astro/gpxloggerd/Makefile2
-rw-r--r--astro/gpxloggerd/files/gpxloggerd.in45
2 files changed, 47 insertions, 0 deletions
diff --git a/astro/gpxloggerd/Makefile b/astro/gpxloggerd/Makefile
index d0b8313a30d0..cfac10dc5eb1 100644
--- a/astro/gpxloggerd/Makefile
+++ b/astro/gpxloggerd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= gpxloggerd
PORTVERSION= 0.1
+PORTREVISION= 1
CATEGORIES= astro
MASTER_SITES= LOCAL/glebius
@@ -15,6 +16,7 @@ COMMENT= A daemon that connects to the GPSD daemon and logs GPS traces
LIB_DEPENDS= gps.19:${PORTSDIR}/astro/gpsd
+USE_RC_SUBR= ${PORTNAME}
PLIST_FILES= sbin/${PORTNAME}
MAN8= ${PORTNAME}.8
diff --git a/astro/gpxloggerd/files/gpxloggerd.in b/astro/gpxloggerd/files/gpxloggerd.in
new file mode 100644
index 000000000000..027b7384c0f6
--- /dev/null
+++ b/astro/gpxloggerd/files/gpxloggerd.in
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: gpxloggerd
+# REQUIRE: NETWORKING DAEMON cleanvar devfs gpsd
+# BEFORE: ntpd
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable gpxloggerd:
+#
+# gpxloggerd_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable gpxloggerd.
+#
+# gpxloggerd_host (str): Set to "" by default, which is equal
+# to "localhost:2947".
+# Set to host:port if gpsd is not local.
+#
+# gpxloggerd_flags (str): Set to "-d" by default.
+#
+# gpxloggerd_template (str): Set to "/var/log/%d %B %Y - %H:%M.gpx"
+# by default.
+#
+# See gpxloggerd(8) for more info.
+
+. /etc/rc.subr
+
+name=gpxloggerd
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+# Set defaults
+flags="${gpxloggerd_flags:--d}"
+template="${gpxloggerd_template:-/var/log/%d %B %Y - %H:%M.gpx}"
+user="${gpxloggerd_user:-nobody}"
+group="${gpxloggerd_group:-nobody}"
+pidfile=/var/run/$name.pid
+
+command=%%PREFIX%%/sbin/$name
+command_args="${flags} -u ${user}:${group} -p ${pidfile} -f \"${template}\" $gpxloggerd_host"
+
+run_rc_command "$1"