[oe-commits] org.oe.dev gpsd: As discssed on the ML:

coredump2 commit openembedded-commits at lists.openembedded.org
Fri Jan 4 13:36:01 UTC 2008


gpsd: As discssed on the ML:
	- Add a gpsd-conf package 
	- gpe-conf installs /etc/defaults/gpsd and /etc/init.d/gps-hardware
          via update-alternatives
	- A sample machine-specific -conf package for fix-gta01 is provided.
	- Constructive comments welcome

Author: coredump2 at openembedded.org
Branch: org.openembedded.dev
Revision: d734e1412138fc4107a768d25359b9c89f869193
ViewMTN: http://monotone.openembedded.org/revision/info/d734e1412138fc4107a768d25359b9c89f869193
Files:
1
packages/gpsd/files/fic-gta01/gpsd
packages/gpsd/files/fic-gta01/gps-hardware
packages/gpsd/files/gps-hardware
packages/gpsd/files/gpsd
packages/gpsd/gpsd.inc
packages/gpsd/gpsd_2.28.bb
packages/gpsd/gpsd_2.34.bb
packages/gpsd/gpsd_2.36.bb
Diffs:

#
# mt diff -r25992f27a7e85557f4a43e45ad2499cfd3adef84 -rd734e1412138fc4107a768d25359b9c89f869193
#
# 
# 
# delete "packages/gpsd/files/fic-gta01/gpsd"
# 
# add_file "packages/gpsd/files/fic-gta01/gps-hardware"
#  content [34ec43f27b84b7fd298431b678952fe476a19a9f]
# 
# add_file "packages/gpsd/files/gps-hardware"
#  content [f13135a0d5c59d0ccfa9e06d65f63d5e9bdbadf3]
# 
# patch "packages/gpsd/files/gpsd"
#  from [46761ebb43a976a2d7df3d1f0f1c0c4ea805fb7a]
#    to [2e08211a015d5617516112a6c4bb0f0bcd2a5a4f]
# 
# patch "packages/gpsd/gpsd.inc"
#  from [91e167633095484f711ff118e87bf2839f7105b2]
#    to [650373a23ddc8159bfc209e03a8bb60a2f5c46e4]
# 
# patch "packages/gpsd/gpsd_2.28.bb"
#  from [afa8f306a4567c0d18884e4089b424ac63c0955a]
#    to [19dc03378642fa1ee106c4bf1ba4f49118860903]
# 
# patch "packages/gpsd/gpsd_2.34.bb"
#  from [8e241bbd828101019cda7b30a6725fd6759f50f4]
#    to [d07d745ca471b1b1cfe875690c9278e223ca2c9c]
# 
# patch "packages/gpsd/gpsd_2.36.bb"
#  from [fcf9fa136398ac80a6cb1c8408ac6df26d0ddeaf]
#    to [9cabcd04b6334d04f5b20d7585ad5d051f19a06f]
# 
============================================================
--- packages/gpsd/files/fic-gta01/gps-hardware	34ec43f27b84b7fd298431b678952fe476a19a9f
+++ packages/gpsd/files/fic-gta01/gps-hardware	34ec43f27b84b7fd298431b678952fe476a19a9f
@@ -0,0 +1,41 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel at hentges.net> (c) 2008
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: gps-hardware
+# Date: 20080103 (YMD)
+#
+#################################################################################
+#
+# 20080103 - v0.0.1	- Initial release
+
+if ! test -e /home/root/gllin/gllin
+then
+	echo -e "\n\ngllin GPS driver for Neo1973 not found,"
+	echo "please install the gllin package from"
+	echo "http://3rdparty.downloads.openmoko.org/gllin/"
+	echo ""
+	exit 1
+fi
+
+
+do_start() {
+	/home/root/gllin/gllin >/var/log/gllin.log 2>&1 &
+	sleep 1
+}
+
+do_stop() {
+	gllin_PIDs="`ps ax | grep "/home/root/gllin" | grep -v grep | awk '{print $1}'`"	
+	test -n "$gllin_PIDs" && kill $gllin_PIDs
+}
+
+do_status() {
+	ps ax | grep -v grep | grep -q gllin && echo "ready" || echo "unknown"
+}
+
+case "$1" in
+	start)		do_start ;;
+	stop)		do_stop ;;
+	status)		do_status ;;
+esac
============================================================
--- packages/gpsd/files/gps-hardware	f13135a0d5c59d0ccfa9e06d65f63d5e9bdbadf3
+++ packages/gpsd/files/gps-hardware	f13135a0d5c59d0ccfa9e06d65f63d5e9bdbadf3
@@ -0,0 +1,2 @@
+# This is a dummy file. Some machines use it to bring up integrated GPS
+# devices on demand.
============================================================
--- packages/gpsd/files/gpsd	46761ebb43a976a2d7df3d1f0f1c0c4ea805fb7a
+++ packages/gpsd/files/gpsd	2e08211a015d5617516112a6c4bb0f0bcd2a5a4f
@@ -29,9 +29,18 @@ start() {
 	# 2. We don't need all the logging crud that daemon/initlog sets
 	# up -- gpsd does its own syslog calls.
 	#
+	
+	if test -x /etc/init.d/gps-hardware
+	then
+		if ! ( /etc/init.d/gps-hardware status | grep -q "ready" )
+		then
+			/etc/init.d/gps-hardware start
+		fi
+	fi
+	
 	if [ -e "${GPS_DEV}" ]
 	then
-	    gpsd ${GPSD_OPTS} -p ${GPS_DEV}
+	    gpsd ${GPSD_OPTS} ${GPS_DEV}
 	     echo "success"
 	else
 	    # User needs to symlink ${GPS_DEV} to the right thing
============================================================
--- packages/gpsd/gpsd.inc	91e167633095484f711ff118e87bf2839f7105b2
+++ packages/gpsd/gpsd.inc	650373a23ddc8159bfc209e03a8bb60a2f5c46e4
@@ -1,8 +1,9 @@ DEPENDS = "dbus-glib ncurses python"
 DESCRIPTION = "A TCP/IP Daemon simplifying the communication with GPS devices"
 SECTION = "console/network"
 PRIORITY = "optional"
 LICENSE = "GPL"
 DEPENDS = "dbus-glib ncurses python"
+RDEPENDS = "gpsd-conf"
 
 EXTRA_OECONF = "--x-includes=${STAGING_INCDIR}/X11 \
                 --x-libraries=${STAGING_LIBDIR} \
@@ -11,6 +12,7 @@ SRC_URI = "http://download.berlios.de/gp
 
 SRC_URI = "http://download.berlios.de/gpsd/gpsd-${PV}.tar.gz \
            file://gpsd-default \
+	   file://gps-hardware \
            file://gpsd"
 
 inherit autotools update-rc.d
@@ -41,15 +43,29 @@ do_install_append() {
         install -d ${D}/${sysconfdir}/init.d
         install -d ${D}/dev
         install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/gps-hardware ${D}/${sysconfdir}/init.d/gps-hardware.default
         install -d ${D}/${sysconfdir}/default
-        install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd
+        install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default
 }
 
-PACKAGES =+ "libgps python-pygps"
+pkg_postinst_${PN}-conf() {
+	update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10
+	update-alternatives --install ${sysconfdir}/init.d/gps-hardware gps-hardware ${sysconfdir}/init.d/gps-hardware.default 10
+}
 
-FILES_${PN} += "${sysconfdir}"
+pkg_postrm_${PN}-conf() {	
+	update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
+	update-alternatives --remove gps-hardware ${sysconfdir}/init.d/gps-hardware.default		
+}
+
+SRC_URI_OVERRIDES_PACKAGE_ARCH = "0"
+
+PACKAGES =+ "libgps python-pygps gpsd-conf"
+
+PACKAGE_ARCH_gpsd-conf = "${MACHINE_ARCH}"
+
 FILES_libgps = "${libdir}/*.so.*"
-CONFFILES_${PN} = "${sysconfdir}/default/gpsd"
+FILES_gpsd-conf = "${sysconfdir}"
 
 DESCRIPTION_python-pygps = "Python bindings to gpsd"
 FILES_python-pygps = "${libdir}/*/site-packages/*"
============================================================
--- packages/gpsd/gpsd_2.28.bb	afa8f306a4567c0d18884e4089b424ac63c0955a
+++ packages/gpsd/gpsd_2.28.bb	19dc03378642fa1ee106c4bf1ba4f49118860903
@@ -1,2 +1,2 @@ require gpsd.inc
 require gpsd.inc
+PR = "r5"
-PR = "r4"
============================================================
--- packages/gpsd/gpsd_2.34.bb	8e241bbd828101019cda7b30a6725fd6759f50f4
+++ packages/gpsd/gpsd_2.34.bb	d07d745ca471b1b1cfe875690c9278e223ca2c9c
@@ -1,4 +1,4 @@ require gpsd.inc
 require gpsd.inc
 
-PR = "r6"
+PR = "r7"
 
============================================================
--- packages/gpsd/gpsd_2.36.bb	fcf9fa136398ac80a6cb1c8408ac6df26d0ddeaf
+++ packages/gpsd/gpsd_2.36.bb	9cabcd04b6334d04f5b20d7585ad5d051f19a06f
@@ -1,3 +1,3 @@ require gpsd.inc
 require gpsd.inc
 
+PR = "r1"
-PR = "r0"






More information about the Openembedded-commits mailing list