creation
[build.git] / onelab.mk
1 #
2 # PlanetLab standard components list
3 #
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2006 The Trustees of Princeton University
6 #
7 # $Id: planetlab.mk,v 1.45 2007/01/20 04:09:20 mlhuang Exp $
8 #
9
10 #
11 # Required:
12 #
13 # CVSROOT or package-CVSROOT: CVSROOT to use
14 # TAG or package-TAG: CVS tag to use
15 # package-MODULE: CVS module name to use
16 # package-SPEC: RPM spec file template
17 #
18 # Optional:
19 #
20 # package-RPMFLAGS: Miscellaneous RPM flags
21 # package-RPMBUILD: If not rpmbuild
22 # package-CVS_RSH: If not ssh
23 #
24 # Add to ALL if you want the package built as part of the default set.
25 #
26
27 #
28 # Default values
29 #
30
31 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
32 TAG := HEAD
33
34 # Check if a tag has been checked out
35 ifneq ($(wildcard CVS/Root),)
36 # Check if we are able to access CVS
37 CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
38 ifneq ($(CVSTAG),)
39 CVSROOT := $(shell cat CVS/Root)
40 ifeq ($(CVSTAG),(none))
41 TAG := HEAD
42 else
43 TAG := $(CVSTAG)
44 endif
45 endif
46 endif
47
48 #
49 # kernel
50 #
51
52 #kernel-x86_64-MODULE := linux-2.6
53 #kernel-x86_64-RPMFLAGS:= --target x86_64
54 #kernel-x86_64-SPEC := linux-2.6/scripts/kernel-2.6-$(PLDISTRO).spec
55 ##ALL += kernel-x86_64
56
57 kernel-i686-MODULE := linux-2.6
58 kernel-i686-RPMFLAGS:= --target i686
59 kernel-i686-SPEC := linux-2.6/scripts/kernel-2.6-$(PLDISTRO).spec
60 ALL += kernel-i686
61
62 #kernel-i586-MODULE := linux-2.6
63 #kernel-i586-RPMFLAGS:= --target i586
64 #kernel-i586-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
65 #ALL += kernel-i586
66
67 #kernel: kernel-i586 kernel-i686
68 #kernel-clean: kernel-i586-clean kernel-i686-clean
69 kernel: kernel-i686
70 kernel-clean: kernel-i686-clean
71
72 #
73 # vnet
74 #
75
76 vnet-MODULE := vnet
77 vnet-SPEC := vnet/vnet.spec
78 ALL += vnet
79
80 # Build kernel first so we can bootstrap off of its build
81 vnet: kernel
82
83 #
84 # madwifi
85 #
86
87 madwifi-ng-MODULE := madwifi-ng
88 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
89 ALL += madwifi-ng
90
91 # Build kernel first so we can bootstrap off of its build
92 madwifi-ng: kernel
93
94 #
95 # ivtv 
96 #
97
98 #ivtv-MODULE := ivtv
99 #ivtv-SPEC := ivtv/ivtv.spec
100 #ALL += ivtv
101
102 #
103 # util-vserver
104 #
105
106 util-vserver-MODULE := util-vserver
107 util-vserver-SPEC := util-vserver/util-vserver.spec
108 util-vserver-RPMFLAGS:= --without dietlibc
109 ALL += util-vserver
110
111 #
112 # yum
113 #
114
115 yum-MODULE := yum
116 yum-SPEC := yum/yum.spec
117 ALL += yum
118
119 #
120 # PlanetLabAccounts
121 #
122
123 PlanetLabAccounts-MODULE := PlanetLabAccounts
124 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
125 ALL += PlanetLabAccounts
126
127 #
128 # NodeUpdate
129 #
130
131 NodeUpdate-MODULE := NodeUpdate
132 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
133 ALL += NodeUpdate
134
135 #
136 # PlanetLabConf
137 #
138
139 PlanetLabConf-MODULE := PlanetLabConf
140 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
141 ALL += PlanetLabConf
142
143 #
144 # ipod
145 #
146
147 ipod-MODULE := ipod
148 ipod-SPEC := ipod/ipod.spec
149 ALL += ipod
150
151 #
152 # sudo
153 #
154
155 sudo-MODULE := sudo
156 sudo-SPEC := sudo/planetlab_sudo.spec
157 ALL += sudo
158
159 #
160 # pycurl
161 #
162
163 pycurl-MODULE := pycurl
164 pycurl-SPEC := pycurl/pycurl.spec
165 ALL += pycurl
166
167 #
168 # BootServerRequest
169 #
170
171 BootServerRequest-MODULE := BootServerRequest
172 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
173 ALL += BootServerRequest
174
175 #
176 # PlanetLabID
177 #
178
179 PlanetLabID-MODULE := PlanetLabID
180 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
181 ALL += PlanetLabID
182
183 #
184 # Node Manager
185 #
186
187 NodeManager-MODULE := NodeManager
188 NodeManager-SPEC := NodeManager/NodeManager.spec
189 ALL += NodeManager
190
191 #
192 # pl_sshd
193 #
194
195 pl_sshd-MODULE := pl_sshd
196 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
197 ALL += pl_sshd
198
199 #
200 # libhttpd++: 
201 #
202
203 libhttpd++-MODULE := libhttpd++
204 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
205 ALL += libhttpd++
206
207 #
208 # Proper: Privileged Operations Service
209 #
210
211 proper-MODULE := proper
212 proper-SPEC := proper/proper.spec
213 ALL += proper
214
215 proper: libhttpd++
216
217 #
218 # MySQL
219 #
220
221 mysql-MODULE := mysql
222 mysql-SPEC := mysql/mysql.spec
223 ALL += mysql
224
225 #
226 # ulogd
227 #
228
229 ulogd-MODULE := ulogd
230 ulogd-SPEC := ulogd/ulogd.spec
231 ALL += ulogd
232
233 ulogd: kernel proper mysql
234
235 #
236 # netflow
237 #
238
239 netflow-MODULE := netflow
240 netflow-SPEC := netflow/netflow.spec
241 ALL += netflow
242
243 netflow: mysql
244
245 #
246 # PlanetLab Mom: Cleans up your mess
247 #
248
249 pl_mom-MODULE := pl_mom
250 pl_mom-SPEC := pl_mom/pl_mom.spec
251 ALL += pl_mom
252
253 #
254 # iptables
255 #
256
257 iptables-MODULE := iptables
258 iptables-SPEC := iptables/iptables.spec
259 ALL += iptables
260
261 iptables: kernel
262
263 #
264 # iproute
265 #
266
267 iproute-MODULE := iproute2
268 iproute-SPEC := iproute2/iproute.spec
269 ALL += iproute
270
271 #
272 # kexec-tools
273 #
274
275 kexec-tools-MODULE := kexec-tools
276 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
277 ALL += kexec-tools
278
279 #
280 # dhcp
281 #
282
283 dhcp-MODULE := dhcp
284 dhcp-SPEC := dhcp/dhcp.spec
285 ALL += dhcp
286
287 #
288 # util-python
289 #
290
291 util-python-MODULE := util-python
292 util-python-SPEC := util-python/util-python.spec
293 ALL += util-python
294
295 # proper and util-vserver both use scripts in util-python for building
296 proper: util-python
297 util-vserver: util-python
298 PlanetLabAuth: util-python
299
300 #
301 # PlanetLabAuth
302 #
303
304 PlanetLabAuth-MODULE := pl_auth
305 PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
306 ALL += PlanetLabAuth
307
308 #
309 # plcapilib
310 #
311
312 plcapilib-MODULE := plcmdline
313 plcapilib-SPEC := plcmdline/plcapilib.spec
314 ALL += plcapilib
315
316 #
317 # PLCAPI
318 #
319
320 PLCAPI-MODULE := new_plc_api
321 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
322 ALL += PLCAPI
323
324 #
325 # vserver-reference
326 #
327
328 vserver-reference-MODULE := vserver-reference build
329 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
330 # Package must be built as root
331 vserver-reference-RPMBUILD := sudo rpmbuild
332 ALL += vserver-reference
333
334 # vserver-reference may require current packages
335 vserver-reference: $(filter-out vserver-reference,$(ALL))
336
337 #
338 # bootmanager
339 #
340
341 bootmanager-MODULE := bootmanager build
342 bootmanager-SPEC := bootmanager/bootmanager.spec
343 bootmanager-RPMBUILD := sudo rpmbuild
344 ALL += bootmanager
345
346 # bootmanager requires current packages
347 bootmanager: $(filter-out bootmanager,$(ALL))
348
349 # ...and the yum manifest
350 bootmanager: RPMS/yumgroups.xml
351
352 #
353 # bootcd
354 #
355
356 bootcd-MODULE := bootcd build bootmanager
357 bootcd-SPEC := bootcd/bootcd.spec
358 bootcd-RPMBUILD := sudo rpmbuild
359 ALL += bootcd
360
361 # bootcd requires current packages
362 bootcd: $(filter-out bootcd,$(ALL))
363
364 #
365 # MyPLC
366 #
367
368 myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
369 myplc-SPEC := myplc/myplc.spec
370 # Package must be built as root
371 myplc-RPMBUILD := sudo rpmbuild
372 ALL += myplc
373
374 # MyPLC may require current packages
375 myplc: $(filter-out myplc,$(ALL))
376
377 # ...and the yum manifest
378 myplc: RPMS/yumgroups.xml
379
380 #
381 # MyPLC development environment
382 #
383
384 ###myplc-devel-MODULE := build myplc
385 ###myplc-devel-SPEC := myplc/myplc-devel.spec
386 #### Package must be built as root
387 ###myplc-devel-RPMBUILD := sudo rpmbuild
388 ###ALL += myplc-devel
389
390 #
391 # Installation rules
392
393
394 # Upload packages to boot server
395 SERVER          := root@onelab-plc.inria.fr
396 ARCHIVE         := /plc/var/www/html/install-rpms/
397 BOOT_AREA       := /plc/data/var/www/html/boot/
398
399 YUMGROUPS       := $(PLDISTRO).xml
400 #BASE           := onelab
401 BASETMP         := planetlab-upgrading
402 BASEBAK         := planetlab-bak
403 BASE            := planetlab
404
405 RPMS/yumgroups.xml:
406         install -D -m 644 $(YUMGROUPS) RPMS/yumgroups.xml
407
408 install: install-rpms install-index install-bootstrap
409
410 install-rpms:RPMS/yumgroups.xml
411         # create repository
412         ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASETMP)
413         # populate
414         rsync -v --perms --times --group --compress --rsh=ssh \
415            RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(SERVER):$(ARCHIVE)/$(BASETMP)/
416
417 # would be better if we could run plc.d/packages on a temporary dir
418 # currently while we run packages clients wont be able to use the repo (nor signed nor indexed)
419 install-index:
420         # cleanup former bak
421         ssh $(SERVER) rm -rf $(ARCHIVE)/$(BASEBAK)
422         # bak previous repo
423         ssh $(SERVER) mv $(ARCHIVE)/$(BASE) $(ARCHIVE)/$(BASEBAK)
424         # install new repo
425         ssh $(SERVER) mv $(ARCHIVE)/$(BASETMP) $(ARCHIVE)/$(BASE)
426         # sign and re-index
427         ssh $(SERVER) chroot /plc/root service plc start packages
428
429 install-bootstrap:
430         # install node image
431         install_bz2=$(wildcard BUILD/bootmanager-*/bootmanager/support-files/PlanetLab-Bootstrap.tar.bz2) ; \
432           if [ -n "$$install_bz2" ] ; then rsync $$install_bz2 $(SERVER):$(BOOT_AREA) ; fi
433 #endif
434
435 .PHONY: install