Port gpsd to -ng, closes #659, thanks to russel !
[openwrt/svn-archive/archive.git] / net / gpsd / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=gpsd
4 PKG_VERSION:=2.30
5 PKG_RELEASE:=1
6
7 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
9 PKG_SOURCE_URL:=http://download.berlios.de/gpsd/
10 PKG_MD5SUM:=dde177174878e8ae6db15f8010da46dd
11 PKG_CAT:=zcat
12
13 PKG_BUILDDEP=libpthread uclibcxx ncurses
14
15 include $(INCLUDE_DIR)/package.mk
16
17 define Package/gpsd
18 SECTION:=net
19 CATEGORY:=Network
20 TITLE:=gpsd
21 DEPENDS:=+libpthread +uclibcxx +ncurses
22 DESCRIPTION:=An interface daemon for GPS receivers
23 endef
24
25 define Build/Configure
26 ( cd $(PKG_BUILD_DIR); rm -rf config.cache; \
27 $(TARGET_CONFIGURE_OPTS) \
28 CFLAGS="$(TARGET_CFLAGS)" \
29 CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
30 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
31 LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
32 LIBS="-luClibc++ -lc -lm -lnotimpl" \
33 ./configure \
34 --target=$(GNU_TARGET_NAME) \
35 --host=$(GNU_TARGET_NAME) \
36 --build=$(GNU_HOST_NAME) \
37 --program-prefix="" \
38 --program-suffix="" \
39 --prefix=/usr \
40 --exec-prefix=/usr \
41 --bindir=/usr/bin \
42 --datadir=/usr/share \
43 --includedir=/usr/include \
44 --infodir=/usr/share/info \
45 --libdir=/usr/lib \
46 --libexecdir=/usr/lib \
47 --localstatedir=/var \
48 --mandir=/usr/share/man \
49 --sbindir=/usr/sbin \
50 --sysconfdir=/etc \
51 $(DISABLE_LARGEFILE) \
52 $(DISABLE_NLS) \
53 --enable-shared \
54 --enable-static \
55 --with-gnu-ld \
56 --without-x \
57 );
58 endef
59
60 define Build/Compile
61 $(CP) $(PKG_BUILD_DIR)/libtool $(PKG_BUILD_DIR)/libtool.orig
62 sed 's/-lstdc++ //' $(PKG_BUILD_DIR)/libtool.orig > $(PKG_BUILD_DIR)/libtool
63 $(MAKE) -C $(PKG_BUILD_DIR) \
64 all
65 endef
66
67 define Package/gpsd/install
68 install -d -m0755 $(1)/usr/lib
69 install -m0755 $(PKG_BUILD_DIR)/.libs/libgps.so* $(1)/usr/lib/
70 install -d -m0755 $(1)/usr/sbin/
71 install -m0755 $(PKG_BUILD_DIR)/.libs/gpsd $(1)/usr/sbin/
72 endef
73
74 define Build/InstallDev
75 mkdir -p $(STAGING_DIR)/usr/include
76 $(CP) $(PKG_BUILD_DIR)/gps{,d}.h $(STAGING_DIR)/usr/include/
77 $(CP) $(PKG_BUILD_DIR)/libgpsmm.h $(STAGING_DIR)/usr/include/
78 mkdir -p $(STAGING_DIR)/usr/lib
79 $(CP) $(PKG_BUILD_DIR)/.libs/libgps.{a,so*} $(STAGING_DIR)/usr/lib/
80 endef
81
82 define Build/UninstallDev
83 rm -rf $(STAGING_DIR)/usr/include/gps{,d}.h \
84 $(STAGING_DIR)/usr/include/libgpsmm.h \
85 $(STAGING_DIR)/usr/lib/libgps.{a,so*}
86 endef
87
88 $(eval $(call BuildPackage,gpsd))