SHA256
1
0
forked from pool/gpsd
OBS User unknown 2008-11-28 14:05:46 +00:00 committed by Git OBS Bridge
parent 8f02528060
commit 91eaed65cc
4 changed files with 57 additions and 42 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon Nov 24 12:05:49 CET 2008 - jreuter@suse.de
- Disable TrueNorth Technologies device support, it breaks
autodection (bnc#448002)
- Fix udev script again: must not kill running gpsd if disabled,
missing quotes in test, indention, add parameter to set additional
command line options for gpsd.
-------------------------------------------------------------------
Wed Nov 19 12:14:42 CET 2008 - jreuter@suse.de

View File

@ -24,7 +24,7 @@ License: BSD 3-Clause
Url: http://gpsd.berlios.de/
Group: Hardware/Other
Version: 2.37
Release: 69
Release: 70
Requires: udev
PreReq: coreutils %fillup_prereq
BuildRequires: gcc-c++ ncurses-devel openmotif openmotif-devel python-devel udev update-desktop-files xmlto
@ -141,8 +141,7 @@ Authors:
%if 0%{?suse_version} > 1020
--enable-dbus \
%endif
--enable-garmintxt \
--enable-tnt
--enable-garmintxt
%__make %{?jobs:-j%jobs}
%install
@ -243,6 +242,12 @@ rm -rf %{buildroot}
%{_datadir}/pixmaps/*.xpm
%changelog
* Mon Nov 24 2008 jreuter@suse.de
- Disable TrueNorth Technologies device support, it breaks
autodection (bnc#448002)
- Fix udev script again: must not kill running gpsd if disabled,
missing quotes in test, indention, add parameter to set additional
command line options for gpsd.
* Wed Nov 19 2008 jreuter@suse.de
- Sleep a second before setting the default device in udev
script to give gpsd some time to set up the TCP socket

View File

@ -1,18 +1,24 @@
## Path: Hardware/GPS
## Description: GPS Daemon
## Description: TCP port number for gpsd to listen on
## Type: integer
## Default: 2947
#
# Use another port for the deamon
#
PORT=
## Description: Start gpsd by udev
## Type: yesno
## Default: no
#
# Whether or not to start gpsd automatically on plugin event
#
STARTBYUDEV="no"
GPSD_STARTBYUDEV="no"
## Type: integer
## Default: 2947
#
# Use different port for the daemon
#
GPSD_PORT=
## Type: string
## Default: ""
#
# Further options to gpsd
#
GPSD_OPTIONS=""

View File

@ -2,6 +2,11 @@
CTRL_SOCK="/var/run/gpsd.socket"
DEV_NAME="/var/run/gpsd.device"
. /etc/sysconfig/gpsd
if [ "$GPSD_STARTBYUDEV" != "yes" ]; then
exit 1
fi
if [ "${ACTION}" = "remove" ]; then
GPSD_PID=$(pidof gpsd)
@ -13,40 +18,30 @@ if [ "${ACTION}" = "remove" ]; then
TTYDEV="/dev/$(basename $DEVPATH)"
TTYDEV_SAVE=$(cat ${DEV_NAME})
if [ ${TTYDEV} = ${TTYDEV_SAVE} ]; then
if [ "${TTYDEV}" = "${TTYDEV_SAVE}" ]; then
# send TERM signal
kill -15 ${GPSD_PID}
rm -f ${DEV_NAME}
fi
fi
else
case "$DEVPATH" in
*tty*)
TTYDEV="/dev/$(basename $DEVPATH)"
options="-F $CTRL_SOCK"
. /etc/sysconfig/gpsd
if [ "$STARTBYUDEV" != "yes" ]; then
exit 1
fi
if [ -n "$PORT" ]; then
options="$options -S $PORT"
else
PORT=2947
fi
echo "Action '${ACTION}' Launch gpsd to $TTYDEV with $options"
/usr/sbin/gpsd $options ${TTYDEV}
echo "${TTYDEV}" > ${DEV_NAME}
sleep 1
echo "F=$TTYDEV" >/dev/tcp/localhost/$PORT
;;
esac
case "$DEVPATH" in
*tty*)
TTYDEV="/dev/$(basename $DEVPATH)"
options="-F $CTRL_SOCK $GPSD_OPTIONS"
if [ -n "$GPSD_PORT" ]; then
options="$options -S $GPSD_PORT"
else
GPSD_PORT=2947
fi
echo "Action '${ACTION}' Launch gpsd to $TTYDEV with $options"
/usr/sbin/gpsd $options ${TTYDEV}
echo "${TTYDEV}" > ${DEV_NAME}
(sleep 1 && echo "F=$TTYDEV" >/dev/tcp/localhost/$GPSD_PORT) &
;;
esac
fi 2>&1 | /bin/logger -t gpsd