Build both i586 and i686 kernels.
[build.git] / planetlab.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.38 2006/12/20 04:43:19 mef 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-i686-MODULE := linux-2.6
53 kernel-i686-RPMFLAGS:= --target i686
54 kernel-i686-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
55 ALL += kernel-i686
56
57 kernel-i586-MODULE := linux-2.6
58 kernel-i586-RPMFLAGS:= --target i586
59 kernel-i586-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
60 ALL += kernel-i586
61
62 kernel: kernel-i586 kernel-i686
63
64 #
65 # vnet
66 #
67
68 vnet-MODULE := vnet
69 vnet-SPEC := vnet/vnet.spec
70 ALL += vnet
71
72 # Build kernel first so we can bootstrap off of its build
73 vnet: kernel
74
75 #
76 # madwifi
77 #
78
79 madwifi-ng-MODULE := madwifi-ng
80 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
81 ALL += madwifi-ng
82
83 #
84 # ivtv 
85 #
86
87 #ivtv-MODULE := ivtv
88 #ivtv-SPEC := ivtv/ivtv.spec
89 #ALL += ivtv
90
91 #
92 # util-vserver
93 #
94
95 util-vserver-MODULE := util-vserver
96 util-vserver-SPEC := util-vserver/util-vserver.spec
97 ALL += util-vserver
98
99 #
100 # yum
101 #
102
103 yum-MODULE := yum
104 yum-SPEC := yum/yum.spec
105 ALL += yum
106
107 #
108 # PlanetLabAccounts
109 #
110
111 PlanetLabAccounts-MODULE := PlanetLabAccounts
112 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
113 ALL += PlanetLabAccounts
114
115 #
116 # NodeUpdate
117 #
118
119 NodeUpdate-MODULE := NodeUpdate
120 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
121 ALL += NodeUpdate
122
123 #
124 # PlanetLabConf
125 #
126
127 PlanetLabConf-MODULE := PlanetLabConf
128 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
129 ALL += PlanetLabConf
130
131 #
132 # ipod
133 #
134
135 ipod-MODULE := ipod
136 ipod-SPEC := ipod/ipod.spec
137 ALL += ipod
138
139 #
140 # sudo
141 #
142
143 sudo-MODULE := sudo
144 sudo-SPEC := sudo/planetlab_sudo.spec
145 ALL += sudo
146
147 #
148 # pycurl
149 #
150
151 pycurl-MODULE := pycurl
152 pycurl-SPEC := pycurl/pycurl.spec
153 ALL += pycurl
154
155 #
156 # BootServerRequest
157 #
158
159 BootServerRequest-MODULE := BootServerRequest
160 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
161 ALL += BootServerRequest
162
163 #
164 # PlanetLabID
165 #
166
167 PlanetLabID-MODULE := PlanetLabID
168 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
169 ALL += PlanetLabID
170
171 #
172 # Node Manager
173 #
174
175 NodeManager-MODULE := NodeManager
176 NodeManager-SPEC := NodeManager/NodeManager.spec
177 ALL += NodeManager
178
179 #
180 # pl_sshd
181 #
182
183 pl_sshd-MODULE := pl_sshd
184 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
185 ALL += pl_sshd
186
187 #
188 # libhttpd++: 
189 #
190
191 libhttpd++-MODULE := libhttpd++
192 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
193 ALL += libhttpd++
194
195 #
196 # Proper: Privileged Operations Service
197 #
198
199 proper-MODULE := proper
200 proper-SPEC := proper/proper.spec
201 ALL += proper
202
203 proper: libhttpd++
204
205 #
206 # MySQL
207 #
208
209 mysql-MODULE := mysql
210 mysql-SPEC := mysql/mysql.spec
211 ALL += mysql
212
213 #
214 # ulogd
215 #
216
217 ulogd-MODULE := ulogd
218 ulogd-SPEC := ulogd/ulogd.spec
219 ALL += ulogd
220
221 ulogd: kernel proper mysql
222
223 #
224 # netflow
225 #
226
227 netflow-MODULE := netflow
228 netflow-SPEC := netflow/netflow.spec
229 ALL += netflow
230
231 netflow: mysql
232
233 #
234 # PlanetLab Mom: Cleans up your mess
235 #
236
237 pl_mom-MODULE := pl_mom
238 pl_mom-SPEC := pl_mom/pl_mom.spec
239 ALL += pl_mom
240
241 #
242 # iptables
243 #
244
245 iptables-MODULE := iptables
246 iptables-SPEC := iptables/iptables.spec
247 ALL += iptables
248
249 iptables: kernel
250
251 #
252 # iproute
253 #
254
255 iproute-MODULE := iproute2
256 iproute-SPEC := iproute2/iproute.spec
257 ALL += iproute
258
259 #
260 # kexec-tools
261 #
262
263 kexec-tools-MODULE := kexec-tools
264 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
265 ALL += kexec-tools
266
267 #
268 # dhcp
269 #
270
271 dhcp-MODULE := dhcp
272 dhcp-SPEC := dhcp/dhcp.spec
273 ALL += dhcp
274
275 #
276 # util-python
277 #
278
279 util-python-MODULE := util-python
280 util-python-SPEC := util-python/util-python.spec
281 ALL += util-python
282
283 # proper and util-vserver both use scripts in util-python for building
284 proper: util-python
285 util-vserver: util-python
286 PlanetLabAuth: util-python
287
288 #
289 # PlanetLabAuth
290 #
291
292 PlanetLabAuth-MODULE := pl_auth
293 PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
294 ALL += PlanetLabAuth
295
296 #
297 # plcapilib
298 #
299
300 plcapilib-MODULE := plcmdline
301 plcapilib-SPEC := plcmdline/plcapilib.spec
302 ALL += plcapilib
303
304 #
305 # PLCAPI
306 #
307
308 PLCAPI-MODULE := new_plc_api
309 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
310 ALL += PLCAPI
311
312 #
313 # vserver-reference
314 #
315
316 vserver-reference-MODULE := vserver-reference build
317 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
318 # Package must be built as root
319 vserver-reference-RPMBUILD := sudo rpmbuild
320 ALL += vserver-reference
321
322 # vserver-reference may require current packages
323 vserver-reference: $(filter-out vserver-reference,$(ALL))
324
325 #
326 # bootmanager
327 #
328
329 bootmanager-MODULE := bootmanager build
330 bootmanager-SPEC := bootmanager/bootmanager.spec
331 bootmanager-RPMBUILD := sudo rpmbuild
332 ALL += bootmanager
333
334 # bootmanager requires current packages
335 bootmanager: $(filter-out bootmanager,$(ALL))
336
337 # ...and the yum manifest
338 bootmanager: RPMS/yumgroups.xml
339
340 #
341 # bootcd
342 #
343
344 bootcd-MODULE := bootcd build bootmanager
345 bootcd-SPEC := bootcd/bootcd.spec
346 bootcd-RPMBUILD := sudo rpmbuild
347 ALL += bootcd
348
349 # bootcd requires current packages
350 bootcd: $(filter-out bootcd,$(ALL))
351
352 #
353 # MyPLC
354 #
355
356 myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
357 myplc-SPEC := myplc/myplc.spec
358 # Package must be built as root
359 myplc-RPMBUILD := sudo rpmbuild
360 ALL += myplc
361
362 # MyPLC may require current packages
363 myplc: $(filter-out myplc,$(ALL))
364
365 # ...and the yum manifest
366 myplc: RPMS/yumgroups.xml
367
368 #
369 # Installation rules
370
371
372 # Upload packages to boot server
373 SERVER := build@boot.planet-lab.org
374 ARCHIVE := /var/www/html/install-rpms/archive
375
376 # Put nightly alpha builds in a subdirectory
377 ifeq ($(TAG),HEAD)
378 ARCHIVE := $(ARCHIVE)/planetlab-alpha
379 REPOS := /var/www/html/install-rpms/planetlab-alpha
380 endif
381
382 RPMS/yumgroups.xml:
383         install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
384
385 install:
386 ifeq ($(BASE),)
387         @echo make install is only meant to be called from ./build.sh
388 else
389 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
390         # Sign all RPMS. setsid detaches rpm from the terminal,
391         # allowing the (hopefully blank) GPG password to be entered
392         # from stdin instead of /dev/tty. Obviously, the build server
393         # should be secure.
394         echo | setsid rpm \
395         --define "_signature gpg" \
396         --define "_gpg_path /etc/planetlab" \
397         --define "_gpg_name PlanetLab <info@planet-lab.org>" \
398         --resign RPMS/*/*.rpm SRPMS/*.rpm
399 endif
400 ifneq ($(BUILDS),)
401         # Remove old runs
402         echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
403 endif
404         # Create package manifest
405         sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
406         # Populate repository
407         ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
408         rsync --delete --links --perms --times --group --compress --rsh=ssh \
409             $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*.rpm))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
410         ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
411         ssh $(SERVER) createrepo -g yumgroups.xml $(ARCHIVE)/$(BASE)/RPMS >/dev/null
412         rsync --delete --links --perms --times --group --compress --rsh=ssh \
413             $(wildcard SRPMS/*.rpm) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
414         ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
415         ssh $(SERVER) createrepo $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
416 ifeq ($(TAG),HEAD)
417         # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
418         if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
419             ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \
420         fi
421 endif
422 endif
423
424 .PHONY: install