summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2011-05-29 11:40:25 +0200
committerKoen Kooi <koen@dominion.thruhere.net>2011-05-29 21:37:56 +0200
commit9c0c7aada48dc662bd1d570613a64708ee5edb55 (patch)
tree01dbbe23816a65216e8641164ae6ce0734de05eb
parent0f4e4f8a27a8735559370863eec00fca8e890010 (diff)
downloadmeta-openembedded-9c0c7aada48dc662bd1d570613a64708ee5edb55.tar.gz
gpsd: import from OE rev d4f0211e2078d5033ae0dee74664de5520d8392d
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-support/gpsd/gpsd-2.95/60-gpsd.rules47
-rwxr-xr-xmeta-oe/recipes-support/gpsd/gpsd-2.95/gpsd136
-rw-r--r--meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd-default5
-rw-r--r--meta-oe/recipes-support/gpsd/gpsd-2.95/libtool.patch16
-rw-r--r--meta-oe/recipes-support/gpsd/gpsd_2.95.bb102
5 files changed, 306 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/gpsd/gpsd-2.95/60-gpsd.rules b/meta-oe/recipes-support/gpsd/gpsd-2.95/60-gpsd.rules
new file mode 100644
index 000000000..c01db068d
--- /dev/null
+++ b/meta-oe/recipes-support/gpsd/gpsd-2.95/60-gpsd.rules
@@ -0,0 +1,47 @@
1# udev rules for gpsd
2# $Id$
3#
4# GPSes don't have their own USB device class. They're serial-over-USB
5# devices, so what you see is actually the ID of the serial-over-USB chip.
6# Fortunately, just two of these account for over 80% of consumer-grade
7# GPS sensors. The gpsd.hotplug.wrapper script will tell a running gpsd
8# that it should look at the device that just went active, because it
9# might be a GPS.
10#
11# The following setup works on Debian - something similar will apply on
12# other distributions:
13#
14# /etc/udev/gpsd.rules
15# /etc/udev/rules.d/025_gpsd.rules -> ../gpsd.rules
16# /lib/udev/gpsd.hotplug.wrapper
17# /lib/udev/gpsd.hotplug
18#
19# Setting the link in /etc/udev/rules.d activates the rule and determines
20# when to run it on boot (similar to init.d processing).
21
22SUBSYSTEM!="tty", GOTO="gpsd_rules_end"
23
24# Prolific Technology, Inc. PL2303 Serial Port
25ATTR{idVendor}=="067b", ATTR{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
26# ATEN International Co., Ltd UC-232A Serial Port [pl2303]
27ATTR{idVendor}=="0557", ATTR{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
28# FTDI 8U232AM
29ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
30# Cypress M8/CY7C64013 (DeLorme uses these)
31ATTR{idVendor}=="1163", ATTR{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
32# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005)
33ATTR{idVendor}=="067b", ATTR{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
34# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB)
35ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
36# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241)
37ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
38# u-blox AG, u-blox 5 (tested with Navilock NL-402U)
39ATTR{idVendor}=="1546", ATTR{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
40# FTDI FT232
41ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
42# u-blox 4
43SYSFS{idVendor}=="1546", SYSFS{idProduct}=="01a4", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
44
45ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper"
46
47LABEL="gpsd_rules_end"
diff --git a/meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd b/meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd
new file mode 100755
index 000000000..3687d2400
--- /dev/null
+++ b/meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd
@@ -0,0 +1,136 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: gpsd
4# Required-Start: $remote_fs $network
5# Should-Start: bluetooth dbus udev
6# Required-Stop: $remote_fs $network
7# Default-Start: 2 3 4 5
8# Default-Stop: 0 1 6
9# Short-Description: GPS (Global Positioning System) daemon start/stop script
10# Description: Start/Stop script for the gpsd service daemon,
11# which is able to monitor one or more GPS devices
12# connected to a host computer, making all data on
13# the location and movements of the sensors available
14# to be queried on TCP port 2947.
15### END INIT INFO
16
17# Author: Bernd Zeimetz <bzed@debian.org>
18#
19# Please remove the "Author" lines above and replace them
20# with your own name if you copy and modify this script.
21
22# Do NOT "set -e"
23
24# PATH should only include /usr/* if it runs after the mountnfs.sh script
25PATH=/sbin:/usr/sbin:/bin:/usr/bin
26DESC="GPS (Global Positioning System) daemon"
27NAME=gpsd
28DAEMON=/usr/sbin/$NAME
29PIDFILE=/var/run/$NAME.pid
30SCRIPTNAME=/etc/init.d/$NAME
31
32# Exit if the package is not installed
33[ -x "$DAEMON" ] || exit 0
34
35# Read configuration, if present
36[ -r /etc/default/$NAME ] && . /etc/default/$NAME
37
38if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then
39 GPSD_SOCKET=/var/run/gpsd.sock
40fi
41
42if [ -n "$GPSD_SOCKET" ]; then
43 GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET"
44fi
45
46#
47# Function that starts the daemon/service
48#
49do_start()
50{
51 # Return
52 # 0 if daemon has been started
53 # 1 if daemon was already running
54 # 2 if daemon could not be started
55 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test \
56 -- $GPSD_OPTIONS -P $PIDFILE $GPS_DEVICES > /dev/null \
57 || return 1
58 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
59 $GPSD_OPTIONS -P $PIDFILE $GPS_DEVICES \
60 || return 2
61}
62
63#
64# Function that stops the daemon/service
65#
66do_stop()
67{
68 # Return
69 # 0 if daemon has been stopped
70 # 1 if daemon was already stopped
71 # 2 if daemon could not be stopped
72 # other if a failure occurred
73 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
74 RETVAL="$?"
75 [ "$RETVAL" = 2 ] && return 2
76 # Many daemons don't delete their pidfiles when they exit.
77 rm -f $PIDFILE
78 return "$RETVAL"
79}
80
81#
82# Function that sends a SIGHUP to the daemon/service
83#
84do_reload() {
85 #
86 # If the daemon can reload its configuration without
87 # restarting (for example, when it is sent a SIGHUP),
88 # then implement that here.
89 #
90 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
91 return 0
92}
93
94case "$1" in
95 start)
96 echo "Starting $DESC" "$NAME"
97 do_start
98 return $?
99 ;;
100 stop)
101 echo "Stopping $DESC" "$NAME"
102 do_stop
103 return $?
104 ;;
105 status)
106 ;;
107 reload|force-reload)
108 echo "Reloading $DESC" "$NAME"
109 do_reload
110 return $?
111 ;;
112 restart)
113 #
114 # If the "reload" option is implemented then remove the
115 # 'force-reload' alias
116 #
117 echo "Restarting $DESC" "$NAME"
118 do_stop
119 case "$?" in
120 0|1)
121 do_start
122 return $?
123 ;;
124 *)
125 # Failed to stop
126 return 1
127 ;;
128 esac
129 ;;
130 *)
131 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
132 exit 3
133 ;;
134esac
135
136:
diff --git a/meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd-default b/meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd-default
new file mode 100644
index 000000000..0ceff0382
--- /dev/null
+++ b/meta-oe/recipes-support/gpsd/gpsd-2.95/gpsd-default
@@ -0,0 +1,5 @@
1# If you must specify a non-NMEA driver, uncomment and modify the next line
2GPSD_SOCKET="/var/run/gpsd.sock"
3GPSD_OPTIONS=""
4GPS_DEVICES=""
5
diff --git a/meta-oe/recipes-support/gpsd/gpsd-2.95/libtool.patch b/meta-oe/recipes-support/gpsd/gpsd-2.95/libtool.patch
new file mode 100644
index 000000000..7b78a72d8
--- /dev/null
+++ b/meta-oe/recipes-support/gpsd/gpsd-2.95/libtool.patch
@@ -0,0 +1,16 @@
1Index: gpsd-2.95/Makefile.am
2===================================================================
3--- gpsd-2.95.orig/Makefile.am 2010-08-26 15:31:38.804330723 +0200
4+++ gpsd-2.95/Makefile.am 2010-08-26 15:31:57.170020341 +0200
5@@ -253,9 +253,9 @@
6 # Warning: This overrides autoconf's normal link-line generation process
7 if LIBGPSMM_ENABLE
8 libgps_la_SOURCES += libgpsmm.cpp
9-libgps_la_LINK = /bin/sh ./libtool --tag=CXX --mode=link g++ $(libgps_la_LDFLAGS) -o $@
10+libgps_la_LINK = $(LIBTOOL) --tag=CXX --mode=link g++ $(libgps_la_LDFLAGS) -o $@
11 else
12-libgps_la_LINK = /bin/sh ./libtool --tag=CC --mode=link gcc $(libgps_la_LDFLAGS) -o $@
13+libgps_la_LINK = $(LIBTOOL) --tag=CC --mode=link gcc $(libgps_la_LDFLAGS) -o $@
14 endif
15
16 nodist_libgpsd_la_SOURCES = packet_names.h ais_json.i
diff --git a/meta-oe/recipes-support/gpsd/gpsd_2.95.bb b/meta-oe/recipes-support/gpsd/gpsd_2.95.bb
new file mode 100644
index 000000000..a6741192a
--- /dev/null
+++ b/meta-oe/recipes-support/gpsd/gpsd_2.95.bb
@@ -0,0 +1,102 @@
1DESCRIPTION = "A TCP/IP Daemon simplifying the communication with GPS devices"
2SECTION = "console/network"
3PRIORITY = "optional"
4LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800"
6DEPENDS = "dbus-glib ncurses python libusb1"
7PROVIDES = "virtual/gpsd"
8
9EXTRA_OECONF = "--x-includes=${STAGING_INCDIR}/X11 \
10 --x-libraries=${STAGING_LIBDIR} \
11 --enable-dbus \
12 --disable-libQgpsmm \
13"
14
15SRC_URI = "http://download.berlios.de/${PN}/${P}.tar.gz;name=gpsd \
16 file://libtool.patch \
17 file://gpsd-default \
18 file://gpsd \
19 file://60-gpsd.rules"
20SRC_URI[gpsd.md5sum] = "12535a9ed9fecf9ea2c5bdc9840da5ae"
21SRC_URI[gpsd.sha256sum] = "832343a53921a8371efa540ba57c91dadedda445e571c1beb97c06539ef450ae"
22
23inherit autotools update-rc.d python-dir
24
25INITSCRIPT_NAME = "gpsd"
26INITSCRIPT_PARAMS = "defaults 35"
27
28LDFLAGS += "-L${STAGING_LIBDIR} -lm"
29export STAGING_INCDIR
30export STAGING_LIBDIR
31
32TARGET_CC_ARCH += "${LDFLAGS}"
33
34do_configure_prepend() {
35 # skip first
36 sed -i "s#for pylibpath in '/usr/lib'#for pylibpath in #g" ${S}/configure.ac
37}
38
39do_compile_prepend() {
40 export BUILD_SYS="${BUILD_SYS}"
41 export HOST_SYS="${HOST_SYS}"
42 find ${S} -name "*.so" -exec rm -f {} \;
43}
44
45do_install_prepend() {
46 export BUILD_SYS="${BUILD_SYS}"
47 export HOST_SYS="${HOST_SYS}"
48}
49
50do_install_append() {
51 install -d ${D}/${sysconfdir}/init.d
52 install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/
53 install -d ${D}/${sysconfdir}/default
54 install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default
55
56 #support for udev
57 install -d ${D}/${sysconfdir}/udev/rules.d
58 install -m 0644 ${WORKDIR}/60-gpsd.rules ${D}/${sysconfdir}/udev/rules.d
59 install -d ${D}${base_libdir}/udev/
60 install -m 0755 ${S}/gpsd.hotplug ${D}${base_libdir}/udev/
61 install -d ${D}${base_libdir}/udev/
62 install -m 0755 ${S}/gpsd.hotplug.wrapper ${D}${base_libdir}/udev/
63}
64
65pkg_postinst_${PN}-conf() {
66 update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10
67}
68
69pkg_postrm_${PN}-conf() {
70 update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
71}
72
73PACKAGES =+ "libgps libgpsd python-pygps-dbg python-pygps gpsd-udev gpsd-conf gpsd-gpsctl gps-utils"
74
75FILES_python-pygps-dbg += " ${libdir}/python*/site-packages/gps/.debug"
76
77RDEPENDS_${PN} = "gpsd-gpsctl"
78RRECOMMENDS_${PN} = "gpsd-conf gpsd-udev"
79
80DESCRIPTION_gpsd-udev = "udev relevant files to use gpsd hotplugging"
81FILES_gpsd-udev = "${base_libdir}/* ${sysconfdir}/udev/*"
82RDEPENDS_gpsd-udev += "udev gpsd-conf"
83
84DESCRIPTION_libgpsd = "C service library used for communicating with gpsd"
85FILES_libgpsd = "${libdir}/libgpsd.so.*"
86
87DESCRIPTION_libgps = "C service library used for communicating with gpsd"
88FILES_libgps = "${libdir}/libgps.so.*"
89
90DESCRIPTION_gpsd-conf = "gpsd configuration files and init scripts"
91FILES_gpsd-conf = "${sysconfdir}"
92
93DESCRIPTION_gpsd-gpsctl = "Tool for tweaking GPS modes"
94FILES_gpsd-gpsctl = "${bindir}/gpsctl"
95
96DESCRIPTION_gps-utils = "Utils used for simulating, monitoring,... a GPS"
97FILES_gps-utils = "${bindir}/*"
98RDEPENDS_gps-utils = "python-pygps"
99
100DESCRIPTION_python-pygps = "Python bindings to gpsd"
101FILES_python-pygps = "${PYTHON_SITEPACKAGES_DIR}/*"
102RDEPENDS_python-pygps = "python-core python-curses gpsd python-json"