Deprecate PlanetLabAuth. Removed from dependency check.
[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.71 2007/09/25 18:38:47 faiyaza 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 SVNROOT := http://svn.planet-lab.org/svn
33 TAG := HEAD
34
35 # Check if a tag has been checked out
36 ifneq ($(wildcard CVS/Root),)
37 # Check if we are able to access CVS
38 CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
39 ifneq ($(CVSTAG),)
40 CVSROOT := $(shell cat CVS/Root)
41 ifeq ($(CVSTAG),(none))
42 TAG := HEAD
43 else
44 TAG := $(CVSTAG)
45 endif
46 endif
47 endif
48
49 #
50 # kernel
51 #
52
53 # Figure out whether we are building on i386 or x86_64 host
54 HOSTARCH := $(shell uname -i)
55
56 kernel-$(HOSTARCH)-MODULE := linux-2.6
57 kernel-$(HOSTARCH)-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
58 ifeq ($(HOSTARCH),i386)
59 kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
60 else
61 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
62 endif
63
64 ALL += kernel-$(HOSTARCH)
65
66 kernel-clean: kernel-$(HOSTARCH)-clean
67 kernel: kernel-$(HOSTARCH)
68
69
70 ###  Why are we building these??  -F
71 ### madwifi
72 ###
73 ##
74 ###madwifi-ng-MODULE := madwifi-ng
75 ###madwifi-ng-SPEC := madwifi-ng/madwifi.spec
76 ###ALL += madwifi-ng
77 ##
78 ### Build kernel first so we can bootstrap off of its build
79 ###madwifi-ng: kernel
80 ##
81 ###
82 ### ivtv 
83 ###
84 ##
85 ###ivtv-MODULE := ivtv
86 ###ivtv-SPEC := ivtv/ivtv.spec
87 ###ALL += ivtv
88
89 #
90 # util-vserver
91 #
92
93 util-vserver-MODULE := util-vserver
94 util-vserver-SPEC := util-vserver/util-vserver.spec
95 util-vserver-RPMFLAGS:= --without dietlibc
96 ALL += util-vserver
97
98 #
99 # NodeUpdate
100 #
101
102 NodeUpdate-MODULE := NodeUpdate
103 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
104 ALL += NodeUpdate
105
106 #
107 # PlanetLabConf:  DEPRECATED.  
108 #
109 # conf_files does the same thing in NM
110 #
111
112 #PlanetLabConf-MODULE := PlanetLabConf
113 #PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
114 #ALL += PlanetLabConf
115
116 #
117 # ipod
118 #
119
120 PingOfDeath-MODULE := PingOfDeath
121 PingOfDeath-SPEC := PingOfDeath/ipod.spec
122 ALL += PingOfDeath
123
124 #
125 # sudo:  DEPRECATED
126 #
127 # Added functionality provided by this package to www/PlanetLabConf/sudoers.
128 #
129
130 #sudo-MODULE := sudo
131 #sudo-SPEC := sudo/planetlab_sudo.spec
132 #ALL += sudo
133
134 #
135 # pycurl:  DEPRECATE
136 #
137 # [tony] use FC6+ release
138 #
139
140 #curl_vernum := $(shell printf %d 0x$(shell curl-config --vernum))
141 #pycurl_vernum := $(shell printf %d 0x070d01) # 7.13.1
142 #pycurl_incompatnum := $(shell printf %d 0x071000) # 7.16.0
143 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_vernum) && echo 1),1)
144 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_incompatnum) && echo 0),1)
145 #pycurl-MODULE := pycurl
146 #pycurl-SPEC := pycurl/pycurl.spec
147 #ALL += pycurl
148 #endif
149 #endif
150
151 #
152 # BootServerRequest:  DEPRECATE
153 #
154 # Not used by anything.
155 #
156
157 #BootServerRequest-MODULE := BootServerRequest
158 #BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
159 #ALL += BootServerRequest
160 #
161 #
162 #
163 # Node Manager
164 #
165
166 NodeManager-MODULE := NodeManager
167 NodeManager-SPEC := NodeManager/NodeManager.spec
168 ALL += NodeManager
169
170 #
171 # pl_sshd
172 #
173
174 pl_sshd-MODULE := pl_sshd
175 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
176 ALL += pl_sshd
177
178 #
179 # libhttpd++: 
180 #
181 # Deprecate when vsys takes over [sapan].
182 # keep in build for proper.
183 #
184
185 libhttpd++-MODULE := libhttpd++
186 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
187 ALL += libhttpd++
188
189 #
190 # Proper: Privileged Operations Service
191 #
192
193 proper-MODULE := proper
194 proper-SPEC := proper/proper.spec
195 proper-RPMBUILD := sudo bash ./rpmbuild.sh
196 ALL += proper
197
198 proper: libhttpd++
199
200 #
201 # CoDemux: Port 80 demux
202 #
203
204 codemux-MODULE := codemux
205 codemux-SPEC   := codemux/codemux.spec
206 #ALL += codemux
207
208 #
209 # MySQL
210 #
211
212 mysql-MODULE := mysql
213 mysql-SPEC := mysql/mysql.spec
214 #ALL += mysql
215
216 #
217 # ulogd
218 #
219
220 ulogd-MODULE := ulogd
221 ulogd-SPEC := ulogd/ulogd.spec
222 ALL += ulogd
223
224 ulogd: kernel proper #mysql
225
226 #
227 # netflow
228 #
229
230 netflow-MODULE := netflow
231 netflow-SPEC := netflow/netflow.spec
232 ALL += netflow
233
234 netflow: #mysql
235
236 #
237 # PlanetLab Mom: Cleans up your mess
238 #
239
240 MoM-MODULE := MoM
241 MoM-SPEC := MoM/pl_mom.spec
242 ALL += MoM
243
244 #
245 # iptables
246 #
247
248 iptables-MODULE := iptables
249 iptables-SPEC := iptables/iptables.spec
250 ALL += iptables
251
252 iptables: kernel
253
254 #
255 # iproute
256 #
257
258 iproute-MODULE := iproute2
259 iproute-SPEC := iproute2/iproute.spec
260 ALL += iproute
261
262 #
263 # kexec-tools:  DEPRECATE
264 #
265 # [marc]    use FC6+ release
266 #
267
268 #kexec-tools-MODULE := kexec-tools
269 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
270 #ALL += kexec-tools
271
272 #
273 # util-python
274 #
275 # [marc]    deprecate server.py
276 #
277 # I dont know what the above means...  Daniel says we need to seperate util-vserver from
278 # pl specific utilities (vuseradd, etc) which may or may not include vserver.py.  Until then,
279 # I'm keeping this in the build.  -F
280 #
281
282 util-python-MODULE := util-python
283 util-python-SPEC := util-python/util-python.spec
284 ALL += util-python
285
286 # proper and util-vserver both use scripts in util-python for building
287 proper: util-python
288 util-vserver: util-python
289 #PlanetLabAuth: util-python
290
291 #
292 # PLCAPI
293 #
294
295 PLCAPI-MODULE := new_plc_api
296 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
297 ALL += PLCAPI
298
299 #
300 # PLCWWW
301 #
302
303 PLCWWW-MODULE := new_plc_www
304 PLCWWW-SPEC := new_plc_www/PLCWWW.spec
305 ALL += PLCWWW
306
307 #
308 # vserver-reference
309 #
310
311 VserverReference-MODULE := VserverReference build
312 VserverReference-SPEC := VserverReference/vserver-reference.spec
313 # Package must be built as root
314 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
315 ALL += VserverReference
316
317 # vserver-reference may require current packages
318 vserver-reference: $(filter-out vserver-reference,$(ALL))
319
320 #
321 # BootManager
322 #
323
324 BootManager-MODULE := BootManager build
325 BootManager-SPEC := BootManager/BootManager.spec
326 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
327 ALL += BootManager
328
329 # BootManager requires current packages
330 BootManager: $(filter-out BootManager,$(ALL))
331
332 # ...and the yum manifest
333 BootManager: RPMS/yumgroups.xml
334
335 #
336 # BootCD
337 #
338
339 BootCD-MODULE := BootCD build bootmanager
340 BootCD-SPEC := BootCD/BootCD.spec
341 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
342 ALL += BootCD
343
344 # BootCD requires current packages
345 BootCD: $(filter-out BootCD,$(ALL))
346
347 #
348 # MyPLC
349 #
350
351 MyPLC-MODULE := build MyPLC new_plc_www plc/scripts
352 MyPLC-SPEC := MyPLC/myplc.spec
353 # Package must be built as root
354 MyPLC-RPMBUILD := sudo bash ./rpmbuild.sh
355 ALL += MyPLC
356
357 # MyPLC may require current packages
358 MyPLC: $(filter-out MyPLC,$(ALL))
359
360 # ...and the yum manifest
361 MyPLC: RPMS/yumgroups.xml
362
363 #
364 # MyPLC development environment
365 #
366
367 myplc-devel-MODULE := build myplc
368 myplc-devel-SPEC := MyPLC/myplc-devel.spec
369 # Package must be built as root
370 myplc-devel-RPMBUILD := sudo bash ./rpmbuild.sh
371 ALL += myplc-devel
372
373 #
374 # MyPLC native
375 #
376
377 myplc-native-MODULE := build MyPLC plc/scripts
378 myplc-native-SPEC := MyPLC/myplc-native.spec
379 # Package must be built as root
380 myplc-native-RPMBUILD := sudo bash ./rpmbuild.sh
381 ALL += myplc-native
382
383 # MyPLC may require current packages
384 myplc-native: $(filter-out MyPLC,$(ALL))
385
386 # ...and the yum manifest
387 myplc-native: RPMS/yumgroups.xml
388
389
390 #
391 # libnl
392 #
393 # [daniel]    wait for latest Fedora release 
394 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
395 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
396 #
397
398 libnl-MODULE := libnl
399 libnl-SPEC := libnl/libnl.spec
400 ALL += libnl
401
402 util-vserver: libnl
403
404 #
405 # Installation rules
406
407
408 # Upload packages to boot server
409 SERVERA := build@boot1.planet-lab.org
410 SERVERB := build@boot2.planet-lab.org
411 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
412
413 # Put nightly alpha builds in a subdirectory
414 ifeq ($(TAG),HEAD)
415 ARCHIVE := $(ARCHIVE)/planetlab-alpha
416 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
417 endif
418
419 RPMS/yumgroups.xml:
420         install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
421
422 install:
423 ifeq ($(BASE),)
424         @echo make install is only meant to be called from ./build.sh
425 else
426 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
427         # Sign all RPMS. setsid detaches rpm from the terminal,
428         # allowing the (hopefully blank) GPG password to be entered
429         # from stdin instead of /dev/tty. Obviously, the build server
430         # should be secure.
431         echo | setsid rpm \
432         --define "_signature gpg" \
433         --define "_gpg_path /etc/planetlab" \
434         --define "_gpg_name PlanetLab <info@planet-lab.org>" \
435         --resign RPMS/*/*.rpm
436 endif
437 ifneq ($(BUILDS),)
438         # Remove old runs
439         echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
440         echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
441 endif
442         # Create package manifest
443         sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
444         # Update yum metadata
445         yum-arch RPMS >/dev/null
446         createrepo -g yumgroups.xml RPMS >/dev/null
447         # Populate repository
448         rsync \
449         --exclude '*-debuginfo-*' \
450         --recursive --links --perms --times --group --compress --rsh=ssh \
451         RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
452         rsync \
453         --exclude '*-debuginfo-*' \
454         --recursive --links --perms --times --group --compress --rsh=ssh \
455         RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
456 ifeq ($(TAG),HEAD)
457         # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
458         if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
459             ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
460         fi
461         # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
462         if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
463             ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \
464         fi
465
466 endif
467 endif
468
469 .PHONY: install