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