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