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
218 mysql-MODULE := mysql
219 mysql-SPEC := mysql.spec
226 ulogd-MODULE := ulogd
227 ulogd-SPEC := ulogd.spec
230 ulogd: kernel proper #mysql
236 NetFlow-MODULE := NetFlow
237 NetFlow-SPEC := netflow.spec
243 # PlanetLab Mom: Cleans up your mess
247 MoM-SPEC := pl_mom.spec
254 iptables-MODULE := iptables
255 iptables-SPEC := iptables.spec
264 iproute-MODULE := iproute2
265 iproute-SPEC := iproute.spec
269 # kexec-tools: DEPRECATE
271 # [marc] use FC6+ release
274 #kexec-tools-MODULE := kexec-tools
275 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
281 # [marc] deprecate server.py
283 # I dont know what the above means... Daniel says we need to seperate util-vserver from
284 # pl specific utilities (vuseradd, etc) which may or may not include vserver.py. Until then,
285 # I'm keeping this in the build. -F
288 util-python-MODULE := util-python
289 util-python-SPEC := util-python.spec
292 # proper and util-vserver both use scripts in util-python for building
293 # [dhozac] Not anymore. util-vserver uses automake and no longer needs util-python
295 #util-vserver: util-python
296 #PlanetLabAuth: util-python
302 vsys-SPEC := vsys.spec
309 PLCAPI-MODULE := PLCAPI
310 PLCAPI-SPEC := PLCAPI.spec
318 PLCWWW-SPEC := PLCWWW.spec
325 VserverReference-MODULE := VserverReference build
326 VserverReference-SPEC := vserver-reference.spec
327 # Package must be built as root
328 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
329 ALL += VserverReference
331 # vserver-reference may require current packages
332 vserver-reference: $(filter-out vserver-reference,$(ALL))
338 BootManager-MODULE := BootManager build
339 BootManager-SPEC := BootManager.spec
340 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
343 # BootManager requires current packages
344 BootManager: $(filter-out BootManager,$(ALL))
346 # ...and the yum manifest
347 BootManager: RPMS/yumgroups.xml
353 BootCD-MODULE := BootCD build bootmanager
354 BootCD-SPEC := BootCD.spec
355 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
358 # BootCD requires current packages
359 BootCD: $(filter-out BootCD,$(ALL))
365 MyPLC-MODULE := MyPLC build new_plc_www plc/scripts
366 MyPLC-SPEC := myplc.spec
367 # Package must be built as root
368 MyPLC-RPMBUILD := sudo bash ./rpmbuild.sh
371 # MyPLC may require current packages
372 MyPLC: $(filter-out MyPLC,$(ALL))
374 # ...and the yum manifest
375 MyPLC: RPMS/yumgroups.xml
378 # MyPLC development environment
381 myplc-devel-MODULE := MyPLC build
382 myplc-devel-SPEC := myplc-devel.spec
383 # Package must be built as root
384 myplc-devel-RPMBUILD := sudo bash ./rpmbuild.sh
391 myplc-native-MODULE := MyPLC build plc/scripts
392 myplc-native-SPEC := myplc-native.spec
393 # Package must be built as root
394 myplc-native-RPMBUILD := sudo bash ./rpmbuild.sh
397 # MyPLC may require current packages
398 myplc-native: $(filter-out MyPLC,$(ALL))
400 # ...and the yum manifest
401 myplc-native: RPMS/yumgroups.xml
408 myplc-devel-native-SVNPATH := https://svn.planet-lab.org/svn/MyPLC/trunk
409 myplc-devel-native-MODULE := MyPLC
410 myplc-devel-native-SPEC := myplc-devel-native.spec
411 ALL += myplc-devel-native
416 # [daniel] wait for latest Fedora release
417 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
418 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
421 libnl-MODULE := libnl
422 libnl-SPEC := libnl.spec
431 # Upload packages to boot server
432 SERVERA := build@boot1.planet-lab.org
433 SERVERB := build@boot2.planet-lab.org
434 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
436 # Put nightly alpha builds in a subdirectory
438 ARCHIVE := $(ARCHIVE)/planetlab-alpha
439 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
443 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
447 @echo make install is only meant to be called from ./build.sh
449 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
450 # Sign all RPMS. setsid detaches rpm from the terminal,
451 # allowing the (hopefully blank) GPG password to be entered
452 # from stdin instead of /dev/tty. Obviously, the build server
455 --define "_signature gpg" \
456 --define "_gpg_path /etc/planetlab" \
457 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
458 --resign RPMS/*/*.rpm
462 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
463 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
465 # Create package manifest
466 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
467 # Update yum metadata
468 yum-arch RPMS >/dev/null
469 createrepo -g yumgroups.xml RPMS >/dev/null
470 # Populate repository
472 --exclude '*-debuginfo-*' \
473 --recursive --links --perms --times --group --compress --rsh=ssh \
474 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
476 --exclude '*-debuginfo-*' \
477 --recursive --links --perms --times --group --compress --rsh=ssh \
478 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
480 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
481 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
482 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
484 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
485 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
486 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \