system/gpsd: Updated for version 3.9.

Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
This commit is contained in:
David Spencer 2013-06-03 01:21:49 -05:00 committed by Robby Workman
parent 674a98e3a7
commit 4e363cbe17
9 changed files with 122 additions and 295 deletions

View file

@ -4,28 +4,31 @@ location, course, and velocity available to be queried on TCP port
2947 of the host computer. With gpsd, multiple GPS client applications
(such as navigational and wardriving software) can share access to GPSes
without contention or loss of data. Applications that presently use
gpsd include Viking and Kismet.
gpsd include Viking, foxtrotgps and Kismet.
See README.build for some additional build options that might be useful.
See README.build for some build options that might be useful.
To enable automatic startup of gpsd at boot time, or when a GPS device is
connected via USB, you need to do the following three steps:
To enable automatic startup of gpsd at boot time, or when a GPS device
is connected via USB, you need to do the following four steps:
1. Edit the file /lib/udev/rules.d/97-gpsd.rules and uncomment the line
(or lines) beginning '#ATTRS' that corresponds to your GPS hardware and
save it in /etc/udev/rules.d/. To avoid confusion with other USB serial
devices that you might have, do not uncomment lines that do not
correspond to your GPS hardware.
1. Copy the file /lib/udev/rules.d/97-gpsd.rules to /etc/udev/rules.d/
2. Make the file /etc/rc.d/rc.gpsd executable.
2. Edit the file /etc/udev/rules.d/97-gpsd.rules and uncomment the line
(or lines) beginning '#ATTRS' that corresponds to your GPS hardware.
To avoid confusion with other USB serial devices that you might have,
do not uncomment lines that do not correspond to your GPS hardware.
But if you do not know which line to uncomment, and you do not have any
other serial devices, you can uncomment them all :-)
3. Make the file /etc/rc.d/rc.gpsd executable.
chmod +x /etc/rc.d/rc.gpsd
3. Add the following lines to /etc/rc.d/rc.local
4. Add the following lines to /etc/rc.d/rc.local
if [ -x /etc/rc.d/rc.gpsd ]; then
/etc/rc.d/rc.gpsd start
fi
Configuration options may be set in the file /etc/rc.d/rc.gpsd.conf. The
defaults will usually be adequate. However, if your GPS is on a real (non-USB)
serial port -- for example, /dev/ttyS0 -- you should add /dev/ttyS0 to
GPS_DEVICES in /etc/rc.d/rc.gpsd.conf.
Configuration options may be set in the file /etc/rc.d/rc.gpsd.conf.
The defaults will usually be adequate. However, if your GPS is on a
real (non-USB) serial port -- for example, /dev/ttyS0 -- you should add
/dev/ttyS0 to GPS_DEVICES in /etc/rc.d/rc.gpsd.conf.

View file

@ -1,64 +1,73 @@
Enabling and disabling devices and features
-------------------------------------------
Support for various devices and features may be enabled
and/or disabled by setting the variables ENABLE and DISABLE
before running gpsd.SlackBuild, for example
Support for various devices and features may be enabled and/or disabled by
setting the variables ENABLE and DISABLE before running gpsd.SlackBuild,
for example
ENABLE="bluetooth,pps-on-cts" DISABLE=pps ./gpsd.SlackBuild
ENABLE="fixed_port_speed=9600,timing" DISABLE="bluez,ipv6" ./gpsd.SlackBuild
Multiple options may be separated by commas (as shown above)
or by spaces.
Multiple options may be separated by commas (as shown above) or by spaces.
The following devices and features may be enabled
(by default they are disabled).
The following features may be enabled (by default they are disabled).
dbus_export enable DBUS export support
profiling enable profiling support
pps-on-cts Enable PPS pulse on CTS rather than DCD
gpsd-user=username
GPSD privilege revokation user (default 'nobody')
fixed-port-speed=nnn
compile with fixed serial port speed
max-clients=nnn
compile with limited maximum clients
max-devices=nnn
compile with maximum allowed devices
squelch squelch gpsd_report and gpsd_hexdump to save cpu
raw enable raw measurement processing
bluetooth enable experimental Bluetooth support via BlueZ
timing enable latency timing support
squelch enable gpsd_report/gpsd_hexdump suppression (saves cpu)
gpsd_group=groupname
set privilege revocation group (default=dialout)
gpsd_user=username
set privilege revocation user (default=nobody)
fixed_port_speed=nnnn
set fixed serial port speed
fixed_stop_bits=n
set fixed serial port stop bits
limited_max_clients=n
set maximum allowed clients
limited_max_devices=n
set maximum allowed devices
The following devices and features may be disabled
(by default they are enabled).
The following devices and features may be disabled (by default they are
enabled).
dbus disable DBUS support
nmea disable NMEA support
oncore disable Motorola OnCore chipset support
sirf disable SiRF chipset support
superstar2 disable SuperStarII chipset support
tsip disable Trimble TSIP support
fv18 disable San Jose Navigation FV-18 support
tripmate disable DeLorme TripMate support
earthmate disable DeLorme EarthMate Zodiac support
itrax disable iTrax hardware support
ashtech disable Ashtech support
navcom disable Navcom support
garmin disable Garmin kernel driver support
garmintxt disable Garmin Simple Text support
tnt disable True North Technologies support
oceanserver disable OceanServer support
ubx disable UBX Protocol support
geostar disable Geostar Protocol support
evermore disable EverMore binary support
mkt3301 disable MKT-3301 support
gpsclock disable GPSClock support
rtcm104v2 disable rtcm104v2 support
rtcm104v3 disable rtcm104v3 support
ntrip disable NTRIP support
aivdm disable Aivdm support
ntpshm disable NTP time hinting support
pps disable PPS time syncing support
timing disable latency timing support
reconfigure do not allow gpsd to change device settings
controlsend do not allow gpsctl/gpsmon to change device settings
aivdm disable AIVDM support
ashtech disable Ashtech support
bluez disable BlueZ support for Bluetooth devices
control_socket disable control socket for hotplug notifications
controlsend disable gpsctl/gpsmon can change device settings
earthmate disable DeLorme EarthMate Zodiac support
evermore disable EverMore binary support
fury disable Jackson Labs Fury and Firefly support
fv18 disable San Jose Navigation FV-18 support
garmin disable Garmin kernel driver support
garmintxt disable Garmin Simple Text support
geostar disable Geostar Protocol support
gpsclock disable GPSClock support
ipv6 disable build IPv6 support
itrax disable iTrax hardware support
mtk3301 disable MTK-3301 support
navcom disable Navcom support
netfeed disable support for handling TCP/IP data sources
nmea disable NMEA support
nmea2000 disable NMEA2000/CAN support
ntpshm disable NTP time hinting support
ntrip disable NTRIP support
oceanserver disable OceanServer support
oldstyle disable oldstyle (pre-JSON) protocol support
oncore disable Motorola OnCore chipset support
passthrough disable support for passing through JSON
pps disable PPS time syncing support
reconfigure disable gpsd can change device settings
rtcm104v2 disable rtcm104v2 support
rtcm104v3 disable rtcm104v3 support
shm_export disable export via shared memory
sirf disable SiRF chipset support
socket_export disable data export over sockets
superstar2 disable Novatel SuperStarII chipset support
tnt disable True North Technologies support
tripmate disable DeLorme TripMate support
tsip disable Trimble TSIP support
ubx disable UBX Protocol support

View file

@ -1,22 +0,0 @@
diff -Nur gpsd-2.39.orig/libgps.pc.in gpsd-2.39/libgps.pc.in
--- gpsd-2.39.orig/libgps.pc.in 2009-02-17 06:56:57.000000000 -0600
+++ gpsd-2.39/libgps.pc.in 2009-10-05 14:30:12.894417725 -0500
@@ -1,6 +1,6 @@
prefix=@prefix@
exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=@libdir@
includedir=${prefix}/include
Name: GPSD
diff -Nur gpsd-2.39.orig/libgpsd.pc.in gpsd-2.39/libgpsd.pc.in
--- gpsd-2.39.orig/libgpsd.pc.in 2009-02-17 06:56:57.000000000 -0600
+++ gpsd-2.39/libgpsd.pc.in 2009-10-05 14:30:22.191417725 -0500
@@ -1,6 +1,6 @@
prefix=@prefix@
exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+libdir=@libdir@
includedir=${prefix}/include
Name: libgpsd

View file

@ -1,6 +1,7 @@
#!/bin/sh
# Slackware build script for gpsd
# Copyright 2011 David Spencer, Baildon, West Yorkshire, U.K.
# All rights reserved.
#
@ -22,8 +23,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=gpsd
VERSION=${VERSION:-2.95}
BUILD=${BUILD:-2}
VERSION=${VERSION:-3.9}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -59,14 +60,21 @@ ENABLELIST=""
set -- $(echo $ENABLE | sed 's/,/ /g')
while [ "$1" != "" ]
do
ENABLELIST+=" --enable-$1"
case "$1" in
*=* )
ENABLELIST+=" $1"
;;
* )
ENABLELIST+=" $1=yes"
;;
esac
shift
done
DISABLELIST=""
set -- $(echo $DISABLE | sed 's/,/ /g')
while [ "$1" != "" ]
do
DISABLELIST+=" --disable-$1"
DISABLELIST+=" $1=no"
shift
done
@ -79,29 +87,20 @@ cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .
# Fixup the pkgconfig file templates
# (force "pkg-config --libs libgps[d]" to return -L/usr/lib64 on x86_64)
patch -p1 < $CWD/gpsd-pkgconfig_templates.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--disable-static \
--enable-dbus \
--build=$ARCH-slackware-linux \
CFLAGS=$SLKCFLAGS \
scons \
prefix=/usr \
libdir=/usr/lib${LIBDIRSUFFIX} \
pkgconfigdir=/usr/lib${LIBDIRSUFFIX}/pkgconfig \
mandir=/usr/man \
chrpath=no \
$ENABLELIST \
$DISABLELIST
make
# --no-print-directory prevents crazy gps-2.94-py2.6.egg-info install path
# (thanks again Niels Horn!)
make --no-print-directory install-strip DESTDIR=$PKG
DESTDIR=$PKG \
scons \
--implicit-deps-unchanged \
install
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $(find $PKG/usr/man -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
@ -113,12 +112,14 @@ install -D -m 0644 $CWD/xgpsspeed.desktop \
install -D -m 0644 packaging/X11/gpsd-logo.png \
$PKG/usr/share/pixmaps/gpsd-logo.png
# Use hotplug scripts from gpsd-3.0 instead of 2.95 -- they work ;-)
install -D -m 0755 $CWD/gpsd.hotplug \
# Get hotplug config from /etc/rc.d/rc.gpsd.conf not /etc/default/gpsd
sed -i 's;/etc/default/gpsd;/etc/rc.d/rc.gpsd.conf;' gpsd.hotplug
install -D -m 0755 gpsd.hotplug \
$PKG/lib/udev/gpsd.hotplug
install -D -m 0755 $CWD/gpsd.hotplug.wrapper \
$PKG/lib/udev/gpsd.hotplug.wrapper
mkdir -p $PKG/lib/udev/rules.d
# Comment out all udev rules: the user is expected to enable only the
# rules required (see README)
cat gpsd.rules | \
sed 's/^ATTRS/#&/' \
>$PKG/lib/udev/rules.d/97-gpsd.rules

View file

@ -1,124 +0,0 @@
#!/usr/bin/python
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
#
# Hotplug script for gpsd by Eric S. Raymond, March 2005
# This script is part of the gpsd distribution: see http://gpsd.berlios.de
# Can be called like "gpsd.hotplug [add|remove] /dev/ttyUSB0" for test
# purposes.
import sys, time, os, syslog, glob, socket, stat
CONTROL_SOCKET = os.getenv('GPSD_SOCKET') or "/var/run/gpsd.sock"
GPSD_OPTIONS = os.getenv('GPSD_OPTIONS') or ""
WHEREAMI = __file__
def gpsd_control_connect(complain=True):
"Acquire a connection to the GPSD control socket."
if not os.path.exists(CONTROL_SOCKET):
syslog.syslog("socket %s doesn't exist" % CONTROL_SOCKET)
return None
try:
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
sock.connect(CONTROL_SOCKET)
except socket.error, msg:
if complain:
syslog.syslog("socket %s creation failure: %s" % (CONTROL_SOCKET, msg))
if sock:
sock.close()
sock = None
#else:
# syslog.syslog("socket %s created OK" % CONTROL_SOCKET)
return sock
def gpsd_control(action, argument):
"Pass a command to gpsd; start the daemon if not already running."
syslog.syslog("gpsd_control(action=%s, arg=%s)" % (action, argument))
connect = gpsd_control_connect(complain=False)
if connect:
syslog.syslog("reached a running gpsd")
elif action == 'add':
gpsdcmd = "gpsd %s -F %s" % (GPSD_OPTIONS, CONTROL_SOCKET)
syslog.syslog("launching %s" % gpsdcmd)
os.system(gpsdcmd)
connect = gpsd_control_connect(complain=True)
if not connect:
syslog.syslog("can't reach gpsd")
return None
# We've got a live connection to the gpsd control socket. No
# need to parse the response, because gpsd will lock on to the
# device if it's really a GPS and ignore it if it's not.
if action == 'add':
# Force the group-read & group-write bits on, so gpsd will still be
# able to use this device after dropping root privileges.
os.chmod(argument, stat.S_IMODE(os.stat(argument)[stat.ST_MODE])|0660)
connect.sendall("+%s\r\n" % argument)
connect.recv(12)
elif action == 'remove':
connect.sendall("-%s\r\n" % argument)
connect.recv(12)
elif action == 'send':
connect.sendall("%s\r\n" % argument)
connect.recv(12)
connect.close()
#syslog.syslog("gpsd_control ends")
return action
def hotplug(action, devpath):
#syslog.syslog("ACTION=%s DEVPATH=%s" % (action,devpath))
if not devpath:
syslog.syslog("No device")
else:
subnodes = glob.glob("/sys" + devpath + "/*")
subnodes = map(os.path.basename, subnodes)
subnodes = filter(lambda s: s.startswith("ttyUSB"), subnodes)
if len(subnodes) == 0:
syslog.syslog("no ttyUSB device under " + devpath)
return
elif len(subnodes) > 1:
syslog.syslog("too many ttyUSB devices under " + devpath)
return
else:
tty = "/dev/" + subnodes[0]
syslog.syslog("waiting for " + tty)
while not os.path.exists(tty):
time.sleep(1)
syslog.syslog(tty + " has gone active")
gpsd_control(action, tty)
remover = os.getenv("REMOVER")
#syslog.syslog("REMOVER=%s" % remover)
fp = open(remover, "w")
fp.write(WHEREAMI + " remove " + tty)
fp.close()
os.chmod(remover, stat.S_IRUSR|stat.S_IXUSR|stat.S_IRGRP|stat.S_IXGRP)
return
if __name__ == '__main__':
# In recent versions of udev, the gpsd script runs in series with
# the task that creates the real /dev/ttyUSB0 device
# node. Unfortunately, the gpsd script runs BEFORE the creation of
# the node, and the node is not created until after you kill the
# gpsd script, because the gpsd script waits forever for the node
# to appear.
#
# This is a race condition, and is best fixed by running the
# actual wait/hotplug portion in the background.
pid = os.fork()
if not pid:
syslog.openlog('gpsd.hotplug', 0, syslog.LOG_DAEMON)
try:
if len(sys.argv) == 1: # Called as hotplug script
hotplug(os.getenv("ACTION"), os.getenv("DEVPATH"))
else: # Called by hand for testing
gpsd_control(sys.argv[1], sys.argv[2])
except:
(exc_type, exc_value, exc_traceback) = sys.exc_info()
syslog.syslog("gpsd.hotplug: exception %s yields %s" % (exc_type, exc_value))
raise exc_type, exc_value, exc_traceback
#syslog.syslog("gpsd.hotplug ends")
syslog.closelog()

View file

@ -1,41 +0,0 @@
#!/bin/sh
#
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
# [Modified to add Slackware-friendly conf file]
PATH=/usr/sbin:$PATH
export PATH
if [ -r /etc/default/gpsd ]; then
. /etc/default/gpsd
elif [ -r /etc/sysconfig/gpsd ]; then
. /etc/sysconfig/gpsd
GPSD_OPTIONS=$OPTIONS
GPSD_SOCKET=$CONTROL_SOCKET
elif [ -r /etc/rc.d/rc.gpsd.conf ]; then
. /etc/rc.d/rc.gpsd.conf
fi
if [ -n "$GPSD_OPTIONS" ]; then
export GPSD_OPTIONS
fi
if [ -n "$GPSD_SOCKET" ]; then
export GPSD_SOCKET
fi
if [ -n "$USBAUTO" ]; then
[ "$USBAUTO" = "true" ] || exit 0
fi
if [ "$ACTION" = "remove" ] ; then
if echo $DEVLINKS | grep -q /dev/gps; then
exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
fi
exit 0
fi
if [ -x /usr/bin/python ]; then
exec /lib/udev/gpsd.hotplug "$ACTION" "$DEVNAME"
fi

View file

@ -1,10 +1,10 @@
PRGNAM="gpsd"
VERSION="2.95"
HOMEPAGE="http://gpsd.berlios.de/"
DOWNLOAD="http://download.berlios.de/gpsd/gpsd-2.95.tar.gz"
MD5SUM="12535a9ed9fecf9ea2c5bdc9840da5ae"
VERSION="3.9"
HOMEPAGE="http://catb.org/gpsd/"
DOWNLOAD="http://download-mirror.savannah.gnu.org/releases/gpsd/gpsd-3.9.tar.gz"
MD5SUM="53a88f24a0973d23427e82e9a8914f19"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
REQUIRES="scons"
MAINTAINER="David Spencer"
EMAIL="baildon.research@googlemail.com"

View file

@ -12,8 +12,9 @@
gpsd_start() {
if [ ! -x /lib/udev/gpsd.hotplug.wrapper ]; then
echo "$(basename $0): /lib/udev/gpsd.hotplug.wrapper not found (or not executable); cannot start."
if [ ! -x /lib/udev/gpsd.hotplug ]; then
echo "$(basename $0): /lib/udev/gpsd.hotplug not found (or not executable); cannot start."
exit 1
fi
if [ -r /etc/rc.d/rc.gpsd.conf ]; then
@ -27,7 +28,7 @@ gpsd_start() {
for DEVNAME in $GPSD_DEVICES; do
if [ -e $DEVNAME ]; then
echo "$(basename $0): Starting gpsd for $DEVNAME"
ACTION=add DEVNAME=$DEVNAME /lib/udev/gpsd.hotplug.wrapper
ACTION=add DEVNAME=$DEVNAME /lib/udev/gpsd.hotplug
else
echo "$(basename $0): $DEVNAME not found, gpsd not started"
fi

View file

@ -1,9 +1,9 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
# The "handy ruler" below makes it easier to edit a package description.
# Line up the first '|' above the ':' following the base package name, and
# the '|' on the right side marks the last column you can put a character in.
# You must make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
gpsd: gpsd (GPS service daemon)