60e40f058e047fcd59d59964d3fa55a0e11e87b5
[feed/packages.git] / utils / gpsd / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=gpsd
11 PKG_VERSION:=3.23
12 PKG_RELEASE:=$(AUTORELEASE)
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
16 PKG_HASH:=e36429b9f6fc42004894dff3dc4453f5b43f95af8533b96d3d135987418da9df
17
18 PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:berlios:gps_daemon
22
23 PKG_BUILD_DEPENDS:=scons/host
24
25 include $(INCLUDE_DIR)/package.mk
26 include ../../devel/scons/scons.mk
27
28 define Package/gpsd/Default
29 DEPENDS+= +libusb-1.0
30 URL:=https://gpsd.gitlab.io/gpsd/
31 endef
32
33 define Package/gpsd/Default/description
34 gpsd is a userland daemon acting as a translator between GPS and AIS receivers
35 and their clients. gpsd listens on port 2947 for clients requesting
36 position/time/velocity information. The receivers are expected to generate
37 position information in a well-known format -- as NMEA-0183 sentences, SiRF
38 binary, Rockwell binary, Garmin binary format, or other vendor binary
39 protocols. gpsd takes this information from the GPS and translates it into
40 something uniform and easier to understand for clients.
41 endef
42
43 define Package/gpsd
44 $(call Package/gpsd/Default)
45 SECTION:=utils
46 CATEGORY:=Utilities
47 TITLE:=An interface daemon for GPS receivers
48 endef
49
50 define Package/gpsd/conffiles
51 /etc/config/gpsd
52 endef
53
54 define Package/gpsd/description
55 $(call Package/gpsd/Default/description)
56 This package contains the GPS daemon.
57 endef
58
59 define Package/gpsd-clients
60 $(call Package/gpsd/Default)
61 SECTION:=utils
62 CATEGORY:=Utilities
63 DEPENDS+= +libncurses
64 TITLE:=GPS tools and clients
65 endef
66
67 define Package/gpsd-clients/description
68 $(call Package/gpsd/Default/description)
69 This package contains auxiliary tools and example clients for monitoring and
70 testing the GPS daemon.
71 endef
72
73 define Package/gpsd-utils
74 $(call Package/gpsd/Default)
75 SECTION:=utils
76 CATEGORY:=Utilities
77 TITLE:=GPS daemon utils
78 endef
79
80 define Package/gpsd-utils/description
81 $(call Package/gpsd/Default/description)
82 This package contains utilities for interacting with GPS daemon.
83 endef
84
85 define Package/libgps
86 $(call Package/gpsd/Default)
87 SECTION:=libs
88 CATEGORY:=Libraries
89 TITLE:=C service library for communicating with the GPS daemon
90 ABI_VERSION:=29
91 endef
92
93 define Package/libgps/description
94 $(call Package/gpsd/Default/description)
95 This package contains the libgps library.
96 endef
97
98 SCONS_VARS += \
99 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) -L$(STAGING_DIR)/usr/lib" \
100 LINKFLAGS="$(TARGET_LDFLAGS)"
101
102 SCONS_OPTIONS += \
103 dbus_export=no \
104 tsip=no \
105 fv18=no \
106 tripmate=no \
107 earthmate=no \
108 itrax=no \
109 navcom=no \
110 ubx=no \
111 evermore=no \
112 ntrip=no \
113 libgpsmm=no \
114 libQgpsmm=no \
115 bluez=no \
116 nostrip=yes \
117 python=no \
118 implicit_link=no \
119 chrpath=no \
120 manbuild=no \
121 sysroot="$(TOOLCHAIN_DIR)" \
122 target="$(TARGET_CROSS:-=)"
123
124 define Build/InstallDev
125 $(INSTALL_DIR) $(1)/usr/include
126 $(CP) $(PKG_INSTALL_DIR)/usr/include/gps.h $(1)/usr/include/
127 $(INSTALL_DIR) $(1)/usr/lib
128 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps*.so* $(1)/usr/lib/
129 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
130 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgps.pc $(1)/usr/lib/pkgconfig
131 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libgps.pc
132 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libgps.pc
133 endef
134
135 define Package/gpsd/install
136 $(INSTALL_DIR) $(1)/etc/config
137 $(INSTALL_CONF) ./files/gpsd.config $(1)/etc/config/gpsd
138 $(INSTALL_DIR) $(1)/etc/init.d
139 $(INSTALL_BIN) ./files/gpsd.init $(1)/etc/init.d/gpsd
140 $(INSTALL_DIR) $(1)/usr/sbin
141 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsd $(1)/usr/sbin/
142 endef
143
144 define Package/gpsd-clients/install
145 $(INSTALL_DIR) $(1)/usr/bin
146 $(INSTALL_BIN) \
147 $(PKG_INSTALL_DIR)/usr/bin/cgps \
148 $(PKG_INSTALL_DIR)/usr/bin/gps{ctl,decode,mon,pipe} \
149 $(PKG_INSTALL_DIR)/usr/bin/gpxlogger \
150 $(PKG_INSTALL_DIR)/usr/bin/lcdgps \
151 $(1)/usr/bin/
152 endef
153
154 define Package/gpsd-utils/install
155 $(INSTALL_DIR) $(1)/usr/sbin
156 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/gpsdctl $(1)/usr/sbin/
157 endef
158
159 define Package/libgps/install
160 $(INSTALL_DIR) $(1)/usr/lib
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgps.so.$(ABI_VERSION)* $(1)/usr/lib/
162 endef
163
164 $(eval $(call BuildPackage,gpsd))
165 $(eval $(call BuildPackage,gpsd-clients))
166 $(eval $(call BuildPackage,gpsd-utils))
167 $(eval $(call BuildPackage,libgps))