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