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.
32 # Default values -- should be able to override these from command line
35 HOSTARCH := $(shell uname -i)
36 DISTRO := $(shell ./getdistro.sh)
37 RELEASE := $(shell ./getrelease.sh)
40 # load in a release specific tags file
41 # Override TAGSFILE from command line to select something else
43 TAGSFILE = default-tags.mk
51 kernel-$(HOSTARCH)-MODULE := Linux-2.6
52 kernel-$(HOSTARCH)-SPEC := scripts/kernel-2.6-planetlab.spec
53 ifeq ($(HOSTARCH),i386)
54 kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
56 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
59 ALL += kernel-$(HOSTARCH)
61 kernel-clean: kernel-$(HOSTARCH)-clean
62 kernel: kernel-$(HOSTARCH)
68 util-vserver-MODULE := util-vserver
69 util-vserver-SPEC := util-vserver.spec
70 util-vserver-RPMFLAGS:= --without dietlibc
77 NodeUpdate-MODULE := NodeUpdate
78 NodeUpdate-SPEC := NodeUpdate.spec
82 # PlanetLabConf: DEPRECATED.
84 # conf_files does the same thing in NM
87 #PlanetLabConf-MODULE := PlanetLabConf
88 #PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
95 PingOfDeath-MODULE := PingOfDeath
96 PingOfDeath-SPEC := ipod.spec
102 # Added functionality provided by this package to www/PlanetLabConf/sudoers.
106 #sudo-SPEC := sudo/planetlab_sudo.spec
112 # [tony] use FC6+ release
115 #curl_vernum := $(shell printf %d 0x$(shell curl-config --vernum))
116 #pycurl_vernum := $(shell printf %d 0x070d01) # 7.13.1
117 #pycurl_incompatnum := $(shell printf %d 0x071000) # 7.16.0
118 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_vernum) && echo 1),1)
119 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_incompatnum) && echo 0),1)
120 #pycurl-MODULE := pycurl
121 #pycurl-SPEC := pycurl/pycurl.spec
127 # BootServerRequest: DEPRECATE
129 # Not used by anything.
132 #BootServerRequest-MODULE := BootServerRequest
133 #BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
134 #ALL += BootServerRequest
141 NodeManager-MODULE := NodeManager
142 NodeManager-SPEC := NodeManager.spec
149 pl_sshd-MODULE := pl_sshd
150 pl_sshd-SPEC := pl_sshd.spec
156 # Deprecate when vsys takes over [sapan].
157 # keep in build for proper.
160 libhttpd++-MODULE := libhttpd++
161 libhttpd++-SPEC := libhttpd++.spec
165 # Proper: Privileged Operations Service
168 proper-MODULE := proper
169 proper-SPEC := proper.spec
170 proper-RPMBUILD := sudo bash ./rpmbuild.sh
176 # CoDemux: Port 80 demux
179 CoDemux-MODULE := CoDemux
180 CoDemux-SPEC := codemux.spec
181 CoDemux-RPMBUILD := sudo bash ./rpmbuild.sh
188 mysql-MODULE := mysql
189 mysql-SPEC := mysql.spec
196 ulogd-MODULE := ulogd
197 ulogd-SPEC := ulogd.spec
200 ulogd: kernel proper #mysql
206 PlanetFlow-MODULE := PlanetFlow
207 PlanetFlow-RPMFLAGS := --define "distroname $(DISTRO)" --define "distrorelease $(RELEASE)"
208 PlanetFlow-SPEC := netflow.spec
214 # PlanetLab Mom: Cleans up your mess
218 Mom-SPEC := pl_mom.spec
225 iptables-MODULE := iptables
226 iptables-SPEC := iptables.spec
235 iproute-MODULE := iproute2
236 iproute-SPEC := iproute.spec
240 # kexec-tools: DEPRECATE
242 # [marc] use FC6+ release
245 #kexec-tools-MODULE := kexec-tools
246 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
252 # [marc] deprecate with proper
255 util-python-MODULE := util-python
256 util-python-SPEC := util-python.spec
259 # proper uses scripts in util-python for building
266 vsys-SPEC := vsys.spec
267 ifeq ($(DISTRO),"Fedora")
278 PLCAPI-MODULE := PLCAPI
279 PLCAPI-SPEC := PLCAPI.spec
287 PLCWWW-SPEC := PLCWWW.spec
294 VserverReference-MODULE := VserverReference build
295 VserverReference-SPEC := vserver-reference.spec
296 # Package must be built as root
297 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
298 ALL += VserverReference
300 # vserver-reference may require current packages
301 vserver-reference: $(filter-out vserver-reference,$(ALL))
307 BootManager-MODULE := BootManager build
308 BootManager-SPEC := bootmanager.spec
309 # Package must be built as root
310 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
313 # BootManager requires current packages
314 BootManager: $(filter-out BootManager,$(ALL))
316 # ...and the yum manifest
317 BootManager: RPMS/yumgroups.xml
323 BootCD-MODULE := BootCD BootManager build
324 BootCD-SPEC := bootcd.spec
325 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
328 # BootCD requires current packages
329 # BootCD: $(filter-out BootCD,$(ALL))
335 MyPLC-MODULE := MyPLC build WWW
336 MyPLC-SPEC := myplc.spec
337 # Package must be built as root
338 MyPLC-RPMBUILD := sudo bash ./rpmbuild.sh
341 # MyPLC may require current packages
342 MyPLC: $(filter-out MyPLC,$(ALL))
344 # ...and the yum manifest
345 MyPLC: RPMS/yumgroups.xml
352 MyPLC-native-MODULE := MyPLC build WWW
353 MyPLC-native-SPEC := myplc-native.spec
354 # Package must be built as root
355 MyPLC-native-RPMBUILD := sudo bash ./rpmbuild.sh
358 # MyPLC may require current packages
359 MyPLC-native: $(filter-out MyPLC,$(ALL))
361 # ...and the yum manifest
362 MyPLC-native: RPMS/yumgroups.xml
365 # MyPLC development environment
368 MyPLC-devel-MODULE := MyPLC build
369 MyPLC-devel-SPEC := myplc-devel.spec
370 # Package must be built as root
371 MyPLC-devel-RPMBUILD := sudo bash ./rpmbuild.sh
375 # MyPLC native development environment
378 MyPLC-devel-native-MODULE := MyPLC
379 MyPLC-devel-native-RPMFLAGS := --define "distroname $(DISTRO)" --define "distrorelease $(RELEASE)"
380 MyPLC-devel-native-SPEC := myplc-devel-native.spec
381 ALL += MyPLC-devel-native
386 # [daniel] wait for latest Fedora release
387 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
388 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
391 libnl-MODULE := libnl
392 libnl-SPEC := libnl.spec
398 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
400 #XXX We need to rethink this installation support for several reasons:
401 # 1) it is pldistro specific
402 # 2) may involve installing files for different node groups (e.g., alpha, beta, etc.)
403 # 3) may involve N rpm repositories to where it should be uploaded
405 # Not clear to me at all that this should be incorporated into a
406 # Makefile at all. Instead it should be something that gets wrapped
407 # into a myplc (sub) rpm package and then is installed by that way.
413 # Upload packages to boot server
414 SERVERA := build@boot1.planet-lab.org
415 SERVERB := build@boot2.planet-lab.org
416 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
418 # Put nightly alpha builds in a subdirectory
420 ARCHIVE := $(ARCHIVE)/planetlab-alpha
421 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
426 @echo make install is only meant to be called from ./build.sh
428 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
429 # Sign all RPMS. setsid detaches rpm from the terminal,
430 # allowing the (hopefully blank) GPG password to be entered
431 # from stdin instead of /dev/tty. Obviously, the build server
434 --define "_signature gpg" \
435 --define "_gpg_path /etc/planetlab" \
436 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
437 --resign RPMS/*/*.rpm
441 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
442 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
444 # Create package manifest
445 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
446 # Update yum metadata
447 yum-arch RPMS >/dev/null
448 createrepo -g yumgroups.xml RPMS >/dev/null
449 # Populate repository
451 --exclude '*-debuginfo-*' \
452 --recursive --links --perms --times --group --compress --rsh=ssh \
453 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
455 --exclude '*-debuginfo-*' \
456 --recursive --links --perms --times --group --compress --rsh=ssh \
457 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
459 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
460 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
461 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
463 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
464 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
465 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \