extracts tag definition
[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.16 2007/03/16 16:07:57 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 # we do not use TAG directly anymore, and let it to HEAD
29 # this because we want the rpm's releases to reflect the date even when a tag is used
30 # our build script defines COMMON_TAG that the various components are free to use or not
31  
32 # COMMON_TAG set from the build script
33
34 include onelab-tags.mk
35
36 #
37 # Default values
38 #
39
40 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
41 # it's useless to set this here because it's overriden on the command line by nightly-build.sh
42 TAG := HEAD
43
44 # Check if a tag has been checked out
45 ifneq ($(wildcard CVS/Root),)
46 # Check if we are able to access CVS
47 CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
48 ifneq ($(CVSTAG),)
49 CVSROOT := $(shell cat CVS/Root)
50 ifeq ($(CVSTAG),(none))
51 TAG := HEAD
52 else
53 TAG := $(CVSTAG)
54 endif
55 endif
56 endif
57
58 #
59 # kernel
60 #
61
62 #kernel-x86_64-MODULE := linux-2.6
63 #kernel-x86_64-RPMFLAGS:= --target x86_64
64 #kernel-x86_64-SPEC := linux-2.6/scripts/kernel-2.6-$(PLDISTRO).spec
65 ##ALL += kernel-x86_64
66
67 kernel-i686-MODULE := linux-2.6
68 kernel-i686-RPMFLAGS:= --target i686
69 kernel-i686-SPEC := linux-2.6/scripts/kernel-2.6-$(PLDISTRO).spec
70 ALL += kernel-i686
71
72 #kernel-i586-MODULE := linux-2.6
73 #kernel-i586-RPMFLAGS:= --target i586
74 #kernel-i586-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
75 #ALL += kernel-i586
76
77 #kernel: kernel-i586 kernel-i686
78 #kernel-clean: kernel-i586-clean kernel-i686-clean
79 kernel: kernel-i686
80 kernel-clean: kernel-i686-clean
81
82 #
83 # vnet
84 #
85
86 vnet-MODULE := vnet
87 vnet-SPEC := vnet/vnet.spec
88 ALL += vnet
89
90 # Build kernel first so we can bootstrap off of its build
91 vnet: kernel
92
93 #
94 # madwifi
95 #
96
97 madwifi-ng-MODULE := madwifi-ng
98 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
99 ALL += madwifi-ng
100
101 # Build kernel first so we can bootstrap off of its build
102 madwifi-ng: kernel
103
104
105 # wireless-tools
106
107
108 wireless-tools-MODULE = wireless-tools
109 wireless-tools-SPEC := wireless-tools.spec
110 wireless-tools-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/wireless-tools/tags/29pre14
111 ALL += wireless-tools
112
113 #
114 # ivtv 
115 #
116
117 #ivtv-MODULE := ivtv
118 #ivtv-SPEC := ivtv/ivtv.spec
119 #ALL += ivtv
120
121 #
122 # util-vserver
123 #
124
125 util-vserver-MODULE := util-vserver
126 util-vserver-SPEC := util-vserver/util-vserver.spec
127 util-vserver-RPMFLAGS:= --without dietlibc
128 ALL += util-vserver
129
130 #
131 # PlanetLabAccounts
132 #
133
134 PlanetLabAccounts-MODULE := PlanetLabAccounts
135 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
136 ALL += PlanetLabAccounts
137
138 #
139 # NodeUpdate
140 #
141
142 NodeUpdate-MODULE := NodeUpdate
143 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
144 ALL += NodeUpdate
145
146 #
147 # PlanetLabConf
148 #
149
150 PlanetLabConf-MODULE := PlanetLabConf
151 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
152 ALL += PlanetLabConf
153
154 #
155 # ipod
156 #
157
158 ipod-MODULE := ipod
159 ipod-SPEC := ipod/ipod.spec
160 ALL += ipod
161
162 #
163 # sudo
164 #
165
166 sudo-MODULE := sudo
167 sudo-SPEC := sudo/planetlab_sudo.spec
168 ALL += sudo
169
170 #
171 # pycurl
172 #
173
174 pycurl-MODULE := pycurl
175 pycurl-SPEC := pycurl/pycurl.spec
176 ALL += pycurl
177
178 #
179 # BootServerRequest
180 #
181
182 BootServerRequest-MODULE := BootServerRequest
183 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
184 ALL += BootServerRequest
185
186 #
187 # PlanetLabID
188 #
189
190 PlanetLabID-MODULE := PlanetLabID
191 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
192 ALL += PlanetLabID
193
194 #
195 # Node Manager
196 #
197
198 NodeManager-MODULE := NodeManager
199 NodeManager-SPEC := NodeManager/NodeManager.spec
200 ALL += NodeManager
201
202 #
203 # pl_sshd
204 #
205
206 pl_sshd-MODULE := pl_sshd
207 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
208 ALL += pl_sshd
209
210 #
211 # libhttpd++: 
212 #
213
214 libhttpd++-MODULE := libhttpd++
215 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
216 ALL += libhttpd++
217
218 #
219 # Proper: Privileged Operations Service
220 #
221
222 proper-MODULE := proper
223 proper-SPEC := proper/proper.spec
224 ALL += proper
225
226 proper: libhttpd++
227
228 #
229 # MySQL
230 #
231
232 mysql-MODULE := mysql
233 mysql-SPEC := mysql/mysql.spec
234 ALL += mysql
235
236 #
237 # ulogd
238 #
239
240 ulogd-MODULE := ulogd
241 ulogd-SPEC := ulogd/ulogd.spec
242 ALL += ulogd
243
244 ulogd: kernel proper mysql
245
246 #
247 # netflow
248 #
249
250 netflow-MODULE := netflow
251 netflow-SPEC := netflow/netflow.spec
252 ALL += netflow
253
254 netflow: mysql
255
256 #
257 # PlanetLab Mom: Cleans up your mess
258 #
259
260 pl_mom-MODULE := pl_mom
261 pl_mom-SPEC := pl_mom/pl_mom.spec
262 ALL += pl_mom
263
264 #
265 # iptables
266 #
267
268 iptables-MODULE := iptables
269 iptables-SPEC := iptables/iptables.spec
270 ALL += iptables
271
272 iptables: kernel
273
274 #
275 # iproute
276 #
277
278 iproute-MODULE := iproute2
279 iproute-SPEC := iproute2/iproute.spec
280 ALL += iproute
281
282 #
283 # kexec-tools
284 #
285
286 kexec-tools-MODULE := kexec-tools
287 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
288 ALL += kexec-tools
289
290 #
291 # util-python
292 #
293
294 util-python-MODULE := util-python
295 util-python-SPEC := util-python/util-python.spec
296 ALL += util-python
297
298 # proper and util-vserver both use scripts in util-python for building
299 proper: util-python
300 util-vserver: util-python
301 PlanetLabAuth: util-python
302
303 #
304 # PLCAPI
305 #
306
307 PLCAPI-MODULE := new_plc_api
308 PLCAPI-SPEC := PLCAPI.spec
309 PLCAPI-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/new_plc_api/trunk
310 ALL += PLCAPI
311
312 #
313 # vserver-reference
314 #
315
316 vserver-reference-MODULE := vserver-reference build
317 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
318 # Package must be built as root
319 vserver-reference-RPMBUILD := sudo rpmbuild
320 ALL += vserver-reference
321
322 # vserver-reference may require current packages
323 vserver-reference: $(filter-out vserver-reference,$(ALL))
324
325 #
326 # bootmanager
327 #
328
329 bootmanager-MODULE := bootmanager build
330 bootmanager-SPEC := bootmanager/bootmanager.spec
331 bootmanager-RPMBUILD := sudo rpmbuild
332 bootmanager-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/bootmanager/trunk
333 ALL += bootmanager
334
335 # bootmanager requires current packages
336 bootmanager: $(filter-out bootmanager,$(ALL))
337
338 # ...and the yum manifest
339 bootmanager: RPMS/yumgroups.xml
340
341 #
342 # bootcd
343 #
344
345 bootcd-MODULE := bootcd build bootmanager
346 bootcd-SPEC := bootcd/bootcd.spec
347 bootcd-RPMBUILD := sudo rpmbuild
348 bootcd-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/bootcd/trunk
349 ALL += bootcd
350
351 # bootcd requires current packages
352 bootcd: $(filter-out bootcd,$(ALL))
353
354 #
355 # MyPLC
356 #
357
358 myplc-MODULE := build myplc new_plc_www plc/scripts
359 myplc-SPEC := myplc/myplc.spec
360 # Package must be built as root
361 myplc-RPMBUILD := sudo rpmbuild
362 ALL += myplc
363
364 # MyPLC may require current packages
365 myplc: $(filter-out myplc,$(ALL))
366
367 # ...and the yum manifest
368 myplc: RPMS/yumgroups.xml
369
370 #
371 # MyPLC development environment
372 #
373
374 ###myplc-devel-MODULE := build myplc
375 ###myplc-devel-SPEC := myplc/myplc-devel.spec
376 #### Package must be built as root
377 ###myplc-devel-RPMBUILD := sudo rpmbuild
378 ###ALL += myplc-devel
379
380 #
381 # Installation rules
382
383
384 # Upload packages to boot server
385 SERVER          := root@onelab-plc.inria.fr
386 RPMSAREA        := /var/www/html/install-rpms/
387 BOOTAREA        := /var/www/html/boot/
388
389 ifeq ($(PLDISTRO),planetlab)
390 YUMGROUPS       := groups/v3_yumgroups.xml
391 else
392 YUMGROUPS       := groups/v4_onelab.xml
393 endif
394
395 #BASE           := onelab
396 BASENEW         := build-$(notdir $(shell pwd))
397 BASEBAK         := planetlab-bak
398 BASE            := planetlab
399
400 RPMS/yumgroups.xml:
401         install -D -m 644 $(YUMGROUPS) RPMS/yumgroups.xml
402
403 INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
404 install: $(INSTALL-TARGETS)
405
406 install-help:
407         @echo install: $(INSTALL-TARGETS)
408
409 install-rpms:RPMS/yumgroups.xml
410         # create repository
411         ssh $(SERVER) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
412         # populate
413         rsync -v --perms --times --group --compress --rsh=ssh \
414            RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(SERVER):/plc/data/$(RPMSAREA)/$(BASENEW)/
415
416 install-index:
417         # sign and index new repository
418         ssh $(SERVER) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
419
420 install-clean-index:
421         # sign and index new repository
422         ssh $(SERVER) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
423
424 install-adopt:
425         # cleanup former bak
426         ssh $(SERVER) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
427         # bak previous repo
428         ssh $(SERVER) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
429         # install new repo
430         ssh $(SERVER) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
431
432 install-bootstrap:
433         # install node image
434         install_bz2=$(wildcard BUILD/bootmanager-*/bootmanager/support-files/PlanetLab-Bootstrap.tar.bz2) ; \
435           if [ -n "$$install_bz2" ] ; then rsync $$install_bz2 $(SERVER):/plc/data/$(BOOTAREA) ; fi
436 #endif
437
438 .PHONY: install