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