This patch bumps gpsd version to 2.92. It also adds an uci configuration
file
where the user can configure the serial port and the default listening
port for
gpsd.
The patch also adds an init script and an hotplug script that starts the
daemon
when a serial device is plugged.
The modification that I've made make the package build and work, as a matter
of fact before the libgps library was not linked against uclib++.
Signed-off-by: Roberto Riggio <[email protected]
<mailto:[email protected]>>
--
Index: net/gpsd/files/gpsd.init
===================================================================
--- net/gpsd/files/gpsd.init (revision 0)
+++ net/gpsd/files/gpsd.init (revision 0)
@@ -0,0 +1,39 @@
+#!/bin/sh /etc/rc.common
+
+START=50
+NAME=gpsd
+PIDF=/var/run/$NAME.pid
+PROG=/usr/sbin/$NAME
+
+. /etc/functions.sh
+
+start() {
+ config_load gpsd
+ config_get device core device
+ config_get port core port
+ config_get_bool enabled core enabled
+ [ $enabled == 0 ] && exit 1
+ logger -t "$NAME" "Starting..."
+ [ -f "$PIDF" ] && {
+ logger -t "$NAME" "Already running. Exiting."
+ exit 1
+ }
+ [ ! -c "$device" ] && {
+ logger -t "$NAME" "Unable to find device $device. Exiting."
+ exit 1
+ }
+ ($PROG -n -N -P $PIDF -S $port $device &) &
+ [ ! -f "$PIDF" ] && {
+ logger -t "$NAME" "Unable to start. Exiting."
+ exit 1
+ }
+}
+
+stop() {
+ logger -t "$NAME" "Stopping..."
+ [ -f "$PIDF" ] && {
+ kill -9 $(cat $PIDF)
+ rm $PIDF
+ }
+}
+
Index: net/gpsd/files/gpsd.config
===================================================================
--- net/gpsd/files/gpsd.config (revision 0)
+++ net/gpsd/files/gpsd.config (revision 0)
@@ -0,0 +1,4 @@
+config gpsd core
+ option device "/dev/ttyUSB0"
+ option port "2947"
+ option enabled "true"
Index: net/gpsd/files/gpsd.hotplug
===================================================================
--- net/gpsd/files/gpsd.hotplug (revision 0)
+++ net/gpsd/files/gpsd.hotplug (revision 0)
@@ -0,0 +1,17 @@
+case "$ACTION" in
+ add)
+ # start process
+ # only pl2303 devices are handled
+ if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" =
"0/0/0" ] && [
"$INTERFACE" = "255/0/0" ]; then
+ /etc/init.d/gpsd start
+ fi
+ ;;
+ remove)
+ # stop process
+ # only pl2303 devices are handled
+ if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" =
"0/0/0" ] && [
"$INTERFACE" = "255/0/0" ]; then
+ /etc/init.d/gpsd stop
+ fi
+ ;;
+esac
+
Index: net/gpsd/patches/001-fix-libtool-link.patch
===================================================================
--- net/gpsd/patches/001-fix-libtool-link.patch (revision 20704)
+++ net/gpsd/patches/001-fix-libtool-link.patch (working copy)
@@ -1,22 +0,0 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -559,7 +559,7 @@
- #
- # Build shared libraries
- #
--libgps_la_LDFLAGS = -version-number 19:0:0
-+libgps_la_LDFLAGS = -version-number 19:0:0 $(LDFLAGS)
- lib_LTLIBRARIES = libgps.la <http://libgps.la>
- libgpsd_c_sources = \
- ais_json.c \
-@@ -616,8 +616,8 @@
- BUILT_SOURCES = packet_names.h gpsd.h revision.h ais_json.i maskdump.c
- libgps_la_SOURCES = $(libgpsd_c_sources) $(libgpsd_h_sources) \
- driver_rtcm2.h packet_states.h $(am__append_2)
-...@libgpsmm_enable_false@libgps_la_LINK = /bin/sh ./libtool --tag=CC
--mode=link gcc $(libgps_la_LDFLAGS) -o $@
-...@libgpsmm_enable_true@libgps_la_LINK = /bin/sh ./libtool --tag=CXX
--mode=link g++ $(libgps_la_LDFLAGS) -o $@
-...@libgpsmm_enable_false@libgps_la_LINK = /bin/sh ./libtool --tag=CC
--mode=link $(CC) $(libgps_la_LDFLAGS) -o $@
-...@libgpsmm_enable_true@libgps_la_LINK = /bin/sh ./libtool --tag=CXX
--mode=link $(CXX) $(libgps_la_LDFLAGS) -o $@
- nodist_libgps_la_SOURCES = packet_names.h ais_json.i
- libgps_la_LIBADD = $(LIBM) $(LIBC) $(LIBNSL) $(LIBSOCKET) $(LIBPTHREAD)
-
Index: net/gpsd/Makefile
===================================================================
--- net/gpsd/Makefile (revision 20704)
+++ net/gpsd/Makefile (working copy)
@@ -8,18 +8,15 @@
include $(TOPDIR)/rules.mk <http://rules.mk>
PKG_NAME:=gpsd
-PKG_VERSION:=2.90
+PKG_VERSION:=2.92
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.berlios.de/gpsd/
<http://download.berlios.de/gpsd/>
-PKG_MD5SUM:=a23c728b8734c542d559c485857238d2
+PKG_MD5SUM:=50b60d9f6dd51e001f4dfbaeb825c988
-PKG_FIXUP:=libtool-ucxx
PKG_INSTALL:=1
-PKG_BUILD_DEPENDS:=libncurses
-
include $(INCLUDE_DIR)/package.mk <http://package.mk>
define Package/gpsd
@@ -41,27 +38,27 @@
--disable-ubx \
--disable-evermore \
--disable-ntrip \
+ --disable-libgpsmm \
--without-x \
-CONFIGURE_VARS += \
- CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
- CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++
-I$(LINUX_DIR)/include" \
- LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib" \
- LIBS="-nodefaultlibs -luClibc++ -lm -lgcc" \
- CC="$(TARGET_CC)" CXX="$(TARGET_CXX)" \
-
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/gps.h $(1)/usr/include/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.{a,so*} $(1)/usr/lib/
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/gps.h $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.{a,so*} $(1)/usr/lib/
endef
define Package/gpsd/install
+ $(INSTALL_DIR) $(1)/etc/config
+ $(CP) ./files/gpsd.config $(1)/etc/config/gpsd
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/gpsd.init $(1)/etc/init.d/gpsd
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
+ $(INSTALL_DATA) ./files/gpsd.hotplug $(1)/etc/hotplug.d/usb/20-gpsd
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsd $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsd $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,gpsd))
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel