refine strategy to spot ip address, keep on calling guest_ipv4
[build.git] / mlab.mk
1 #
2 # declare the packages to be built and their dependencies
3 # initial version from Mark Huang
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2006 The Trustees of Princeton University
6 # rewritten by Thierry Parmentelat - INRIA Sophia Antipolis
7 #
8 # see doc in Makefile  
9 #
10
11 # mkinitrd
12 #
13 ifeq "$(PLDISTROTAGS)" "planetlab-k32-tags.mk"
14 ifeq "$(DISTRONAME)" "centos5"
15 mkinitrd-MODULES := mkinitrd
16 mkinitrd-SPEC := mkinitrd.spec
17 mkinitrd-BUILD-FROM-SRPM := yes
18 mkinitrd-STOCK-DEVEL-RPMS += parted-devel glib2-devel libdhcp4client-devel libdhcp6client-devel libdhcp-devel 
19 mkinitrd-STOCK-DEVEL-RPMS += device-mapper libselinux-devel libsepol-devel libnl-devel
20 ALL += mkinitrd
21 IN_BOOTCD += mkinitrd
22 IN_SLICEIMAGE += mkinitrd 
23 IN_NODEIMAGE += mkinitrd
24 IN_MYPLC += mkinitrd
25 endif
26 endif
27 #
28 # kernel
29 #
30 # use a package name with srpm in it:
31 # so the source rpm is created by running make srpm in the codebase
32 #
33
34 kernel-MODULES := linux-2.6
35 kernel-SPEC := kernel-2.6.spec
36 kernel-BUILD-FROM-SRPM := yes
37 ifeq "$(HOSTARCH)" "i386"
38 kernel-RPMFLAGS:= --target i686
39 else
40 kernel-RPMFLAGS:= --target $(HOSTARCH)
41 endif
42 kernel-SPECVARS += kernelconfig=planetlab
43 KERNELS += kernel
44
45 kernels: $(KERNELS)
46 kernels-clean: $(foreach package,$(KERNELS),$(package)-clean)
47
48 ALL += $(KERNELS)
49 # this is to mark on which image a given rpm is supposed to go
50 IN_BOOTCD += $(KERNELS)
51 IN_SLICEIMAGE += $(KERNELS)
52 IN_NODEIMAGE += $(KERNELS)
53
54 #
55 # madwifi
56 #
57 # skip this with k32/f8
58 ifneq "" "$(findstring k32,$(PLDISTROTAGS))"
59 ifneq "$(DISTRONAME)" "f8"
60 madwifi-MODULES := madwifi
61 madwifi-SPEC := madwifi.spec
62 madwifi-BUILD-FROM-SRPM := yes
63 madwifi-LOCAL-DEVEL-RPMS += kernel-devel
64 madwifi-SPECVARS = kernel_version=$(kernel.rpm-version) \
65         kernel_release=$(kernel.rpm-release) \
66         kernel_arch=$(kernel.rpm-arch)
67 ALL += madwifi
68 IN_NODEIMAGE += madwifi
69 endif
70 endif
71
72 #
73 # iptables
74 #
75 iptables-MODULES := iptables
76 iptables-SPEC := iptables.spec
77 iptables-BUILD-FROM-SRPM := yes 
78 iptables-LOCAL-DEVEL-RPMS += kernel-devel kernel-headers
79 ALL += iptables
80 IN_NODEIMAGE += iptables
81
82 #
83 # iproute
84 #
85 iproute-MODULES := iproute2
86 iproute-SPEC := iproute.spec
87 iproute-BUILD-FROM-SRPM := yes  
88 #ALL += iproute
89 #IN_NODEIMAGE += iproute
90 #IN_SLICEIMAGE += iproute
91 #IN_BOOTCD += iproute
92
93 #
94 # util-vserver
95 #
96 util-vserver-MODULES := util-vserver
97 util-vserver-SPEC := util-vserver.spec
98 # starting with 0.4
99 util-vserver-BUILD-FROM-SRPM := yes
100 util-vserver-RPMFLAGS:= --without dietlibc --without doc
101 ALL += util-vserver
102 IN_NODEIMAGE += util-vserver
103
104 #
105 # libnl - local import
106 # we need either 1.1 or at least 1.0.pre6
107 # rebuild this on centos5 - see yumexclude
108 #
109 local_libnl=false
110 ifeq "$(DISTRONAME)" "centos5"
111 local_libnl=true
112 endif
113
114 ifeq "$(local_libnl)" "true"
115 libnl-MODULES := libnl
116 libnl-SPEC := libnl.spec
117 libnl-BUILD-FROM-SRPM := yes
118 # this sounds like the thing to do, but in fact linux/if_vlan.h comes with kernel-headers
119 libnl-LOCAL-DEVEL-RPMS += kernel-devel kernel-headers
120 ALL += libnl
121 IN_NODEIMAGE += libnl
122 endif
123
124 #
125 # util-vserver-pl
126 #
127 util-vserver-pl-MODULES := util-vserver-pl
128 util-vserver-pl-SPEC := util-vserver-pl.spec
129 util-vserver-pl-LOCAL-DEVEL-RPMS += util-vserver-lib util-vserver-devel util-vserver-core 
130 ifeq "$(local_libnl)" "true"
131 util-vserver-pl-LOCAL-DEVEL-RPMS += libnl libnl-devel
132 endif
133 ALL += util-vserver-pl
134 IN_NODEIMAGE += util-vserver-pl
135
136 #
137 # NodeUpdate
138 #
139 nodeupdate-MODULES := nodeupdate
140 nodeupdate-SPEC := NodeUpdate.spec
141 ALL += nodeupdate
142 IN_NODEIMAGE += nodeupdate
143
144 #
145 # ipod
146 #
147 ipod-MODULES := PingOfDeath
148 ipod-SPEC := ipod.spec
149 ALL += ipod
150 IN_NODEIMAGE += ipod
151
152 # nodemanager
153 #
154 nodemanager-MODULES := nodemanager
155 nodemanager-SPEC := nodemanager.spec
156 ALL += nodemanager
157 IN_NODEIMAGE += nodemanager
158
159 #
160 # plnode-utils
161
162 plnode-utils-MODULES := plnode-utils
163 plnode-utils-SPEC := plnode-utils-vs.spec
164 ALL += plnode-utils
165 IN_NODEIMAGE += plnode-utils
166
167 #
168 # pl_sshd
169 #
170 sshd-MODULES := pl_sshd
171 sshd-SPEC := pl_sshd.spec
172 ALL += sshd
173 IN_NODEIMAGE += sshd
174
175 #
176 # codemux: Port 80 demux
177 #
178 codemux-MODULES := codemux
179 codemux-SPEC   := codemux.spec
180 ALL += codemux
181 IN_NODEIMAGE += codemux
182
183 #
184 # fprobe-ulog
185 #
186 fprobe-ulog-MODULES := fprobe-ulog
187 fprobe-ulog-SPEC := fprobe-ulog.spec
188 ALL += fprobe-ulog
189 IN_NODEIMAGE += fprobe-ulog
190
191 #
192 # DistributedRateLimiting
193 #
194 DistributedRateLimiting-MODULES := DistributedRateLimiting
195 DistributedRateLimiting-SPEC := DistributedRateLimiting.spec
196 ALL += DistributedRateLimiting
197 IN_NODEREPO += DistributedRateLimiting
198
199 #
200 # pf2slice
201 #
202 pf2slice-MODULES := pf2slice
203 pf2slice-SPEC := pf2slice.spec
204 ALL += pf2slice
205
206 #
207 # PlanetLab Mom: Cleans up your mess
208 #
209 mom-MODULES := mom
210 mom-SPEC := pl_mom.spec
211 ALL += mom
212 IN_NODEIMAGE += mom
213
214 #
215 # inotify-tools - local import
216 # rebuild this on centos5 (not found) - see yumexclude
217 #
218 local_inotify_tools=false
219 ifeq "$(DISTRONAME)" "centos5"
220 local_inotify_tools=true
221 endif
222
223 ifeq "$(DISTRONAME)" "sl6"
224 local_inotify_tools=true
225 endif
226
227 ifeq "$(local_inotify_tools)" "true"
228 inotify-tools-MODULES := inotify-tools
229 inotify-tools-SPEC := inotify-tools.spec
230 inotify-tools-BUILD-FROM-SRPM := yes
231 IN_NODEIMAGE += inotify-tools
232 ALL += inotify-tools
233 endif
234
235 #
236 # openvswitch
237 #
238 openvswitch-MODULES := openvswitch
239 openvswitch-SPEC := openvswitch.spec
240 openvswitch-LOCAL-DEVEL-RPMS += kernel-devel
241
242 #ifeq "$(DISTRONAME)" "$(filter $(DISTRONAME),f14 f15 f16)"
243 #IN_NODEIMAGE += openvswitch
244 #ALL += openvswitch
245 #endif
246
247 #
248 # vsys
249 #
250 vsys-MODULES := vsys
251 vsys-SPEC := vsys.spec
252 # ocaml-docs is not needed anymore but keep it on a tmp basis as some tags may still have it
253 vsys-STOCK-DEVEL-RPMS += ocaml-ocamldoc ocaml-docs
254 ifeq "$(local_inotify_tools)" "true"
255 vsys-LOCAL-DEVEL-RPMS += inotify-tools inotify-tools-devel
256 endif
257 IN_NODEIMAGE += vsys
258 ALL += vsys
259
260 #
261 # vsyssh : installed in slivers
262 #
263 vsyssh-MODULES := vsys
264 vsyssh-SPEC := vsyssh.spec
265 IN_SLICEIMAGE += vsyssh
266 ALL += vsyssh
267
268 #
269 # vsys-scripts
270 #
271 vsys-scripts-MODULES := vsys-scripts
272 vsys-scripts-SPEC := root-context/vsys-scripts.spec
273 IN_NODEIMAGE += vsys-scripts
274 ALL += vsys-scripts
275
276 #
277 # plcapi
278 #
279 plcapi-MODULES := plcapi
280 plcapi-SPEC := plcapi.spec
281 ALL += plcapi
282 IN_MYPLC += plcapi
283
284 #
285 # drupal
286
287 drupal-MODULES := drupal
288 drupal-SPEC := drupal.spec
289 drupal-BUILD-FROM-SRPM := yes
290 ALL += drupal
291 IN_MYPLC += drupal
292
293 #
294 # use the plewww module instead
295 #
296 plewww-MODULES := plewww
297 plewww-SPEC := plewww.spec
298 ALL += plewww
299 IN_MYPLC += plewww
300
301 #
302 # www-register-wizard
303 #
304 www-register-wizard-MODULES := www-register-wizard
305 www-register-wizard-SPEC := www-register-wizard.spec
306 ALL += www-register-wizard
307 IN_MYPLC += www-register-wizard
308
309 #
310 # pcucontrol
311 #
312 pcucontrol-MODULES := pcucontrol
313 pcucontrol-SPEC := pcucontrol.spec
314 ALL += pcucontrol
315
316 #
317 # monitor
318 #
319 monitor-MODULES := monitor
320 monitor-SPEC := Monitor.spec
321 monitor-STOCK-DEVEL-RPMS += net-snmp net-snmp-devel
322 ALL += monitor
323 IN_NODEIMAGE += monitor
324
325 #
326 # PLC RT
327 #
328 plcrt-MODULES := PLCRT
329 plcrt-SPEC := plcrt.spec
330 ALL += plcrt
331
332 # f12 has 0.9-1 already
333 ifeq "$(DISTRONAME)" "$(filter $(DISTRONAME),f8 centos5)"
334 #
335 # pyopenssl
336 #
337 pyopenssl-MODULES := pyopenssl
338 pyopenssl-SPEC := pyOpenSSL.spec
339 pyopenssl-BUILD-FROM-SRPM := yes
340 ALL += pyopenssl
341 endif
342
343 #
344 # pyaspects
345 #
346 pyaspects-MODULES := pyaspects
347 pyaspects-SPEC := pyaspects.spec
348 pyaspects-BUILD-FROM-SRPM := yes
349 ALL += pyaspects
350
351 # sfa now uses the with statement that's not supported on python-2.4 - not even through __future__
352 # In addition we now use sqlalchemy and 0.5 as per f12 is not compatible with our model
353 build_sfa=true
354 ifeq "$(DISTRONAME)" "$(filter $(DISTRONAME),f8 f12 centos5)"
355 build_sfa=false
356 endif
357
358 ifeq "$(build_sfa)" "true"
359 #
360 # sfa - Slice Facility Architecture
361 #
362 sfa-MODULES := sfa
363 sfa-SPEC := sfa.spec
364 ALL += sfa
365
366 sface-MODULES := sface
367 sface-SPEC := sface.spec
368 ALL += sface
369 endif
370
371 #
372 # nodeconfig
373 #
374 nodeconfig-MODULES := nodeconfig
375 nodeconfig-SPEC := nodeconfig.spec
376 ALL += nodeconfig
377 IN_MYPLC += nodeconfig
378
379 #
380 # bootmanager
381 #
382 bootmanager-MODULES := bootmanager
383 bootmanager-SPEC := bootmanager.spec
384 ALL += bootmanager
385 IN_MYPLC += bootmanager
386
387 #
388 # pypcilib : used in bootcd
389
390 pypcilib-MODULES := pypcilib
391 pypcilib-SPEC := pypcilib.spec
392 ALL += pypcilib
393 IN_BOOTCD += pypcilib
394
395 #
396 # pyplnet
397 #
398 pyplnet-MODULES := pyplnet
399 pyplnet-SPEC := pyplnet.spec
400 ALL += pyplnet
401 IN_NODEIMAGE += pyplnet
402 IN_MYPLC += pyplnet
403 IN_BOOTCD += pyplnet
404
405 #
406 # OMF resource controller
407 #
408 omf-resctl-MODULES := omf
409 omf-resctl-SPEC := omf-resctl.spec
410 ALL += omf-resctl
411 IN_SLICEIMAGE += omf-resctl
412
413 #
414 # OMF exp controller
415 #
416 omf-expctl-MODULES := omf
417 omf-expctl-SPEC := omf-expctl.spec
418 ALL += omf-expctl
419
420 #
421 # bootcd
422 #
423 bootcd-MODULES := bootcd build
424 bootcd-SPEC := bootcd.spec
425 bootcd-DEPEND-PACKAGES := $(IN_BOOTCD)
426 bootcd-DEPEND-FILES := RPMS/yumgroups.xml
427 bootcd-RPMDATE := yes
428 ALL += bootcd
429 IN_MYPLC += bootcd
430
431 #
432 # images for slices
433 #
434 sliceimage-MODULES := sliceimage build
435 sliceimage-SPEC := sliceimage.spec
436 sliceimage-DEPEND-PACKAGES := $(IN_SLICEIMAGE)
437 sliceimage-DEPEND-FILES := RPMS/yumgroups.xml
438 sliceimage-RPMDATE := yes
439 ALL += sliceimage
440 IN_NODEIMAGE += sliceimage
441
442 #
443 # vserver-specific sliceimage initialization
444
445 vserver-sliceimage-MODULES := sliceimage
446 vserver-sliceimage-SPEC    := vserver-sliceimage.spec
447 vserver-sliceimage-RPMDATE := yes
448 ALL                        += vserver-sliceimage
449 IN_NODEIMAGE               += vserver-sliceimage
450
451 #
452 # nodeimage
453 #
454 nodeimage-MODULES := nodeimage build
455 nodeimage-SPEC := nodeimage.spec
456 nodeimage-DEPEND-PACKAGES := $(IN_NODEIMAGE)
457 nodeimage-DEPEND-FILES := RPMS/yumgroups.xml
458 nodeimage-RPMDATE := yes
459 ALL += nodeimage
460 IN_MYPLC += nodeimage
461
462 #
463 # noderepo
464 #
465 # all rpms resulting from packages marked as being in nodeimage and sliceimage
466 NODEREPO_RPMS = $(foreach package,$(IN_NODEIMAGE) $(IN_NODEREPO) $(IN_SLICEIMAGE),$($(package).rpms))
467 # replace space with +++ (specvars cannot deal with spaces)
468 SPACE=$(subst x, ,x)
469 NODEREPO_RPMS_3PLUS = $(subst $(SPACE),+++,$(NODEREPO_RPMS))
470
471 noderepo-MODULES := nodeimage
472 noderepo-SPEC := noderepo.spec
473 # package requires all embedded packages
474 noderepo-DEPEND-PACKAGES := $(IN_NODEIMAGE) $(IN_NODEREPO) $(IN_SLICEIMAGE)
475 noderepo-DEPEND-FILES := RPMS/yumgroups.xml
476 #export rpm list to the specfile
477 noderepo-SPECVARS = node_rpms_plus=$(NODEREPO_RPMS_3PLUS)
478 noderepo-RPMDATE := yes
479 ALL += noderepo
480 IN_MYPLC += noderepo
481
482 #
483 # slicerepo
484 #
485 # all rpms resulting from packages marked as being in vserver
486 SLICEREPO_RPMS = $(foreach package,$(IN_SLICEIMAGE),$($(package).rpms))
487 # replace space with +++ (specvars cannot deal with spaces)
488 SPACE=$(subst x, ,x)
489 SLICEREPO_RPMS_3PLUS = $(subst $(SPACE),+++,$(SLICEREPO_RPMS))
490
491 slicerepo-MODULES := nodeimage
492 slicerepo-SPEC := slicerepo.spec
493 # package requires all embedded packages
494 slicerepo-DEPEND-PACKAGES := $(IN_SLICEIMAGE)
495 slicerepo-DEPEND-FILES := RPMS/yumgroups.xml
496 #export rpm list to the specfile
497 slicerepo-SPECVARS = slice_rpms_plus=$(SLICEREPO_RPMS_3PLUS)
498 slicerepo-RPMDATE := yes
499 ALL += slicerepo
500
501 #
502 # MyPLC : lightweight packaging, dependencies are yum-installed in a vserver
503 #
504 myplc-MODULES := myplc
505 myplc-SPEC := myplc.spec
506 myplc-DEPEND-FILES := myplc-release RPMS/yumgroups.xml
507 ALL += myplc
508
509 # myplc-docs only contains docs for PLCAPI and NMAPI, but
510 # we still need to pull MyPLC, as it is where the specfile lies, 
511 # together with the utility script docbook2drupal.sh
512 myplc-docs-MODULES := myplc plcapi nodemanager monitor
513 myplc-docs-SPEC := myplc-docs.spec
514 ALL += myplc-docs
515
516 # using some other name than myplc-release, as this is a make target already
517 release-MODULES := myplc
518 release-SPEC := myplc-release.spec
519 release-RPMDATE := yes
520 ALL += release