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
15 # SVNPATH or package-SVNPATH: SVNPATH to use
16 # Note: do not define both CVSROOT and SVNPATH
18 # TAG or package-TAG: CVS/SVN tag to use
19 # package-MODULE: CVS/SVN module name to use
20 # package-SPEC: RPM spec file template
24 # package-RPMFLAGS: Miscellaneous RPM flags
25 # package-RPMBUILD: If not rpmbuild
26 # package-CVS_RSH: If not ssh for cvs
28 # Add to ALL if you want the package built as part of the default set.
35 #CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
38 SVNPATH := https://svn.planet-lab.org/svn
41 # Check if a tag has been checked out
42 ifneq ($(wildcard CVS/Root),)
43 # Check if we are able to access CVS
44 CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
46 CVSROOT := $(shell cat CVS/Root)
47 ifeq ($(CVSTAG),(none))
59 # Figure out whether we are building on i386 or x86_64 host
60 HOSTARCH := $(shell uname -i)
62 kernel-$(HOSTARCH)-MODULE := Linux-2.6
63 kernel-$(HOSTARCH)-SPEC := scripts/kernel-2.6-planetlab.spec
64 ifeq ($(HOSTARCH),i386)
65 kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
67 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
70 ALL += kernel-$(HOSTARCH)
72 kernel-clean: kernel-$(HOSTARCH)-clean
73 kernel: kernel-$(HOSTARCH)
76 ### Why are we building these?? -F
80 ###madwifi-ng-MODULE := madwifi-ng
81 ###madwifi-ng-SPEC := madwifi-ng/madwifi.spec
84 ### Build kernel first so we can bootstrap off of its build
91 ###ivtv-MODULE := ivtv
92 ###ivtv-SPEC := ivtv/ivtv.spec
99 util-vserver-MODULE := util-vserver
100 util-vserver-SPEC := util-vserver.spec
101 util-vserver-RPMFLAGS:= --without dietlibc
108 NodeUpdate-MODULE := NodeUpdate
109 NodeUpdate-SPEC := NodeUpdate.spec
113 # PlanetLabConf: DEPRECATED.
115 # conf_files does the same thing in NM
118 #PlanetLabConf-MODULE := PlanetLabConf
119 #PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
120 #ALL += PlanetLabConf
126 PingOfDeath-MODULE := PingOfDeath
127 PingOfDeath-SPEC := ipod.spec
133 # Added functionality provided by this package to www/PlanetLabConf/sudoers.
137 #sudo-SPEC := sudo/planetlab_sudo.spec
143 # [tony] use FC6+ release
146 #curl_vernum := $(shell printf %d 0x$(shell curl-config --vernum))
147 #pycurl_vernum := $(shell printf %d 0x070d01) # 7.13.1
148 #pycurl_incompatnum := $(shell printf %d 0x071000) # 7.16.0
149 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_vernum) && echo 1),1)
150 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_incompatnum) && echo 0),1)
151 #pycurl-MODULE := pycurl
152 #pycurl-SPEC := pycurl/pycurl.spec
158 # BootServerRequest: DEPRECATE
160 # Not used by anything.
163 #BootServerRequest-MODULE := BootServerRequest
164 #BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
165 #ALL += BootServerRequest
172 NodeManager-MODULE := NodeManager
173 NodeManager-SPEC := NodeManager.spec
180 pl_sshd-MODULE := pl_sshd
181 pl_sshd-SPEC := pl_sshd.spec
187 # Deprecate when vsys takes over [sapan].
188 # keep in build for proper.
191 libhttpd++-MODULE := libhttpd++
192 libhttpd++-SPEC := libhttpd++.spec
196 # Proper: Privileged Operations Service
199 proper-MODULE := proper
200 proper-SPEC := proper.spec
201 proper-RPMBUILD := sudo bash ./rpmbuild.sh
207 # CoDemux: Port 80 demux
210 CoDemux-MODULE := CoDemux
211 CoDemux-SPEC := codemux.spec
212 CoDemux-RPMBUILD := sudo bash ./rpmbuild.sh
219 mysql-MODULE := mysql
220 mysql-SPEC := mysql.spec
227 ulogd-MODULE := ulogd
228 ulogd-SPEC := ulogd.spec
231 ulogd: kernel proper #mysql
237 PlanetFlow-MODULE := PlanetFlow
238 PlanetFlow-SPEC := netflow.spec
244 # PlanetLab Mom: Cleans up your mess
248 Mom-SPEC := pl_mom.spec
255 iptables-MODULE := iptables
256 iptables-SPEC := iptables.spec
265 iproute-MODULE := iproute2
266 iproute-SPEC := iproute.spec
270 # kexec-tools: DEPRECATE
272 # [marc] use FC6+ release
275 #kexec-tools-MODULE := kexec-tools
276 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
282 # [marc] deprecate server.py
284 # I dont know what the above means... Daniel says we need to seperate util-vserver from
285 # pl specific utilities (vuseradd, etc) which may or may not include vserver.py. Until then,
286 # I'm keeping this in the build. -F
289 util-python-MODULE := util-python
290 util-python-SPEC := util-python.spec
293 # proper and util-vserver both use scripts in util-python for building
294 # [dhozac] Not anymore. util-vserver uses automake and no longer needs util-python
297 #util-vserver: util-python
298 #PlanetLabAuth: util-python
301 # vsys does not compile when ocaml rpm is installed. Need to fix include path
302 # so that it compiles. Sapan will need to fix this.
307 vsys-SPEC := vsys.spec
314 PLCAPI-MODULE := PLCAPI
315 PLCAPI-SPEC := PLCAPI.spec
323 PLCWWW-SPEC := PLCWWW.spec
330 VserverReference-MODULE := VserverReference build
331 VserverReference-SPEC := vserver-reference.spec
332 # Package must be built as root
333 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
334 ALL += VserverReference
336 # vserver-reference may require current packages
337 vserver-reference: $(filter-out vserver-reference,$(ALL))
343 BootManager-MODULE := BootManager build
344 BootManager-SPEC := bootmanager.spec
345 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
348 # BootManager requires current packages
349 BootManager: $(filter-out BootManager,$(ALL))
351 # ...and the yum manifest
352 BootManager: RPMS/yumgroups.xml
358 BootCD-MODULE := BootCD build BootManager
359 BootCD-SPEC := bootcd.spec
360 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
363 # BootCD requires current packages
364 # BootCD: $(filter-out BootCD,$(ALL))
370 MyPLC-MODULE := MyPLC build WWW
371 MyPLC-SPEC := myplc.spec
372 # Package must be built as root
373 MyPLC-RPMBUILD := sudo bash ./rpmbuild.sh
376 # MyPLC may require current packages
377 MyPLC: $(filter-out MyPLC,$(ALL))
379 # ...and the yum manifest
380 MyPLC: RPMS/yumgroups.xml
387 MyPLC-native-MODULE := MyPLC build WWW
388 MyPLC-native-SPEC := myplc-native.spec
389 # Package must be built as root
390 MyPLC-native-RPMBUILD := sudo bash ./rpmbuild.sh
393 # MyPLC may require current packages
394 MyPLC-native: $(filter-out MyPLC,$(ALL))
396 # ...and the yum manifest
397 MyPLC-native: RPMS/yumgroups.xml
400 # MyPLC development environment
403 myplc-devel-MODULE := MyPLC build
404 myplc-devel-SPEC := myplc-devel.spec
405 # Package must be built as root
406 myplc-devel-RPMBUILD := sudo bash ./rpmbuild.sh
410 # MyPLC native development environment
413 myplc-devel-native-MODULE := MyPLC
414 myplc-devel-native-SPEC := myplc-devel-native.spec
415 ALL += myplc-devel-native
420 # [daniel] wait for latest Fedora release
421 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
422 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
425 libnl-MODULE := libnl
426 libnl-SPEC := libnl.spec
435 # Upload packages to boot server
436 SERVERA := build@boot1.planet-lab.org
437 SERVERB := build@boot2.planet-lab.org
438 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
440 # Put nightly alpha builds in a subdirectory
442 ARCHIVE := $(ARCHIVE)/planetlab-alpha
443 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
447 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
451 @echo make install is only meant to be called from ./build.sh
453 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
454 # Sign all RPMS. setsid detaches rpm from the terminal,
455 # allowing the (hopefully blank) GPG password to be entered
456 # from stdin instead of /dev/tty. Obviously, the build server
459 --define "_signature gpg" \
460 --define "_gpg_path /etc/planetlab" \
461 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
462 --resign RPMS/*/*.rpm
466 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
467 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
469 # Create package manifest
470 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
471 # Update yum metadata
472 yum-arch RPMS >/dev/null
473 createrepo -g yumgroups.xml RPMS >/dev/null
474 # Populate repository
476 --exclude '*-debuginfo-*' \
477 --recursive --links --perms --times --group --compress --rsh=ssh \
478 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
480 --exclude '*-debuginfo-*' \
481 --recursive --links --perms --times --group --compress --rsh=ssh \
482 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
484 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
485 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
486 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
488 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
489 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
490 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \