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