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