- don't bother signing or uploading SRPMS
[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.47 2007/02/08 00:23:45 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-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 # MySQL
209 #
210
211 mysql-MODULE := mysql
212 mysql-SPEC := mysql/mysql.spec
213 ALL += mysql
214
215 #
216 # ulogd
217 #
218
219 ulogd-MODULE := ulogd
220 ulogd-SPEC := ulogd/ulogd.spec
221 ALL += ulogd
222
223 ulogd: kernel proper mysql
224
225 #
226 # netflow
227 #
228
229 netflow-MODULE := netflow
230 netflow-SPEC := netflow/netflow.spec
231 ALL += netflow
232
233 netflow: mysql
234
235 #
236 # PlanetLab Mom: Cleans up your mess
237 #
238
239 pl_mom-MODULE := pl_mom
240 pl_mom-SPEC := pl_mom/pl_mom.spec
241 ALL += pl_mom
242
243 #
244 # iptables
245 #
246
247 iptables-MODULE := iptables
248 iptables-SPEC := iptables/iptables.spec
249 ALL += iptables
250
251 iptables: kernel
252
253 #
254 # iproute
255 #
256
257 iproute-MODULE := iproute2
258 iproute-SPEC := iproute2/iproute.spec
259 ALL += iproute
260
261 #
262 # kexec-tools
263 #
264
265 kexec-tools-MODULE := kexec-tools
266 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
267 ALL += kexec-tools
268
269 #
270 # util-python
271 #
272
273 util-python-MODULE := util-python
274 util-python-SPEC := util-python/util-python.spec
275 ALL += util-python
276
277 # proper and util-vserver both use scripts in util-python for building
278 proper: util-python
279 util-vserver: util-python
280 PlanetLabAuth: util-python
281
282 #
283 # PLCAPI
284 #
285
286 PLCAPI-MODULE := new_plc_api
287 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
288 ALL += PLCAPI
289
290 #
291 # vserver-reference
292 #
293
294 vserver-reference-MODULE := vserver-reference build
295 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
296 # Package must be built as root
297 vserver-reference-RPMBUILD := sudo rpmbuild
298 ALL += vserver-reference
299
300 # vserver-reference may require current packages
301 vserver-reference: $(filter-out vserver-reference,$(ALL))
302
303 #
304 # bootmanager
305 #
306
307 bootmanager-MODULE := bootmanager build
308 bootmanager-SPEC := bootmanager/bootmanager.spec
309 bootmanager-RPMBUILD := sudo rpmbuild
310 ALL += bootmanager
311
312 # bootmanager requires current packages
313 bootmanager: $(filter-out bootmanager,$(ALL))
314
315 # ...and the yum manifest
316 bootmanager: RPMS/yumgroups.xml
317
318 #
319 # bootcd
320 #
321
322 bootcd-MODULE := bootcd build bootmanager
323 bootcd-SPEC := bootcd/bootcd.spec
324 bootcd-RPMBUILD := sudo rpmbuild
325 ALL += bootcd
326
327 # bootcd requires current packages
328 bootcd: $(filter-out bootcd,$(ALL))
329
330 #
331 # MyPLC
332 #
333
334 myplc-MODULE := build myplc new_plc_www plc/scripts
335 myplc-SPEC := myplc/myplc.spec
336 # Package must be built as root
337 myplc-RPMBUILD := sudo rpmbuild
338 ALL += myplc
339
340 # MyPLC may require current packages
341 myplc: $(filter-out myplc,$(ALL))
342
343 # ...and the yum manifest
344 myplc: RPMS/yumgroups.xml
345
346 #
347 # MyPLC development environment
348 #
349
350 myplc-devel-MODULE := build myplc
351 myplc-devel-SPEC := myplc/myplc-devel.spec
352 # Package must be built as root
353 myplc-devel-RPMBUILD := sudo rpmbuild
354 ALL += myplc-devel
355
356 #
357 # Installation rules
358
359
360 # Upload packages to boot server
361 SERVER := build@boot.planet-lab.org
362 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
363
364 # Put nightly alpha builds in a subdirectory
365 ifeq ($(TAG),HEAD)
366 ARCHIVE := $(ARCHIVE)/planetlab-alpha
367 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
368 endif
369
370 RPMS/yumgroups.xml:
371         install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
372
373 install:
374 ifeq ($(BASE),)
375         @echo make install is only meant to be called from ./build.sh
376 else
377 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
378         # Sign all RPMS. setsid detaches rpm from the terminal,
379         # allowing the (hopefully blank) GPG password to be entered
380         # from stdin instead of /dev/tty. Obviously, the build server
381         # should be secure.
382         echo | setsid rpm \
383         --define "_signature gpg" \
384         --define "_gpg_path /etc/planetlab" \
385         --define "_gpg_name PlanetLab <info@planet-lab.org>" \
386         --resign RPMS/*/*.rpm
387 endif
388 ifneq ($(BUILDS),)
389         # Remove old runs
390         echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
391 endif
392         # Create package manifest
393         sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
394         # Update yum metadata
395         yum-arch RPMS >/dev/null
396         createrepo -g yumgroups.xml RPMS >/dev/null
397         # Populate repository
398         rsync \
399         --exclude '*-debuginfo-*' \
400         --recursive --links --perms --times --group --compress --rsh=ssh \
401         RPMS $(SERVER):$(ARCHIVE)/$(BASE)
402 ifeq ($(TAG),HEAD)
403         # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
404         if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
405             ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE) $(REPOS) ; \
406         fi
407 endif
408 endif
409
410 .PHONY: install