build olsrd out of cloned feed source, use local date and git hash as version
[olsrd.git] / openwrt / olsrd-git / Makefile
1
2 # Copyright (C) 2009-2010 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:=olsrd-git
11 PKG_VERSION:=$(shell date +%Y%m%d)+$(shell git --git-dir=$(CURDIR)/../../.git log -1 --pretty=%h)
12 PKG_RELEASE:=1
13
14 PKG_BUILD_PARALLEL:=1
15 PKG_INSTALL:=1
16
17 include $(INCLUDE_DIR)/package.mk
18
19 TARGET_CFLAGS += $(FPIC)
20
21 define Build/Prepare
22         mkdir -p $(PKG_BUILD_DIR)
23         $(CP) $(CURDIR)/../../* $(PKG_BUILD_DIR)/
24 endef
25
26 define Package/olsrd-git/template
27   SECTION:=net
28   CATEGORY:=Network
29   MAINTAINER:=OLSR Development Team <olsr-dev@lists.olsr.org>
30   TITLE:=OLSR (Optimized Link State Routing) daemon - Master Branch
31   URL:=http://www.olsr.org/
32 endef
33
34 define Package/olsrd-git
35   $(call Package/olsrd-git/template)
36   MENU:=1
37   DEPENDS:=+libpthread
38 endef
39
40 define Package/olsrd-git/conffiles
41 /etc/config/olsrd
42 endef
43
44 define Package/olsrd-git-mod-arprefresh
45   $(call Package/olsrd-git/template)
46   DEPENDS:=olsrd-git
47   TITLE:=Kernel ARP cache refresh plugin
48 endef
49
50 define Package/olsrd-git-mod-dot-draw
51   $(call Package/olsrd-git/template)
52   DEPENDS:=olsrd-git
53   TITLE:=Dot topology information plugin
54 endef
55
56 define Package/olsrd-git-mod-bmf
57   $(call Package/olsrd-git/template)
58   DEPENDS:=olsrd-git +kmod-tun
59   TITLE:=Basic multicast forwarding plugin
60 endef
61
62 define Package/olsrd-git-mod-dyn-gw
63   $(call Package/olsrd-git/template)
64   DEPENDS:=olsrd-git
65   TITLE:=Dynamic internet gateway plugin
66 endef
67
68 define Package/olsrd-git-mod-dyn-gw-plain
69   $(call Package/olsrd-git/template)
70   DEPENDS:=olsrd-git
71   TITLE:=Dynamic internet gateway plain plugin
72 endef
73
74 define Package/olsrd-git-mod-httpinfo
75   $(call Package/olsrd-git/template)
76   DEPENDS:=olsrd-git
77   TITLE:=Small informative web server plugin
78 endef
79
80 define Package/olsrd-git-mod-mdns
81   $(call Package/olsrd-git/template)
82   DEPENDS:=olsrd-git
83   TITLE:=Multicast DNS plugin
84 endef
85
86 define Package/olsrd-git-mod-nameservice
87   $(call Package/olsrd-git/template)
88   DEPENDS:=olsrd-git
89   TITLE:=Lightweight hostname resolver plugin
90 endef
91
92 define Package/olsrd-git-mod-p2pd
93   $(call Package/olsrd-git/template)
94   DEPENDS:=olsrd-git
95   TITLE:=Peer to Peer Discovery plugin
96 endef
97
98 define Package/olsrd-git-mod-quagga
99   $(call Package/olsrd-git/template)
100   DEPENDS:=olsrd-git
101   TITLE:=Quagga plugin
102 endef
103
104 define Package/olsrd-git-mod-secure
105   $(call Package/olsrd-git/template)
106   DEPENDS:=olsrd-git
107   TITLE:=Message signing plugin to secure routing domain
108 endef
109
110 define Package/olsrd-git-mod-txtinfo
111   $(call Package/olsrd-git/template)
112   DEPENDS:=olsrd-git
113   TITLE:=Small informative web server plugin
114 endef
115
116 define Package/olsrd-git-mod-watchdog
117   $(call Package/olsrd-git/template)
118   DEPENDS:=olsrd-git
119   TITLE:=Watchdog plugin
120 endef
121
122 define Package/olsrd-git-mod-secure/conffiles
123 /etc/olsrd.d/olsrd_secure_key
124 endef
125
126 MAKE_FLAGS+= \
127         NO_DEBUG_MESSAGES=1 \
128         OS="linux" \
129         DESTDIR="$(PKG_INSTALL_DIR)" \
130         STRIP="true" \
131         INSTALL_LIB="true" \
132         SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo mdns nameservice quagga secure txtinfo watchdog"
133
134 define Build/Compile
135         $(call Build/Compile/Default,all)
136         $(call Build/Compile/Default,libs)
137 endef
138
139 define Build/Install
140         $(call Build/Install/Default,install)
141         $(call Build/Install/Default,install_libs)
142 endef
143
144 define Package/olsrd-git/install
145         $(INSTALL_DIR) $(1)/etc/config
146         $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
147         $(INSTALL_DIR) $(1)/usr/sbin
148         $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
149         $(INSTALL_DIR) $(1)/etc/init.d
150         $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
151 endef
152
153 define Package/olsrd-git-mod-arprefresh/install
154         $(INSTALL_DIR) $(1)/usr/lib
155         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
156 endef
157
158 define Package/olsrd-git-mod-dot-draw/install
159         $(INSTALL_DIR) $(1)/usr/lib
160         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
161 endef
162
163 define Package/olsrd-git-mod-bmf/install
164         $(INSTALL_DIR) $(1)/usr/lib
165         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
166 endef
167
168 define Package/olsrd-git-mod-dyn-gw/install
169         $(INSTALL_DIR) $(1)/usr/lib
170         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
171 endef
172
173 define Package/olsrd-git-mod-dyn-gw-plain/install
174         $(INSTALL_DIR) $(1)/usr/lib
175         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/
176 endef
177
178 define Package/olsrd-git-mod-httpinfo/install
179         $(INSTALL_DIR) $(1)/usr/lib
180         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
181 endef
182
183 define Package/olsrd-git-mod-mdns/install
184         $(INSTALL_DIR) $(1)/usr/lib
185         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/mdns/olsrd_mdns.so.* $(1)/usr/lib/
186 endef
187
188 define Package/olsrd-git-mod-nameservice/install
189         $(INSTALL_DIR) $(1)/usr/lib
190         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
191 endef
192
193 define Package/olsrd-git-mod-quagga/install
194         $(INSTALL_DIR) $(1)/usr/lib
195         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/
196 endef
197
198 define Package/olsrd-git-mod-secure/install
199         $(INSTALL_DIR) $(1)/etc/olsrd.d
200         $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
201         $(INSTALL_DIR) $(1)/usr/lib
202         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
203 endef
204
205 define Package/olsrd-git-mod-txtinfo/install
206         $(INSTALL_DIR) $(1)/usr/lib
207         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
208 endef
209
210 define Package/olsrd-git-mod-watchdog/install
211         $(INSTALL_DIR) $(1)/usr/lib
212         $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/watchdog/olsrd_watchdog.so.* $(1)/usr/lib/
213 endef
214
215 $(eval $(call BuildPackage,olsrd-git))
216 $(eval $(call BuildPackage,olsrd-git-mod-arprefresh))
217 $(eval $(call BuildPackage,olsrd-git-mod-dot-draw))
218 $(eval $(call BuildPackage,olsrd-git-mod-bmf))
219 $(eval $(call BuildPackage,olsrd-git-mod-dyn-gw))
220 $(eval $(call BuildPackage,olsrd-git-mod-dyn-gw-plain))
221 $(eval $(call BuildPackage,olsrd-git-mod-httpinfo))
222 $(eval $(call BuildPackage,olsrd-git-mod-mdns))
223 $(eval $(call BuildPackage,olsrd-git-mod-nameservice))
224 $(eval $(call BuildPackage,olsrd-git-mod-quagga))
225 $(eval $(call BuildPackage,olsrd-git-mod-secure))
226 $(eval $(call BuildPackage,olsrd-git-mod-txtinfo))
227 $(eval $(call BuildPackage,olsrd-git-mod-watchdog))