From d414dfe0856d8d35ad36e174e3902fc9559e7d16 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 31 Jul 2010 22:33:32 +0000 Subject: [PATCH] [package] update gpsd to 2.94, add config, init and hotplug scripts, patch from Roberto Riggio SVN-Revision: 22447 --- net/gpsd/Makefile | 21 +++++++-------- net/gpsd/files/gpsd.config | 4 +++ net/gpsd/files/gpsd.hotplug | 16 +++++++++++ net/gpsd/files/gpsd.init | 30 +++++++++++++++++++++ net/gpsd/patches/001-fix-libtool-link.patch | 22 --------------- 5 files changed, 60 insertions(+), 33 deletions(-) create mode 100644 net/gpsd/files/gpsd.config create mode 100644 net/gpsd/files/gpsd.hotplug create mode 100644 net/gpsd/files/gpsd.init delete mode 100644 net/gpsd/patches/001-fix-libtool-link.patch diff --git a/net/gpsd/Makefile b/net/gpsd/Makefile index 9e808a9ea7..3409ef901f 100644 --- a/net/gpsd/Makefile +++ b/net/gpsd/Makefile @@ -8,14 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gpsd -PKG_VERSION:=2.90 +PKG_VERSION:=2.94 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://download.berlios.de/gpsd/ -PKG_MD5SUM:=a23c728b8734c542d559c485857238d2 +PKG_MD5SUM:=ce70bcd707ac1df861d4c72f503c09d1 -PKG_FIXUP:=libtool-ucxx PKG_INSTALL:=1 PKG_BUILD_DEPENDS:=libncurses @@ -25,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk define Package/gpsd SECTION:=net CATEGORY:=Network - DEPENDS:=+libpthread +uclibcxx + DEPENDS:=+libpthread TITLE:=An interface daemon for GPS receivers URL:=http://gpsd.berlios.de/ endef @@ -41,15 +40,9 @@ CONFIGURE_ARGS += \ --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 $(LIBGCC_S)" \ - 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/ @@ -58,6 +51,12 @@ define Build/InstallDev endef define Package/gpsd/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./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 diff --git a/net/gpsd/files/gpsd.config b/net/gpsd/files/gpsd.config new file mode 100644 index 0000000000..8c7e51ae8f --- /dev/null +++ b/net/gpsd/files/gpsd.config @@ -0,0 +1,4 @@ +config gpsd core + option device "/dev/ttyUSB0" + option port "2947" + option enabled "true" diff --git a/net/gpsd/files/gpsd.hotplug b/net/gpsd/files/gpsd.hotplug new file mode 100644 index 0000000000..fc15ddaee9 --- /dev/null +++ b/net/gpsd/files/gpsd.hotplug @@ -0,0 +1,16 @@ +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 + sleep 3 && /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 diff --git a/net/gpsd/files/gpsd.init b/net/gpsd/files/gpsd.init new file mode 100644 index 0000000000..d0a1a3027a --- /dev/null +++ b/net/gpsd/files/gpsd.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009 OpenWrt.org +START=50 + +NAME=gpsd +PIDF=/var/run/$NAME.pid +PROG=/usr/sbin/$NAME + +start() { + config_load gpsd + config_get device core device + config_get port core port + config_get_bool enabled core enabled + [ "$enabled" != "1" ] && exit + logger -t "$NAME" "Starting..." + [ ! -c "$device" ] && { + logger -t "$NAME" "Unable to find device $device. Exiting." + exit 1 + } + $PROG -n -P $PIDF -S $port $device +} + +stop() { + logger -t "$NAME" "Stopping..." + [ -f "$PIDF" ] && { + read PID < "$PIDF" + kill -9 $PID + rm $PIDF + } +} diff --git a/net/gpsd/patches/001-fix-libtool-link.patch b/net/gpsd/patches/001-fix-libtool-link.patch deleted file mode 100644 index 40d00f4264..0000000000 --- a/net/gpsd/patches/001-fix-libtool-link.patch +++ /dev/null @@ -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 - 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) - -- 2.30.2