spec location
[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.3 2007/01/29 11:02:56 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/wireless-tools.spec
100 wireless-tools-CVSROOT := /cvs
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 # yum
122 #
123
124 yum-MODULE := yum
125 yum-SPEC := yum/yum.spec
126 ALL += yum
127
128 #
129 # PlanetLabAccounts
130 #
131
132 PlanetLabAccounts-MODULE := PlanetLabAccounts
133 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
134 ALL += PlanetLabAccounts
135
136 #
137 # NodeUpdate
138 #
139
140 NodeUpdate-MODULE := NodeUpdate
141 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
142 ALL += NodeUpdate
143
144 #
145 # PlanetLabConf
146 #
147
148 PlanetLabConf-MODULE := PlanetLabConf
149 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
150 ALL += PlanetLabConf
151
152 #
153 # ipod
154 #
155
156 ipod-MODULE := ipod
157 ipod-SPEC := ipod/ipod.spec
158 ALL += ipod
159
160 #
161 # sudo
162 #
163
164 sudo-MODULE := sudo
165 sudo-SPEC := sudo/planetlab_sudo.spec
166 ALL += sudo
167
168 #
169 # pycurl
170 #
171
172 pycurl-MODULE := pycurl
173 pycurl-SPEC := pycurl/pycurl.spec
174 ALL += pycurl
175
176 #
177 # BootServerRequest
178 #
179
180 BootServerRequest-MODULE := BootServerRequest
181 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
182 ALL += BootServerRequest
183
184 #
185 # PlanetLabID
186 #
187
188 PlanetLabID-MODULE := PlanetLabID
189 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
190 ALL += PlanetLabID
191
192 #
193 # Node Manager
194 #
195
196 NodeManager-MODULE := NodeManager
197 NodeManager-SPEC := NodeManager/NodeManager.spec
198 ALL += NodeManager
199
200 #
201 # pl_sshd
202 #
203
204 pl_sshd-MODULE := pl_sshd
205 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
206 ALL += pl_sshd
207
208 #
209 # libhttpd++: 
210 #
211
212 libhttpd++-MODULE := libhttpd++
213 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
214 ALL += libhttpd++
215
216 #
217 # Proper: Privileged Operations Service
218 #
219
220 proper-MODULE := proper
221 proper-SPEC := proper/proper.spec
222 ALL += proper
223
224 proper: libhttpd++
225
226 #
227 # MySQL
228 #
229
230 mysql-MODULE := mysql
231 mysql-SPEC := mysql/mysql.spec
232 ALL += mysql
233
234 #
235 # ulogd
236 #
237
238 ulogd-MODULE := ulogd
239 ulogd-SPEC := ulogd/ulogd.spec
240 ALL += ulogd
241
242 ulogd: kernel proper mysql
243
244 #
245 # netflow
246 #
247
248 netflow-MODULE := netflow
249 netflow-SPEC := netflow/netflow.spec
250 ALL += netflow
251
252 netflow: mysql
253
254 #
255 # PlanetLab Mom: Cleans up your mess
256 #
257
258 pl_mom-MODULE := pl_mom
259 pl_mom-SPEC := pl_mom/pl_mom.spec
260 ALL += pl_mom
261
262 #
263 # iptables
264 #
265
266 iptables-MODULE := iptables
267 iptables-SPEC := iptables/iptables.spec
268 ALL += iptables
269
270 iptables: kernel
271
272 #
273 # iproute
274 #
275
276 iproute-MODULE := iproute2
277 iproute-SPEC := iproute2/iproute.spec
278 ALL += iproute
279
280 #
281 # kexec-tools
282 #
283
284 kexec-tools-MODULE := kexec-tools
285 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
286 ALL += kexec-tools
287
288 #
289 # dhcp
290 #
291
292 dhcp-MODULE := dhcp
293 dhcp-SPEC := dhcp/dhcp.spec
294 ALL += dhcp
295
296 #
297 # util-python
298 #
299
300 util-python-MODULE := util-python
301 util-python-SPEC := util-python/util-python.spec
302 ALL += util-python
303
304 # proper and util-vserver both use scripts in util-python for building
305 proper: util-python
306 util-vserver: util-python
307 PlanetLabAuth: util-python
308
309 #
310 # PlanetLabAuth
311 #
312
313 PlanetLabAuth-MODULE := pl_auth
314 PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
315 ALL += PlanetLabAuth
316
317 #
318 # plcapilib
319 #
320
321 plcapilib-MODULE := plcmdline
322 plcapilib-SPEC := plcmdline/plcapilib.spec
323 ALL += plcapilib
324
325 #
326 # PLCAPI
327 #
328
329 PLCAPI-MODULE := new_plc_api
330 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
331 ALL += PLCAPI
332
333 #
334 # vserver-reference
335 #
336
337 vserver-reference-MODULE := vserver-reference build
338 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
339 # Package must be built as root
340 vserver-reference-RPMBUILD := sudo rpmbuild
341 ALL += vserver-reference
342
343 # vserver-reference may require current packages
344 vserver-reference: $(filter-out vserver-reference,$(ALL))
345
346 #
347 # bootmanager
348 #
349
350 bootmanager-MODULE := bootmanager build
351 bootmanager-SPEC := bootmanager/bootmanager.spec
352 bootmanager-RPMBUILD := sudo rpmbuild
353 ALL += bootmanager
354
355 # bootmanager requires current packages
356 bootmanager: $(filter-out bootmanager,$(ALL))
357
358 # ...and the yum manifest
359 bootmanager: RPMS/yumgroups.xml
360
361 #
362 # bootcd
363 #
364
365 bootcd-MODULE := bootcd build bootmanager
366 bootcd-SPEC := bootcd/bootcd.spec
367 bootcd-RPMBUILD := sudo rpmbuild
368 ALL += bootcd
369
370 # bootcd requires current packages
371 bootcd: $(filter-out bootcd,$(ALL))
372
373 #
374 # MyPLC
375 #
376
377 myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
378 myplc-SPEC := myplc/myplc.spec
379 # Package must be built as root
380 myplc-RPMBUILD := sudo rpmbuild
381 ALL += myplc
382
383 # MyPLC may require current packages
384 myplc: $(filter-out myplc,$(ALL))
385
386 # ...and the yum manifest
387 myplc: RPMS/yumgroups.xml
388
389 #
390 # MyPLC development environment
391 #
392
393 ###myplc-devel-MODULE := build myplc
394 ###myplc-devel-SPEC := myplc/myplc-devel.spec
395 #### Package must be built as root
396 ###myplc-devel-RPMBUILD := sudo rpmbuild
397 ###ALL += myplc-devel
398
399 #
400 # Installation rules
401
402
403 # Upload packages to boot server
404 SERVER          := root@onelab-plc.inria.fr
405 RPMSAREA        := /plc/data/var/www/html/install-rpms/
406 BOOTAREA        := /plc/data/var/www/html/boot/
407
408 YUMGROUPS       := $(PLDISTRO).xml
409 #BASE           := onelab
410 BASETMP         := planetlab-upgrading
411 BASEBAK         := planetlab-bak
412 BASE            := planetlab
413
414 RPMS/yumgroups.xml:
415         install -D -m 644 $(YUMGROUPS) RPMS/yumgroups.xml
416
417 install: install-rpms install-index install-bootstrap
418
419 install-rpms:RPMS/yumgroups.xml
420         # create repository
421         ssh $(SERVER) mkdir -p $(RPMSAREA)/$(BASETMP)
422         # populate
423         rsync -v --perms --times --group --compress --rsh=ssh \
424            RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(SERVER):$(RPMSAREA)/$(BASETMP)/
425
426 # would be better if we could run plc.d/packages on a temporary dir
427 # currently while we run packages clients wont be able to use the repo (nor signed nor indexed)
428 install-index:
429         # cleanup former bak
430         ssh $(SERVER) rm -rf $(RPMSAREA)/$(BASEBAK)
431         # bak previous repo
432         ssh $(SERVER) mv $(RPMSAREA)/$(BASE) $(RPMSAREA)/$(BASEBAK)
433         # install new repo
434         ssh $(SERVER) mv $(RPMSAREA)/$(BASETMP) $(RPMSAREA)/$(BASE)
435         # sign and re-index
436         ssh $(SERVER) chroot /plc/root service plc start packages
437
438 install-bootstrap:
439         # install node image
440         install_bz2=$(wildcard BUILD/bootmanager-*/bootmanager/support-files/PlanetLab-Bootstrap.tar.bz2) ; \
441           if [ -n "$$install_bz2" ] ; then rsync $$install_bz2 $(SERVER):$(BOOTAREA) ; fi
442 #endif
443
444 .PHONY: install