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