fetches yumgroups.xml according to PLDISTRO
[build.git] / onelab.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: onelab.mk,v 1.7 2007/02/09 01:16:19 thierry 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-$(PLDISTRO).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-$(PLDISTRO).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 kernel: kernel-i686
70 kernel-clean: kernel-i686-clean
71
72 #
73 # vnet
74 #
75
76 vnet-MODULE := vnet
77 vnet-SPEC := vnet/vnet.spec
78 ALL += vnet
79
80 # Build kernel first so we can bootstrap off of its build
81 vnet: kernel
82
83 #
84 # madwifi
85 #
86
87 madwifi-ng-MODULE := madwifi-ng
88 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
89 ALL += madwifi-ng
90
91 # Build kernel first so we can bootstrap off of its build
92 madwifi-ng: kernel
93
94
95 # wireless-tools
96
97
98 wireless-tools-MODULE = wireless-tools
99 wireless-tools-SPEC := wireless-tools.spec
100 wireless-tools-SVNPATH := file:///svn/wireless-tools/29pre10
101 ALL += wireless-tools
102
103 #
104 # ivtv 
105 #
106
107 #ivtv-MODULE := ivtv
108 #ivtv-SPEC := ivtv/ivtv.spec
109 #ALL += ivtv
110
111 #
112 # util-vserver
113 #
114
115 util-vserver-MODULE := util-vserver
116 util-vserver-SPEC := util-vserver/util-vserver.spec
117 util-vserver-RPMFLAGS:= --without dietlibc
118 ALL += util-vserver
119
120 #
121 # PlanetLabAccounts
122 #
123
124 PlanetLabAccounts-MODULE := PlanetLabAccounts
125 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
126 ALL += PlanetLabAccounts
127
128 #
129 # NodeUpdate
130 #
131
132 NodeUpdate-MODULE := NodeUpdate
133 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
134 ALL += NodeUpdate
135
136 #
137 # PlanetLabConf
138 #
139
140 PlanetLabConf-MODULE := PlanetLabConf
141 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
142 ALL += PlanetLabConf
143
144 #
145 # ipod
146 #
147
148 ipod-MODULE := ipod
149 ipod-SPEC := ipod/ipod.spec
150 ALL += ipod
151
152 #
153 # sudo
154 #
155
156 sudo-MODULE := sudo
157 sudo-SPEC := sudo/planetlab_sudo.spec
158 ALL += sudo
159
160 #
161 # pycurl
162 #
163
164 pycurl-MODULE := pycurl
165 pycurl-SPEC := pycurl/pycurl.spec
166 ALL += pycurl
167
168 #
169 # BootServerRequest
170 #
171
172 BootServerRequest-MODULE := BootServerRequest
173 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
174 ALL += BootServerRequest
175
176 #
177 # PlanetLabID
178 #
179
180 PlanetLabID-MODULE := PlanetLabID
181 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
182 ALL += PlanetLabID
183
184 #
185 # Node Manager
186 #
187
188 NodeManager-MODULE := NodeManager
189 NodeManager-SPEC := NodeManager/NodeManager.spec
190 ALL += NodeManager
191
192 #
193 # pl_sshd
194 #
195
196 pl_sshd-MODULE := pl_sshd
197 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
198 ALL += pl_sshd
199
200 #
201 # libhttpd++: 
202 #
203
204 libhttpd++-MODULE := libhttpd++
205 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
206 ALL += libhttpd++
207
208 #
209 # Proper: Privileged Operations Service
210 #
211
212 proper-MODULE := proper
213 proper-SPEC := proper/proper.spec
214 ALL += proper
215
216 proper: libhttpd++
217
218 #
219 # MySQL
220 #
221
222 mysql-MODULE := mysql
223 mysql-SPEC := mysql/mysql.spec
224 ALL += mysql
225
226 #
227 # ulogd
228 #
229
230 ulogd-MODULE := ulogd
231 ulogd-SPEC := ulogd/ulogd.spec
232 ALL += ulogd
233
234 ulogd: kernel proper mysql
235
236 #
237 # netflow
238 #
239
240 netflow-MODULE := netflow
241 netflow-SPEC := netflow/netflow.spec
242 ALL += netflow
243
244 netflow: mysql
245
246 #
247 # PlanetLab Mom: Cleans up your mess
248 #
249
250 pl_mom-MODULE := pl_mom
251 pl_mom-SPEC := pl_mom/pl_mom.spec
252 ALL += pl_mom
253
254 #
255 # iptables
256 #
257
258 iptables-MODULE := iptables
259 iptables-SPEC := iptables/iptables.spec
260 ALL += iptables
261
262 iptables: kernel
263
264 #
265 # iproute
266 #
267
268 iproute-MODULE := iproute2
269 iproute-SPEC := iproute2/iproute.spec
270 ALL += iproute
271
272 #
273 # kexec-tools
274 #
275
276 kexec-tools-MODULE := kexec-tools
277 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
278 ALL += kexec-tools
279
280 #
281 # util-python
282 #
283
284 util-python-MODULE := util-python
285 util-python-SPEC := util-python/util-python.spec
286 ALL += util-python
287
288 # proper and util-vserver both use scripts in util-python for building
289 proper: util-python
290 util-vserver: util-python
291 PlanetLabAuth: util-python
292
293 #
294 # PLCAPI
295 #
296
297 PLCAPI-MODULE := new_plc_api
298 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
299 ALL += PLCAPI
300
301 #
302 # vserver-reference
303 #
304
305 vserver-reference-MODULE := vserver-reference build
306 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
307 # Package must be built as root
308 vserver-reference-RPMBUILD := sudo rpmbuild
309 ALL += vserver-reference
310
311 # vserver-reference may require current packages
312 vserver-reference: $(filter-out vserver-reference,$(ALL))
313
314 #
315 # bootmanager
316 #
317
318 bootmanager-MODULE := bootmanager build
319 bootmanager-SPEC := bootmanager/bootmanager.spec
320 bootmanager-RPMBUILD := sudo rpmbuild
321 ALL += bootmanager
322
323 # bootmanager requires current packages
324 bootmanager: $(filter-out bootmanager,$(ALL))
325
326 # ...and the yum manifest
327 bootmanager: RPMS/yumgroups.xml
328
329 #
330 # bootcd
331 #
332
333 bootcd-MODULE := bootcd build bootmanager
334 bootcd-SPEC := bootcd/bootcd.spec
335 bootcd-RPMBUILD := sudo rpmbuild
336 ALL += bootcd
337
338 # bootcd requires current packages
339 bootcd: $(filter-out bootcd,$(ALL))
340
341 #
342 # MyPLC
343 #
344
345 myplc-MODULE := build myplc new_plc_www plc/scripts
346 myplc-SPEC := myplc/myplc.spec
347 # Package must be built as root
348 myplc-RPMBUILD := sudo rpmbuild
349 ALL += myplc
350
351 # MyPLC may require current packages
352 myplc: $(filter-out myplc,$(ALL))
353
354 # ...and the yum manifest
355 myplc: RPMS/yumgroups.xml
356
357 #
358 # MyPLC development environment
359 #
360
361 ###myplc-devel-MODULE := build myplc
362 ###myplc-devel-SPEC := myplc/myplc-devel.spec
363 #### Package must be built as root
364 ###myplc-devel-RPMBUILD := sudo rpmbuild
365 ###ALL += myplc-devel
366
367 #
368 # Installation rules
369
370
371 # Upload packages to boot server
372 SERVER          := root@onelab-plc.inria.fr
373 RPMSAREA        := /var/www/html/install-rpms/
374 BOOTAREA        := /var/www/html/boot/
375
376 ifeq ($(PLDISTRO),planetlab)
377 YUMGROUPS       := groups/v3_yumgroups.xml
378 else
379 YUMGROUPS       := groups/v4_onelab.xml
380 endif
381
382 #BASE           := onelab
383 BASENEW         := build-$(notdir $(shell pwd))
384 BASEBAK         := planetlab-bak
385 BASE            := planetlab
386
387 RPMS/yumgroups.xml:
388         install -D -m 644 $(YUMGROUPS) RPMS/yumgroups.xml
389
390 INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
391 install: $(INSTALL-TARGETS)
392
393 install-help:
394         @echo install: $(INSTALL-TARGETS)
395
396 install-rpms:RPMS/yumgroups.xml
397         # create repository
398         ssh $(SERVER) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
399         # populate
400         rsync -v --perms --times --group --compress --rsh=ssh \
401            RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(SERVER):/plc/data/$(RPMSAREA)/$(BASENEW)/
402
403 install-index:
404         # sign and index new repository
405         ssh $(SERVER) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
406
407 install-clean-index:
408         # sign and index new repository
409         ssh $(SERVER) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
410
411 install-adopt:
412         # cleanup former bak
413         ssh $(SERVER) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
414         # bak previous repo
415         ssh $(SERVER) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
416         # install new repo
417         ssh $(SERVER) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
418
419 install-bootstrap:
420         # install node image
421         install_bz2=$(wildcard BUILD/bootmanager-*/bootmanager/support-files/PlanetLab-Bootstrap.tar.bz2) ; \
422           if [ -n "$$install_bz2" ] ; then rsync $$install_bz2 $(SERVER):/plc/data/$(BOOTAREA) ; fi
423 #endif
424
425 .PHONY: install