2 # PlanetLab standard components list
4 # Mark Huang <mlhuang@cs.princeton.edu>
5 # Copyright (C) 2003-2006 The Trustees of Princeton University
7 # $Id: planetlab.mk,v 1.71 2007/09/25 18:38:47 faiyaza Exp $
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
20 # package-RPMFLAGS: Miscellaneous RPM flags
21 # package-RPMBUILD: If not rpmbuild
22 # package-CVS_RSH: If not ssh
24 # Add to ALL if you want the package built as part of the default set.
31 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
32 SVNROOT := http://svn.planet-lab.org/svn
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')
40 CVSROOT := $(shell cat CVS/Root)
41 ifeq ($(CVSTAG),(none))
53 # Figure out whether we are building on i386 or x86_64 host
54 HOSTARCH := $(shell uname -i)
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
61 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
64 ALL += kernel-$(HOSTARCH)
66 kernel-clean: kernel-$(HOSTARCH)-clean
67 kernel: kernel-$(HOSTARCH)
70 ### Why are we building these?? -F
74 ###madwifi-ng-MODULE := madwifi-ng
75 ###madwifi-ng-SPEC := madwifi-ng/madwifi.spec
78 ### Build kernel first so we can bootstrap off of its build
85 ###ivtv-MODULE := ivtv
86 ###ivtv-SPEC := ivtv/ivtv.spec
93 util-vserver-MODULE := util-vserver
94 util-vserver-SPEC := util-vserver/util-vserver.spec
95 util-vserver-RPMFLAGS:= --without dietlibc
102 NodeUpdate-MODULE := NodeUpdate
103 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
107 # PlanetLabConf: DEPRECATED.
109 # conf_files does the same thing in NM
112 #PlanetLabConf-MODULE := PlanetLabConf
113 #PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
114 #ALL += PlanetLabConf
120 PingOfDeath-MODULE := PingOfDeath
121 PingOfDeath-SPEC := PingOfDeath/ipod.spec
127 # Added functionality provided by this package to www/PlanetLabConf/sudoers.
131 #sudo-SPEC := sudo/planetlab_sudo.spec
137 # [tony] use FC6+ release
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
152 # BootServerRequest: DEPRECATE
154 # Not used by anything.
157 #BootServerRequest-MODULE := BootServerRequest
158 #BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
159 #ALL += BootServerRequest
166 NodeManager-MODULE := NodeManager
167 NodeManager-SPEC := NodeManager/NodeManager.spec
174 pl_sshd-MODULE := pl_sshd
175 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
181 # Deprecate when vsys takes over [sapan].
182 # keep in build for proper.
185 libhttpd++-MODULE := libhttpd++
186 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
190 # Proper: Privileged Operations Service
193 proper-MODULE := proper
194 proper-SPEC := proper/proper.spec
195 proper-RPMBUILD := sudo bash ./rpmbuild.sh
201 # CoDemux: Port 80 demux
204 codemux-MODULE := codemux
205 codemux-SPEC := codemux/codemux.spec
212 mysql-MODULE := mysql
213 mysql-SPEC := mysql/mysql.spec
220 ulogd-MODULE := ulogd
221 ulogd-SPEC := ulogd/ulogd.spec
224 ulogd: kernel proper #mysql
230 NetFlow-MODULE := NetFlow
231 NetFlow-SPEC := NetFlow/netflow.spec
237 # PlanetLab Mom: Cleans up your mess
241 MoM-SPEC := MoM/pl_mom.spec
248 iptables-MODULE := iptables
249 iptables-SPEC := iptables/iptables.spec
258 iproute-MODULE := iproute2
259 iproute-SPEC := iproute2/iproute.spec
263 # kexec-tools: DEPRECATE
265 # [marc] use FC6+ release
268 #kexec-tools-MODULE := kexec-tools
269 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
275 # [marc] deprecate server.py
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
282 util-python-MODULE := util-python
283 util-python-SPEC := util-python/util-python.spec
286 # proper and util-vserver both use scripts in util-python for building
288 util-vserver: util-python
289 #PlanetLabAuth: util-python
295 vsys-SPEC := vsys/vsys.spec
302 PLCAPI-MODULE := new_plc_api
303 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
310 PLCWWW-MODULE := new_plc_www
311 PLCWWW-SPEC := new_plc_www/PLCWWW.spec
318 VserverReference-MODULE := VserverReference build
319 VserverReference-SPEC := VserverReference/vserver-reference.spec
320 # Package must be built as root
321 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
322 ALL += VserverReference
324 # vserver-reference may require current packages
325 vserver-reference: $(filter-out vserver-reference,$(ALL))
331 BootManager-MODULE := BootManager build
332 BootManager-SPEC := BootManager/BootManager.spec
333 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
336 # BootManager requires current packages
337 BootManager: $(filter-out BootManager,$(ALL))
339 # ...and the yum manifest
340 BootManager: RPMS/yumgroups.xml
346 BootCD-MODULE := BootCD build bootmanager
347 BootCD-SPEC := BootCD/BootCD.spec
348 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
351 # BootCD requires current packages
352 BootCD: $(filter-out BootCD,$(ALL))
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 bash ./rpmbuild.sh
364 # MyPLC may require current packages
365 MyPLC: $(filter-out MyPLC,$(ALL))
367 # ...and the yum manifest
368 MyPLC: RPMS/yumgroups.xml
371 # MyPLC development environment
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 bash ./rpmbuild.sh
384 myplc-native-MODULE := build MyPLC plc/scripts
385 myplc-native-SPEC := MyPLC/myplc-native.spec
386 # Package must be built as root
387 myplc-native-RPMBUILD := sudo bash ./rpmbuild.sh
390 # MyPLC may require current packages
391 myplc-native: $(filter-out MyPLC,$(ALL))
393 # ...and the yum manifest
394 myplc-native: RPMS/yumgroups.xml
400 # [daniel] wait for latest Fedora release
401 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
402 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
405 libnl-MODULE := libnl
406 libnl-SPEC := libnl/libnl.spec
415 # Upload packages to boot server
416 SERVERA := build@boot1.planet-lab.org
417 SERVERB := build@boot2.planet-lab.org
418 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
420 # Put nightly alpha builds in a subdirectory
422 ARCHIVE := $(ARCHIVE)/planetlab-alpha
423 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
427 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
431 @echo make install is only meant to be called from ./build.sh
433 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
434 # Sign all RPMS. setsid detaches rpm from the terminal,
435 # allowing the (hopefully blank) GPG password to be entered
436 # from stdin instead of /dev/tty. Obviously, the build server
439 --define "_signature gpg" \
440 --define "_gpg_path /etc/planetlab" \
441 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
442 --resign RPMS/*/*.rpm
446 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
447 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
449 # Create package manifest
450 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
451 # Update yum metadata
452 yum-arch RPMS >/dev/null
453 createrepo -g yumgroups.xml RPMS >/dev/null
454 # Populate repository
456 --exclude '*-debuginfo-*' \
457 --recursive --links --perms --times --group --compress --rsh=ssh \
458 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
460 --exclude '*-debuginfo-*' \
461 --recursive --links --perms --times --group --compress --rsh=ssh \
462 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
464 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
465 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
466 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
468 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
469 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
470 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \