- make sure yum-arch gets called before the packages that need it
[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.1 2006/03/08 21:45:17 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 #
35 # kernel
36 #
37
38 kernel-MODULE := linux-2.6
39 kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
40 ALL += kernel
41
42 #
43 # vnet
44 #
45
46 vnet-MODULE := vnet
47 vnet-SPEC := vnet/vnet.spec
48 ALL += vnet
49
50 # Build kernel first so we can bootstrap off of its build
51 vnet: kernel
52
53 #
54 # util-vserver
55 #
56
57 util-vserver-MODULE := util-vserver
58 util-vserver-SPEC := util-vserver/util-vserver.spec
59 ALL += util-vserver
60
61 #
62 # lkcdutils
63 #
64
65 lkcdutils-MODULE := lkcdutils
66 lkcdutils-SPEC := lkcdutils/spec/lkcdutils.spec
67 ALL += lkcdutils
68
69 # Build kernel first so we can bootstrap off of its build
70 lkcdutils: kernel
71
72 #
73 # yum
74 #
75
76 yum-MODULE := yum
77 yum-SPEC := yum/yum.spec
78 ALL += yum
79
80 #
81 # ksymoops
82 #
83
84 ksymoops-MODULE := ksymoops
85 ksymoops-SPEC := ksymoops/ksymoops.spec
86 ALL += ksymoops
87
88 #
89 # PlanetLabAccounts
90 #
91
92 PlanetLabAccounts-MODULE := PlanetLabAccounts
93 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
94 ALL += PlanetLabAccounts
95
96 #
97 # NodeUpdate
98 #
99
100 NodeUpdate-MODULE := NodeUpdate
101 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
102 ALL += NodeUpdate
103
104 #
105 # PlanetLabConf
106 #
107
108 PlanetLabConf-MODULE := PlanetLabConf
109 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
110 ALL += PlanetLabConf
111
112 #
113 # PlanetLabKeys
114 #
115
116 PlanetLabKeys-MODULE := PlanetLabKeys
117 PlanetLabKeys-SPEC := PlanetLabKeys/PlanetLabKeys.spec
118 ALL += PlanetLabKeys
119
120 #
121 # ipod
122 #
123
124 ipod-MODULE := ipod
125 ipod-SPEC := ipod/ipod.spec
126 ALL += ipod
127
128 #
129 # sudo
130 #
131
132 sudo-MODULE := sudo
133 sudo-SPEC := sudo/planetlab_sudo.spec
134 ALL += sudo
135
136 #
137 # pycurl
138 #
139
140 pycurl-MODULE := pycurl
141 pycurl-SPEC := pycurl/pycurl.spec
142 ALL += pycurl
143
144 #
145 # BootServerRequest
146 #
147
148 BootServerRequest-MODULE := BootServerRequest
149 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
150 ALL += BootServerRequest
151
152 #
153 # PlanetLabID
154 #
155
156 PlanetLabID-MODULE := PlanetLabID
157 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
158 ALL += PlanetLabID
159
160 #
161 # Node Manager
162 #
163
164 sidewinder-MODULE := sidewinder
165 sidewinder-SPEC := sidewinder/sidewinder.spec
166 ALL += sidewinder
167
168 #
169 # pl_sshd
170 #
171
172 pl_sshd-MODULE := pl_sshd
173 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
174 ALL += pl_sshd
175
176 #
177 # Resource Management Tools
178 #
179
180 resman-MODULE := resman
181 resman-SPEC := resman/resman.spec
182 ALL += resman
183
184 #
185 # libhttpd++: 
186 #
187
188 libhttpd++-MODULE := libhttpd++
189 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
190 ALL += libhttpd++
191
192 #
193 # Proper: Privileged Operations Service
194 #
195
196 proper-MODULE := proper
197 proper-SPEC := proper/proper.spec
198 ALL += proper
199
200 proper: libhttpd++
201
202 #
203 # ulogd
204 #
205
206 ulogd-MODULE := ulogd
207 ulogd-SPEC := ulogd/ulogd.spec
208 ALL += ulogd
209
210 ulogd: kernel proper
211
212 #
213 # netflow
214 #
215
216 netflow-MODULE := netflow
217 netflow-SPEC := netflow/netflow.spec
218 ALL += netflow
219
220 #
221 # PlanetLab Mom: Cleans up your mess
222 #
223
224 pl_mom-MODULE := pl_mom
225 pl_mom-SPEC := pl_mom/pl_mom.spec
226 ALL += pl_mom
227
228 #
229 # iptables
230 #
231
232 iptables-MODULE := iptables
233 iptables-SPEC := iptables/iptables.spec
234 ALL += iptables
235
236 iptables: kernel
237
238 #
239 # iproute
240 #
241
242 iproute-MODULE := iproute2
243 iproute-SPEC := iproute2/iproute.spec
244 ALL += iproute
245
246 #
247 # kexec-tools
248 #
249
250 kexec-tools-MODULE := kexec-tools
251 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
252 ALL += kexec-tools
253
254 #
255 # dhcp
256 #
257
258 dhcp-MODULE := dhcp
259 dhcp-SPEC := dhcp/dhcp.spec
260 ALL += dhcp
261
262 #
263 # util-python
264 #
265
266 util-python-MODULE := util-python
267 util-python-SPEC := util-python/util-python.spec
268 ALL += util-python
269
270 # proper and util-vserver both use scripts in util-python for building
271 proper: util-python
272 util-vserver: util-python
273
274 #
275 # vserver-reference
276 #
277
278 vserver-reference-MODULE := vserver-reference
279 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
280 # Package must be built as root
281 vserver-reference-RPMBUILD := sudo rpmbuild
282 ALL += vserver-reference
283
284 # vserver-reference may require current packages
285 vserver-reference: $(filter-out vserver-reference,$(ALL))
286
287 # ...and the yum manifest
288 vserver-reference: yum
289
290 #
291 # bootmanager
292 #
293
294 bootmanager-MODULE := bootmanager
295 bootmanager-SPEC := bootmanager/bootmanager.spec
296 bootmanager-RPMBUILD := sudo rpmbuild
297 ALL += bootmanager
298
299 # bootmanager requires current packages
300 bootmanager: $(filter-out bootmanager,$(ALL))
301
302 # ...and the yum manifest
303 bootmanager: yum
304
305 #
306 # bootcd
307 #
308
309 bootcd-MODULE := bootcd_v3
310 bootcd-SPEC := bootcd_v3/bootcd.spec
311 bootcd-RPMBUILD := sudo rpmbuild
312 ALL += bootcd
313
314 # bootcd requires current packages
315 bootcd: $(filter-out bootcd,$(ALL))
316
317 # ...and the yum manifest
318 bootcd: yum
319
320 #
321 # Installation rules
322
323
324 # Upload packages to boot server
325 SERVER := build@boot.planet-lab.org
326 ARCHIVE := /var/www/html/install-rpms/archive
327
328 # Put nightly alpha builds in a subdirectory
329 ifeq ($(TAG),HEAD)
330 ARCHIVE := $(ARCHIVE)/planetlab-alpha
331 REPOS := /var/www/html/install-rpms/planetlab-alpha
332 endif
333
334 RPMS/yumgroups.xml:
335         install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
336
337 yum: RPMS/yumgroups.xml
338         yum-arch RPMS
339
340 install:
341 ifeq ($(BASE),)
342         @echo make install is only meant to be called from ./build.sh
343 else
344 ifneq ($(BUILDS),)
345         # Remove old runs
346         echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
347 endif
348         # Create package manifest
349         sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/SRPMS" SRPMS > SRPMS/packages.xml
350         # Populate repository
351         ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)
352         rsync --delete --links --perms --times --group --compress --rsh=ssh \
353             --exclude "*-debuginfo-*.rpm" RPMS SRPMS $(SERVER):$(ARCHIVE)/$(BASE)/
354         ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
355         ssh $(SERVER) createrepo $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
356 ifeq ($(TAG),HEAD)
357         # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
358         if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
359             ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \
360         fi
361 endif
362 endif
363
364 .PHONY: yum install