aboutsummaryrefslogtreecommitdiff
path: root/astro/gpsd
diff options
context:
space:
mode:
authorWen Heping <wen@FreeBSD.org>2010-05-28 00:52:25 +0000
committerWen Heping <wen@FreeBSD.org>2010-05-28 00:52:25 +0000
commit68e235b88f7878b80d6be5060a4bddc9ef26c8a5 (patch)
tree8d40cc0d5f62bfa2a74b9938939de650bae26c0d /astro/gpsd
parentd3b77479f4c3cb75c0b9cd2b65ab14dd32687bfa (diff)
downloadports-68e235b88f7878b80d6be5060a4bddc9ef26c8a5.tar.gz
ports-68e235b88f7878b80d6be5060a4bddc9ef26c8a5.zip
Notes
Diffstat (limited to 'astro/gpsd')
-rw-r--r--astro/gpsd/Makefile1
-rw-r--r--astro/gpsd/files/gpsd.in33
2 files changed, 34 insertions, 0 deletions
diff --git a/astro/gpsd/Makefile b/astro/gpsd/Makefile
index 75444e828082..5b1a695ac4d4 100644
--- a/astro/gpsd/Makefile
+++ b/astro/gpsd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= gpsd
PORTVERSION= 2.94
+PORTREVISION= 1
CATEGORIES= astro geography
MASTER_SITES= ${MASTER_SITE_BERLIOS}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/astro/gpsd/files/gpsd.in b/astro/gpsd/files/gpsd.in
index 71a0d0738166..afc7f7563047 100644
--- a/astro/gpsd/files/gpsd.in
+++ b/astro/gpsd/files/gpsd.in
@@ -26,15 +26,48 @@
name=gpsd
rcvar=`set_rcvar`
+start_postcmd=start_postcmd
+stop_postcmd=stop_postcmd
+
+start_postcmd()
+{
+ if ! checkyesno gpxlogger_enable; then
+ return;
+ fi
+
+ cd ${gpxlogger_logdir};
+ gpx=$(date +"${gpxlogger_format}")
+ touch "${pidfile_logger}" "${gpx}"
+ chown nobody:nobody "${pidfile_logger}" "${gpx}"
+ /usr/sbin/daemon -u nobody -p "${pidfile_logger}" \
+ ${gpxlogger} ${gpxlogger_flags} > ${gpx}
+}
+
+stop_postcmd()
+{
+ if ! checkyesno gpxlogger_enable; then
+ return;
+ fi
+
+ /bin/kill $(/bin/cat "${pidfile_logger}")
+}
+
load_rc_config $name
# Set defaults
: ${gpsd_enable:="NO"}
: ${gpsd_flags:=""}
: ${gpsd_devices:=""}
+: ${gpxlogger_enable:="NO"}
+: ${gpxlogger_flags:="-i 600"}
+: ${gpxlogger_logdir:="/var/log"}
+: ${gpxlogger_format:="%d %B %Y - %H:%M.gpx"}
pidfile=/var/run/$name.pid
command=%%PREFIX%%/sbin/$name
command_args="-P $pidfile $gpsd_devices"
+gpxlogger=/usr/local/bin/gpxlogger
+pidfile_logger=/var/run/gpxlogger.pid
+
run_rc_command "$1"