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