olsrd: hotplug: optimize execution-speed and simplify using already existing GLOBAL...
[feed/routing.git] / olsrd / Makefile
1 #
2 # Copyright (C) 2009-2012 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
11 PKG_VERSION:=0.6.6
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6
16
17 PKG_MD5SUM:=f98e5a10f1842f6028023da114bf1e1a
18 PKG_BUILD_PARALLEL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 TARGET_CFLAGS += $(FPIC)
23
24 define Package/olsrd/template
25 SECTION:=net
26 CATEGORY:=Network
27 SUBMENU:=Routing and Redirection
28 MAINTAINER:=Saverio Proto <zioproto@gmail.com>
29 TITLE:=OLSR (Optimized Link State Routing) daemon
30 URL:=http://www.olsr.org/
31 endef
32
33 define Package/olsrd
34 $(call Package/olsrd/template)
35 MENU:=1
36 DEPENDS:=+libpthread
37 endef
38
39 define Package/olsrd/conffiles
40 /etc/config/olsrd
41 endef
42
43 define Package/olsrd-mod-arprefresh
44 $(call Package/olsrd/template)
45 DEPENDS:=olsrd
46 TITLE:=Kernel ARP cache refresh plugin
47 endef
48
49 define Package/olsrd-mod-dot-draw
50 $(call Package/olsrd/template)
51 DEPENDS:=olsrd
52 TITLE:=Dot topology information plugin
53 endef
54
55 define Package/olsrd-mod-bmf
56 $(call Package/olsrd/template)
57 DEPENDS:=olsrd +kmod-tun
58 TITLE:=Basic multicast forwarding plugin
59 endef
60
61 define Package/olsrd-mod-dyn-gw
62 $(call Package/olsrd/template)
63 DEPENDS:=olsrd
64 TITLE:=Dynamic internet gateway plugin
65 endef
66
67 define Package/olsrd-mod-dyn-gw-plain
68 $(call Package/olsrd/template)
69 DEPENDS:=olsrd
70 TITLE:=Dynamic internet gateway plain plugin
71 endef
72
73 define Package/olsrd-mod-httpinfo
74 $(call Package/olsrd/template)
75 DEPENDS:=olsrd
76 TITLE:=Small informative web server plugin
77 endef
78
79 define Package/olsrd-mod-jsoninfo
80 $(call Package/olsrd/template)
81 DEPENDS:=olsrd
82 TITLE:=Small informative plugin with JSON output
83 endef
84
85 define Package/olsrd-mod-mdns
86 $(call Package/olsrd/template)
87 DEPENDS:=olsrd
88 TITLE:=MDNS/Zeroconf/Bonjour packet distribution
89 endef
90
91 define Package/olsrd-mod-nameservice
92 $(call Package/olsrd/template)
93 DEPENDS:=olsrd
94 TITLE:=Lightweight hostname resolver plugin
95 endef
96
97 define Package/olsrd-mod-p2pd
98 $(call Package/olsrd/template)
99 DEPENDS:=olsrd
100 TITLE:=Peer to Peer Discovery plugin
101 endef
102
103
104 define Package/olsrd-mod-pgraph
105 $(call Package/olsrd/template)
106 DEPENDS:=olsrd
107 TITLE:=output network topology for pgraph
108 endef
109
110 define Package/olsrd-mod-pud
111 $(call Package/olsrd/template)
112 DEPENDS:=olsrd
113 TITLE:=Position Update Distribution plugin
114 endef
115
116 define Package/olsrd-mod-quagga
117 $(call Package/olsrd/template)
118 DEPENDS:=olsrd
119 TITLE:=Quagga plugin
120 endef
121
122 define Package/olsrd-mod-secure
123 $(call Package/olsrd/template)
124 DEPENDS:=olsrd
125 TITLE:=Message signing plugin to secure routing domain
126 endef
127
128 define Package/olsrd-mod-sgwdynspeed
129 $(call Package/olsrd/template)
130 DEPENDS:=olsrd
131 TITLE:=Smart Gateway dynamic speed plugin
132 endef
133
134 define Package/olsrd-mod-txtinfo
135 $(call Package/olsrd/template)
136 DEPENDS:=olsrd
137 TITLE:=Small informative web server plugin
138 endef
139
140 define Package/olsrd-mod-watchdog
141 $(call Package/olsrd/template)
142 DEPENDS:=olsrd
143 TITLE:=Watchdog plugin
144 endef
145
146 define Package/olsrd-mod-pud/conffiles
147 /etc/olsrd.d/olsrd.pud.position.conf
148 endef
149
150 define Package/olsrd-mod-secure/conffiles
151 /etc/olsrd.d/olsrd_secure_key
152 endef
153
154 define Package/olsrd-mod-sgwdynspeed/conffiles
155 /etc/olsrd.d/olsrd.sgw.speed.conf
156 endef
157
158 MAKE_FLAGS+= \
159 NO_DEBUG_MESSAGES=1 \
160 OS="linux" \
161 DESTDIR="$(PKG_INSTALL_DIR)" \
162 STRIP="true" \
163 INSTALL_LIB="true" \
164 SUBDIRS="arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo jsoninfo mdns nameservice p2pd pgraph pud quagga secure sgwdynspeed txtinfo watchdog"
165
166 define Build/Compile
167 $(call Build/Compile/Default,all)
168 $(call Build/Compile/Default,libs)
169 endef
170
171 define Package/olsrd/install
172 $(INSTALL_DIR) $(1)/etc/config
173 $(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
174 $(INSTALL_DIR) $(1)/usr/sbin
175 $(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
176 $(INSTALL_DIR) $(1)/etc/init.d
177 $(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
178 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
179 $(INSTALL_BIN) ./files/olsrd.hotplug.sh $(1)/etc/hotplug.d/iface/50-olsrd
180 endef
181
182 define Package/olsrd-mod-arprefresh/install
183 $(INSTALL_DIR) $(1)/usr/lib
184 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/arprefresh/olsrd_arprefresh.so.* $(1)/usr/lib/
185 endef
186
187 define Package/olsrd-mod-dot-draw/install
188 $(INSTALL_DIR) $(1)/usr/lib
189 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dot_draw/olsrd_dot_draw.so.* $(1)/usr/lib/
190 endef
191
192 define Package/olsrd-mod-bmf/install
193 $(INSTALL_DIR) $(1)/usr/lib
194 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmf/olsrd_bmf.so.* $(1)/usr/lib/
195 endef
196
197 define Package/olsrd-mod-dyn-gw/install
198 $(INSTALL_DIR) $(1)/usr/lib
199 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.* $(1)/usr/lib/
200 endef
201
202 define Package/olsrd-mod-dyn-gw-plain/install
203 $(INSTALL_DIR) $(1)/usr/lib
204 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/dyn_gw_plain/olsrd_dyn_gw_plain.so.* $(1)/usr/lib/
205 endef
206
207 define Package/olsrd-mod-httpinfo/install
208 $(INSTALL_DIR) $(1)/usr/lib
209 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.* $(1)/usr/lib/
210 endef
211
212 define Package/olsrd-mod-jsoninfo/install
213 $(INSTALL_DIR) $(1)/usr/lib
214 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/jsoninfo/olsrd_jsoninfo.so.* $(1)/usr/lib/
215 endef
216
217 define Package/olsrd-mod-mdns/install
218 $(INSTALL_DIR) $(1)/usr/lib
219 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/mdns/olsrd_mdns.so.* $(1)/usr/lib/
220 endef
221
222 define Package/olsrd-mod-nameservice/install
223 $(INSTALL_DIR) $(1)/usr/lib
224 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.* $(1)/usr/lib/
225 endef
226
227 define Package/olsrd-mod-p2pd/install
228 $(INSTALL_DIR) $(1)/usr/lib
229 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/p2pd/olsrd_p2pd.so.* $(1)/usr/lib/
230 endef
231
232 define Package/olsrd-mod-pgraph/install
233 $(INSTALL_DIR) $(1)/usr/lib
234 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/pgraph/olsrd_pgraph.so.* $(1)/usr/lib/
235 endef
236
237 define Package/olsrd-mod-pud/install
238 $(INSTALL_DIR) $(1)/etc/olsrd.d
239 $(CP) ./files/olsrd.pud.position.conf $(1)/etc/olsrd.d/
240 $(INSTALL_DIR) $(1)/usr/lib
241 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/pud/nmealib/lib/libnmea.so $(1)/usr/lib/
242 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/pud/wireformat/lib/libOlsrdPudWireFormat.so $(1)/usr/lib/
243 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/pud/olsrd_pud.so.* $(1)/usr/lib/
244 endef
245
246 define Package/olsrd-mod-quagga/install
247 $(INSTALL_DIR) $(1)/usr/lib
248 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/quagga/olsrd_quagga.so.* $(1)/usr/lib/
249 endef
250
251 define Package/olsrd-mod-secure/install
252 $(INSTALL_DIR) $(1)/etc/olsrd.d
253 $(CP) ./files/olsrd_secure_key $(1)/etc/olsrd.d/
254 $(INSTALL_DIR) $(1)/usr/lib
255 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.* $(1)/usr/lib/
256 endef
257
258 define Package/olsrd-mod-sgwdynspeed/install
259 $(INSTALL_DIR) $(1)/etc/olsrd.d
260 $(CP) ./files/olsrd.sgw.speed.conf $(1)/etc/olsrd.d/
261 $(INSTALL_DIR) $(1)/usr/lib
262 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/sgwdynspeed/olsrd_sgwdynspeed.so.* $(1)/usr/lib/
263 endef
264
265 define Package/olsrd-mod-txtinfo/install
266 $(INSTALL_DIR) $(1)/usr/lib
267 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/txtinfo/olsrd_txtinfo.so.* $(1)/usr/lib/
268 endef
269
270 define Package/olsrd-mod-watchdog/install
271 $(INSTALL_DIR) $(1)/usr/lib
272 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/watchdog/olsrd_watchdog.so.* $(1)/usr/lib/
273 endef
274
275 $(eval $(call BuildPackage,olsrd))
276 $(eval $(call BuildPackage,olsrd-mod-arprefresh))
277 $(eval $(call BuildPackage,olsrd-mod-dot-draw))
278 $(eval $(call BuildPackage,olsrd-mod-bmf))
279 $(eval $(call BuildPackage,olsrd-mod-dyn-gw))
280 $(eval $(call BuildPackage,olsrd-mod-dyn-gw-plain))
281 $(eval $(call BuildPackage,olsrd-mod-httpinfo))
282 $(eval $(call BuildPackage,olsrd-mod-jsoninfo))
283 $(eval $(call BuildPackage,olsrd-mod-mdns))
284 $(eval $(call BuildPackage,olsrd-mod-nameservice))
285 $(eval $(call BuildPackage,olsrd-mod-p2pd))
286 $(eval $(call BuildPackage,olsrd-mod-pgraph))
287 $(eval $(call BuildPackage,olsrd-mod-pud))
288 $(eval $(call BuildPackage,olsrd-mod-quagga))
289 $(eval $(call BuildPackage,olsrd-mod-secure))
290 $(eval $(call BuildPackage,olsrd-mod-sgwdynspeed))
291 $(eval $(call BuildPackage,olsrd-mod-txtinfo))
292 $(eval $(call BuildPackage,olsrd-mod-watchdog))