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