refine strategy to spot ip address, keep on calling guest_ipv4
[build.git] / nornet.mk
1 # /=========================================================================\
2 # =             #     #                 #     #                             =
3 # =             ##    #   ####   #####  ##    #  ######   #####             =
4 # =             # #   #  #    #  #    # # #   #  #          #               =
5 # =             #  #  #  #    #  #    # #  #  #  #####      #               =
6 # =             #   # #  #    #  #####  #   # #  #          #               =
7 # =             #    ##  #    #  #   #  #    ##  #          #               =
8 # =             #     #   ####   #    # #     #  ######     #               =
9 # =                                                                         =
10 # =             A Real-World, Large-Scale Multi-Homing Testbed              =
11 # =                          https://www.nntb.no/                           =
12 # =                                                                         =
13 # = Contact: Thomas Dreibholz                                               =
14 # =          dreibh@simula.no, https://www.simula.no/people/dreibh          =
15 # \=========================================================================/
16
17 #
18 # declare the packages to be built and their dependencies
19 # initial version from Mark Huang
20 # Mark Huang <mlhuang@cs.princeton.edu>
21 # Copyright (C) 2003-2006 The Trustees of Princeton University
22 # rewritten by Thierry Parmentelat - INRIA Sophia Antipolis
23 #
24 # see doc in Makefile  
25 #
26
27
28 # ###### NorNet customisation ###############################################
29
30 kernel-MODULES := linux
31 kernel-SPEC := kernel.spec
32 kernel-BUILD-FROM-SRPM := yes
33 ifeq "$(HOSTARCH)" "i386"
34    kernel-RPMFLAGS := --target i686
35 else
36    kernel-RPMFLAGS := --target $(HOSTARCH)
37 endif
38 kernel-RPMFLAGS += --without smp --without pae --without debug --without doc --without debuginfo --without perf
39 kernel-WHITELIST-RPMS := kernel,kernel-headers,kernel-devel,kernel-modules-extra,kernel-tools,kernel-tools-libs,kernel-tools-libs-devel
40 kernel-SPECVARS += kernelconfig=planetlab
41 KERNELS += kernel
42 #kernel-STOCK-DEVEL-RPMS +=
43
44 kernels: $(KERNELS)
45 kernels-clean: $(foreach package,$(KERNELS),$(package)-clean)
46
47 ALL += $(KERNELS)
48 # this is to mark on which image a given rpm is supposed to go
49 IN_BOOTCD += $(KERNELS)
50 #IN_SLICEIMAGE += $(KERNELS)
51 IN_NODEIMAGE += $(KERNELS)
52
53 #
54 # netperfmeter
55 #
56 netperfmeter-MODULES := netperfmeter
57 netperfmeter-SPEC := rpm/netperfmeter.spec
58 ALL += netperfmeter
59 IN_NODEIMAGE += netperfmeter
60
61 #
62 # nornet-nn
63 #
64 nornet-nn-MODULES := nornet-nn
65 nornet-nn-SPEC := rpm/nornet-nn.spec
66 ALL += nornet-nn
67 IN_NODEIMAGE += nornet-nn
68
69 #
70 # rsplib
71 #
72 rsplib-MODULES := rsplib
73 rsplib-SPEC := rpm/rsplib.spec
74 ALL += rsplib
75 IN_NODEIMAGE += rsplib
76
77 #
78 # subnetcalc
79 #
80 subnetcalc-MODULES := subnetcalc
81 subnetcalc-SPEC := rpm/subnetcalc.spec
82 ALL += subnetcalc
83 IN_NODEIMAGE += subnetcalc
84
85 #
86 # tracebox
87 #
88 # tracebox-MODULES := tracebox
89 # tracebox-SPEC := rpm/tracebox.spec
90 # tracebox-STOCK-DEVEL-RPMS := fakeroot
91 # ALL += tracebox
92 # IN_NODEIMAGE += tracebox
93
94 #
95 # tsctp
96 #
97 tsctp-MODULES := tsctp
98 tsctp-SPEC := rpm/tsctp.spec
99 ALL += tsctp
100 IN_NODEIMAGE += tsctp
101
102 # ###########################################################################
103
104
105 ### the madwifi drivers ship with fedora16's kernel rpm
106
107 #
108 # lxc-userspace: scripts for entering containers
109 #
110 lxc-userspace-MODULES := lxc-userspace
111 lxc-userspace-SPEC := lxc-userspace.spec
112 ALL += lxc-userspace
113 IN_NODEIMAGE += lxc-userspace
114
115 #
116 #
117 # transforward: root context module for transparent port forwarding
118 #
119 transforward-MODULES := transforward
120 transforward-SPEC := transforward.spec
121 # ##### NorNet ########################
122 transforward-LOCAL-DEVEL-RPMS += kernel-devel
123 transforward-SPECVARS = kernel_version=$(kernel.rpm-version) \
124         kernel_release=$(kernel.rpm-release) \
125         kernel_arch=$(kernel.rpm-arch)
126 # #####################################
127 ALL += transforward
128 IN_NODEIMAGE += transforward
129
130 #
131 # procprotect: root context module for protecting against weaknesses in /proc
132 #
133 procprotect-MODULES := procprotect
134 procprotect-SPEC := procprotect.spec
135 # ##### NorNet ########################
136 procprotect-LOCAL-DEVEL-RPMS += kernel-devel
137 procprotect-SPECVARS = kernel_version=$(kernel.rpm-version) \
138         kernel_release=$(kernel.rpm-release) \
139         kernel_arch=$(kernel.rpm-arch)
140 # #####################################
141 ALL += procprotect
142 IN_NODEIMAGE += procprotect
143
144 #
145 # ipfw: root context module, and slice companion
146 #
147 # this module won't build yet under f20
148 ifeq "$(DISTRONAME)" "f18"
149 ipfwroot-MODULES := ipfw
150 ipfwroot-SPEC := planetlab/ipfwroot.spec
151 # ##### NorNet ########################
152 ipfwroot-LOCAL-DEVEL-RPMS += kernel-devel
153 ipfwroot-SPECVARS = kernel_version=$(kernel.rpm-version) \
154         kernel_release=$(kernel.rpm-release) \
155         kernel_arch=$(kernel.rpm-arch)
156 # #####################################
157 ALL += ipfwroot
158 IN_NODEIMAGE += ipfwroot
159
160 ipfwslice-MODULES := ipfw
161 ipfwslice-SPEC := planetlab/ipfwslice.spec
162 # ##### NorNet ########################
163 ipfwslice-LOCAL-DEVEL-RPMS += kernel-devel
164 ipfwslice-SPECVARS = kernel_version=$(kernel.rpm-version) \
165         kernel_release=$(kernel.rpm-release) \
166         kernel_arch=$(kernel.rpm-arch)
167 # #####################################
168 ALL += ipfwslice
169 endif
170
171 #
172 # comgt - a companion to umts tools
173
174 comgt-MODULES := comgt
175 comgt-SPEC := comgt.spec
176 IN_NODEIMAGE += comgt
177 ALL += comgt
178
179 #
180 # umts: root context stuff
181 #
182 umts-backend-MODULES := planetlab-umts-tools
183 umts-backend-SPEC := backend.spec
184 IN_NODEIMAGE += umts-backend
185 ALL += umts-backend
186
187 #
188 # umts: slice tools
189 #
190 umts-frontend-MODULES := planetlab-umts-tools
191 umts-frontend-SPEC := frontend.spec
192 IN_SLICEIMAGE += umts-frontend
193 ALL += umts-frontend
194
195 #
196 # NodeUpdate
197 #
198 nodeupdate-MODULES := nodeupdate
199 nodeupdate-SPEC := NodeUpdate.spec
200 ALL += nodeupdate
201 IN_NODEIMAGE += nodeupdate
202
203 #
204 # ipod
205 #
206 ipod-MODULES := PingOfDeath
207 ipod-SPEC := ipod.spec
208 ALL += ipod
209 IN_NODEIMAGE += ipod
210
211 #
212 # plnode-utils
213
214 plnode-utils-MODULES := plnode-utils
215 plnode-utils-SPEC := plnode-utils-lxc.spec
216 ALL += plnode-utils
217 IN_NODEIMAGE += plnode-utils
218
219 # nodemanager
220 #
221 nodemanager-MODULES := nodemanager
222 nodemanager-SPEC := nodemanager.spec
223 ALL += nodemanager
224 IN_NODEIMAGE += nodemanager
225
226 #
227 # pl_sshd
228 #
229 sshd-MODULES := pl_sshd
230 sshd-SPEC := pl_sshd.spec
231 ALL += sshd
232 IN_NODEIMAGE += sshd
233
234 #
235 # codemux: Port 80 demux
236 #
237 codemux-MODULES := codemux
238 codemux-SPEC   := codemux.spec
239 ALL += codemux
240 IN_NODEIMAGE += codemux
241
242 #
243 # fprobe-ulog
244 #
245 fprobe-ulog-MODULES := fprobe-ulog
246 fprobe-ulog-SPEC := fprobe-ulog.spec
247 ALL += fprobe-ulog
248 IN_NODEIMAGE += fprobe-ulog
249
250 #################### libvirt version selection
251 # settling with using version 1.2.1 on all fedoras
252 # although this does not solve the slice re-creation issue seen on f20
253
254 local_libvirt=true
255 separate_libvirt_python=true
256
257 #
258 # libvirt
259 #
260 ifeq "$(local_libvirt)" "true"
261
262 libvirt-MODULES := libvirt
263 libvirt-SPEC    := libvirt.spec
264 libvirt-BUILD-FROM-SRPM := yes
265 # The --without options are breaking spec2make : hard-wired in the specfile instead
266 libvirt-STOCK-DEVEL-RPMS += xhtml1-dtds
267 libvirt-STOCK-DEVEL-RPMS += libattr-devel augeas libpciaccess-devel yajl-devel 
268 libvirt-STOCK-DEVEL-RPMS += libpcap-devel radvd ebtables device-mapper-devel 
269 libvirt-STOCK-DEVEL-RPMS += ceph-devel numactl-devel libcap-ng-devel scrub 
270 # for 1.2.1 - first seen on f20, not sure for the other ones
271 libvirt-STOCK-DEVEL-RPMS += libblkid-devel glusterfs-api-devel glusterfs-devel
272 # strictly speaking fuse-devel is not required anymore but we might wish to turn fuse back on again in the future
273 libvirt-STOCK-DEVEL-RPMS += fuse-devel libssh2-devel dbus-devel numad 
274 libvirt-STOCK-DEVEL-RPMS += systemd-devel libnl3-devel iptables-services netcf-devel
275 ALL += libvirt
276 IN_NODEREPO += libvirt
277 IN_NODEIMAGE += libvirt
278
279 endif
280
281 #
282 ## libvirt-python
283 #
284 ifeq "$(separate_libvirt_python)" "true"
285
286 libvirt-python-MODULES := libvirt-python
287 libvirt-python-SPEC    := libvirt-python.spec
288 libvirt-python-BUILD-FROM-SRPM := yes
289 libvirt-python-STOCK-DEVEL-RPMS += pm-utils
290 libvirt-python-LOCAL-DEVEL-RPMS += libvirt-devel libvirt-docs libvirt-client
291 libvirt-python-RPMFLAGS :=     --define 'packager PlanetLab'
292 ALL += libvirt-python
293 IN_NODEREPO += libvirt-python
294 IN_NODEIMAGE += libvirt-python
295
296 endif
297
298 #
299 # DistributedRateLimiting
300 #
301 #DistributedRateLimiting-MODULES := DistributedRateLimiting
302 #DistributedRateLimiting-SPEC := DistributedRateLimiting.spec
303 #ALL += DistributedRateLimiting
304 #IN_NODEREPO += DistributedRateLimiting
305
306 #
307 # pf2slice
308 #
309 pf2slice-MODULES := pf2slice
310 pf2slice-SPEC := pf2slice.spec
311 ALL += pf2slice
312
313 ##
314 ## PlanetLab Mom: Cleans up your mess
315 ##
316 #mom-MODULES := mom
317 #mom-SPEC := pl_mom.spec
318 #ALL += mom
319 #IN_NODEIMAGE += mom
320
321 #
322 # openvswitch
323 #
324 # openvswitch-MODULES := openvswitch
325 # openvswitch-SPEC := openvswitch.spec
326 # openvswitch-STOCK-DEVEL-RPMS += kernel-devel
327 # IN_NODEIMAGE += openvswitch
328 # # build only on f14 as f16 has this natively
329 # ifeq "$(DISTRONAME)" "$(filter $(DISTRONAME),f14)"
330 # ALL += openvswitch
331 # endif
332
333 #
334 # vsys
335 #
336 vsys-MODULES := vsys
337 vsys-SPEC := vsys.spec
338 # ocaml-docs is not needed anymore but keep it on a tmp basis as some tags may still have it
339 vsys-STOCK-DEVEL-RPMS += ocaml-ocamldoc ocaml-docs
340 IN_NODEIMAGE += vsys
341 ALL += vsys
342
343 #
344 # vsyssh : installed in slivers
345 #
346 vsyssh-MODULES := vsys
347 vsyssh-SPEC := vsyssh.spec
348 IN_SLICEIMAGE += vsyssh
349 ALL += vsyssh
350
351 #
352 # vsys-scripts
353 #
354 vsys-scripts-MODULES := vsys-scripts
355 vsys-scripts-SPEC := root-context/vsys-scripts.spec
356 IN_NODEIMAGE += vsys-scripts
357 ALL += vsys-scripts
358
359 vsys-wrapper-MODULES := vsys-scripts
360 vsys-wrapper-SPEC := slice-context/vsys-wrapper.spec
361 IN_SLICEIMAGE += vsys-wrapper
362 ALL += vsys-wrapper
363
364 #
365 # bind_public
366 #
367 # bind_public-MODULES := bind_public
368 # bind_public-SPEC := bind_public.spec
369 # IN_SLICEIMAGE += bind_public
370 # ALL += bind_public
371
372 #
373 # sliver-openvswitch
374 #
375 sliver-openvswitch-MODULES := sliver-openvswitch
376 sliver-openvswitch-SPEC := sliver-openvswitch.spec
377 IN_SLICEIMAGE += sliver-openvswitch
378 ALL += sliver-openvswitch
379
380 #
381 # plcapi
382 #
383 plcapi-MODULES := plcapi
384 plcapi-SPEC := plcapi.spec
385 ALL += plcapi
386 IN_MYPLC += plcapi
387
388 #
389 # drupal
390
391 drupal-MODULES := drupal
392 drupal-SPEC := drupal.spec
393 drupal-BUILD-FROM-SRPM := yes
394 ALL += drupal
395 IN_MYPLC += drupal
396
397 #
398 # use the plewww module instead
399 #
400 plewww-MODULES := plewww
401 plewww-SPEC := plewww.spec
402 ALL += plewww
403 IN_MYPLC += plewww
404
405 #
406 # www-register-wizard
407 #
408 www-register-wizard-MODULES := www-register-wizard
409 www-register-wizard-SPEC := www-register-wizard.spec
410 ALL += www-register-wizard
411 IN_MYPLC += www-register-wizard
412
413 #
414 # pcucontrol
415 #
416 pcucontrol-MODULES := pcucontrol
417 pcucontrol-SPEC := pcucontrol.spec
418 ALL += pcucontrol
419
420 #
421 # monitor
422 #
423 #monitor-MODULES := monitor
424 #monitor-SPEC := Monitor.spec
425 #monitor-STOCK-DEVEL-RPMS += net-snmp net-snmp-devel
426 #ALL += monitor
427 #IN_NODEIMAGE += monitor
428
429 #
430 # PLC RT
431 #
432 plcrt-MODULES := PLCRT
433 plcrt-SPEC := plcrt.spec
434 ALL += plcrt
435
436 # f12 has 0.9-1 already
437 ifeq "$(DISTRONAME)" "$(filter $(DISTRONAME),f8 centos5)"
438 #
439 # pyopenssl
440 #
441 pyopenssl-MODULES := pyopenssl
442 pyopenssl-SPEC := pyOpenSSL.spec
443 pyopenssl-BUILD-FROM-SRPM := yes
444 ALL += pyopenssl
445 endif
446
447 #
448 # pyaspects
449 #
450 pyaspects-MODULES := pyaspects
451 pyaspects-SPEC := pyaspects.spec
452 pyaspects-BUILD-FROM-SRPM := yes
453 ALL += pyaspects
454
455 #
456 # nodeconfig
457 #
458 nodeconfig-MODULES := nodeconfig
459 nodeconfig-SPEC := nodeconfig.spec
460 ALL += nodeconfig
461 IN_MYPLC += nodeconfig
462
463 #
464 # bootmanager
465 #
466 bootmanager-MODULES := bootmanager
467 bootmanager-SPEC := bootmanager.spec
468 ALL += bootmanager
469 IN_MYPLC += bootmanager
470
471 #
472 # pypcilib : used in bootcd
473
474 pypcilib-MODULES := pypcilib
475 pypcilib-SPEC := pypcilib.spec
476 ALL += pypcilib
477 IN_BOOTCD += pypcilib
478
479 #
480 # pyplnet
481 #
482 pyplnet-MODULES := pyplnet
483 pyplnet-SPEC := pyplnet.spec
484 ALL += pyplnet
485 IN_NODEIMAGE += pyplnet
486 IN_MYPLC += pyplnet
487 IN_BOOTCD += pyplnet
488
489 #
490 # OML measurement library
491 #
492 oml-MODULES := oml
493 oml-STOCK-DEVEL-RPMS += sqlite-devel 
494 oml-SPEC := liboml.spec
495 ALL += oml
496
497 #
498 # bootcd
499 #
500 bootcd-MODULES := bootcd build
501 bootcd-SPEC := bootcd.spec
502 bootcd-DEPEND-PACKAGES := $(IN_BOOTCD)
503 bootcd-DEPEND-FILES := RPMS/yumgroups.xml
504 bootcd-RPMDATE := yes
505 ALL += bootcd
506 IN_MYPLC += bootcd
507
508 #
509 # images for slices
510 #
511 sliceimage-MODULES := sliceimage build
512 sliceimage-SPEC := sliceimage.spec
513 sliceimage-DEPEND-PACKAGES := $(IN_SLICEIMAGE)
514 sliceimage-DEPEND-FILES := RPMS/yumgroups.xml
515 sliceimage-RPMDATE := yes
516 ALL += sliceimage
517 IN_NODEIMAGE += sliceimage
518
519 #
520 # lxc-specific sliceimage initialization
521
522 lxc-sliceimage-MODULES  := sliceimage
523 lxc-sliceimage-SPEC     := lxc-sliceimage.spec
524 lxc-sliceimage-RPMDATE  := yes
525 ALL                     += lxc-sliceimage
526 IN_NODEIMAGE            += lxc-sliceimage
527
528 #
529 # nodeimage
530 #
531 nodeimage-MODULES := nodeimage build
532 nodeimage-SPEC := nodeimage.spec
533 nodeimage-DEPEND-PACKAGES := $(IN_NODEIMAGE)
534 nodeimage-DEPEND-FILES := RPMS/yumgroups.xml
535 nodeimage-RPMDATE := yes
536 ALL += nodeimage
537 IN_MYPLC += nodeimage
538
539 #
540 # noderepo
541 #
542 # all rpms resulting from packages marked as being in nodeimage and sliceimage
543 NODEREPO_RPMS = $(foreach package,$(IN_NODEIMAGE) $(IN_NODEREPO) $(IN_SLICEIMAGE),$($(package).rpms))
544 # replace space with +++ (specvars cannot deal with spaces)
545 SPACE=$(subst x, ,x)
546 NODEREPO_RPMS_3PLUS = $(subst $(SPACE),+++,$(NODEREPO_RPMS))
547
548 noderepo-MODULES := nodeimage
549 noderepo-SPEC := noderepo.spec
550 # package requires all embedded packages
551 noderepo-DEPEND-PACKAGES := $(IN_NODEIMAGE) $(IN_NODEREPO) $(IN_SLICEIMAGE)
552 noderepo-DEPEND-FILES := RPMS/yumgroups.xml
553 #export rpm list to the specfile
554 noderepo-SPECVARS = node_rpms_plus=$(NODEREPO_RPMS_3PLUS)
555 noderepo-RPMDATE := yes
556 ALL += noderepo
557 IN_MYPLC += noderepo
558
559 #
560 # slicerepo
561 #
562 # all rpms resulting from packages marked as being in vserver
563 SLICEREPO_RPMS = $(foreach package,$(IN_SLICEIMAGE),$($(package).rpms))
564 # replace space with +++ (specvars cannot deal with spaces)
565 SPACE=$(subst x, ,x)
566 SLICEREPO_RPMS_3PLUS = $(subst $(SPACE),+++,$(SLICEREPO_RPMS))
567
568 slicerepo-MODULES := nodeimage
569 slicerepo-SPEC := slicerepo.spec
570 # package requires all embedded packages
571 slicerepo-DEPEND-PACKAGES := $(IN_SLICEIMAGE)
572 slicerepo-DEPEND-FILES := RPMS/yumgroups.xml
573 #export rpm list to the specfile
574 slicerepo-SPECVARS = slice_rpms_plus=$(SLICEREPO_RPMS_3PLUS)
575 slicerepo-RPMDATE := yes
576 ALL += slicerepo
577
578 #
579 # MyPLC : lightweight packaging, dependencies are yum-installed in a vserver
580 #
581 myplc-MODULES := myplc
582 myplc-SPEC := myplc.spec
583 myplc-DEPEND-FILES := myplc-release RPMS/yumgroups.xml
584 ALL += myplc
585
586 # myplc-docs only contains docs for PLCAPI and NMAPI, but
587 # we still need to pull MyPLC, as it is where the specfile lies, 
588 # together with the utility script docbook2drupal.sh
589 myplc-docs-MODULES := myplc plcapi nodemanager monitor
590 myplc-docs-SPEC := myplc-docs.spec
591 ALL += myplc-docs
592
593 # using some other name than myplc-release, as this is a make target already
594 release-MODULES := myplc
595 release-SPEC := myplc-release.spec
596 release-RPMDATE := yes
597 ALL += release
598
599 ##############################
600 #
601 # sfa - Slice Facility Architecture
602 #
603 sfa-MODULES := sfa
604 sfa-SPEC := sfa.spec
605 ALL += sfa