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)-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
63 kernel-$(HOSTARCH)-TAG := HEAD
64 kernel-$(HOSTARCH)-MODULE := linux-2.6
65 kernel-$(HOSTARCH)-SPEC := scripts/kernel-2.6-planetlab.spec
66 ifeq ($(HOSTARCH),i386)
67 kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
69 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
72 ALL += kernel-$(HOSTARCH)
74 kernel-clean: kernel-$(HOSTARCH)-clean
75 kernel: kernel-$(HOSTARCH)
78 ### Why are we building these?? -F
82 ###madwifi-ng-MODULE := madwifi-ng
83 ###madwifi-ng-SPEC := madwifi-ng/madwifi.spec
86 ### Build kernel first so we can bootstrap off of its build
93 ###ivtv-MODULE := ivtv
94 ###ivtv-SPEC := ivtv/ivtv.spec
101 util-vserver-MODULE := util-vserver
102 util-vserver-SPEC := util-vserver.spec
103 util-vserver-RPMFLAGS:= --without dietlibc
110 NodeUpdate-MODULE := NodeUpdate
111 NodeUpdate-SPEC := NodeUpdate.spec
115 # PlanetLabConf: DEPRECATED.
117 # conf_files does the same thing in NM
120 #PlanetLabConf-MODULE := PlanetLabConf
121 #PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
122 #ALL += PlanetLabConf
128 PingOfDeath-MODULE := PingOfDeath
129 PingOfDeath-SPEC := ipod.spec
135 # Added functionality provided by this package to www/PlanetLabConf/sudoers.
139 #sudo-SPEC := sudo/planetlab_sudo.spec
145 # [tony] use FC6+ release
148 #curl_vernum := $(shell printf %d 0x$(shell curl-config --vernum))
149 #pycurl_vernum := $(shell printf %d 0x070d01) # 7.13.1
150 #pycurl_incompatnum := $(shell printf %d 0x071000) # 7.16.0
151 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_vernum) && echo 1),1)
152 #ifeq ($(shell test $(curl_vernum) -ge $(pycurl_incompatnum) && echo 0),1)
153 #pycurl-MODULE := pycurl
154 #pycurl-SPEC := pycurl/pycurl.spec
160 # BootServerRequest: DEPRECATE
162 # Not used by anything.
165 #BootServerRequest-MODULE := BootServerRequest
166 #BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
167 #ALL += BootServerRequest
174 NodeManager-MODULE := NodeManager
175 NodeManager-SPEC := NodeManager.spec
182 pl_sshd-MODULE := pl_sshd
183 pl_sshd-SPEC := pl_sshd.spec
189 # Deprecate when vsys takes over [sapan].
190 # keep in build for proper.
193 libhttpd++-MODULE := libhttpd++
194 libhttpd++-SPEC := libhttpd++.spec
198 # Proper: Privileged Operations Service
201 proper-MODULE := proper
202 proper-SPEC := proper.spec
203 proper-RPMBUILD := sudo bash ./rpmbuild.sh
209 # CoDemux: Port 80 demux
212 CoDemux-MODULE := CoDemux
213 CoDemux-SPEC := codemux.spec
214 CoDemux-RPMBUILD := sudo bash ./rpmbuild.sh
221 mysql-MODULE := mysql
222 mysql-SPEC := mysql.spec
229 ulogd-MODULE := ulogd
230 ulogd-SPEC := ulogd.spec
233 ulogd: kernel proper #mysql
239 NetFlow-MODULE := NetFlow
240 NetFlow-SPEC := netflow.spec
246 # PlanetLab Mom: Cleans up your mess
250 Mom-SPEC := pl_mom.spec
257 iptables-MODULE := iptables
258 iptables-SPEC := iptables.spec
267 iproute-MODULE := iproute2
268 iproute-SPEC := iproute.spec
272 # kexec-tools: DEPRECATE
274 # [marc] use FC6+ release
277 #kexec-tools-MODULE := kexec-tools
278 #kexec-tools-SPEC := kexec-tools/kexec-tools.spec
284 # [marc] deprecate server.py
286 # I dont know what the above means... Daniel says we need to seperate util-vserver from
287 # pl specific utilities (vuseradd, etc) which may or may not include vserver.py. Until then,
288 # I'm keeping this in the build. -F
291 util-python-MODULE := util-python
292 util-python-SPEC := util-python.spec
295 # proper and util-vserver both use scripts in util-python for building
296 # [dhozac] Not anymore. util-vserver uses automake and no longer needs util-python
299 #util-vserver: util-python
300 #PlanetLabAuth: util-python
303 # vsys does not compile when ocaml rpm is installed. Need to fix include path
304 # so that it compiles. Sapan will need to fix this.
309 vsys-SPEC := vsys.spec
316 PLCAPI-MODULE := PLCAPI
317 PLCAPI-SPEC := PLCAPI.spec
325 PLCWWW-SPEC := PLCWWW.spec
332 VserverReference-MODULE := VserverReference build
333 VserverReference-SPEC := vserver-reference.spec
334 # Package must be built as root
335 VserverReference-RPMBUILD := sudo bash ./rpmbuild.sh
336 ALL += VserverReference
338 # vserver-reference may require current packages
339 vserver-reference: $(filter-out vserver-reference,$(ALL))
345 BootManager-MODULE := BootManager build
346 BootManager-SPEC := BootManager.spec
347 BootManager-RPMBUILD := sudo bash ./rpmbuild.sh
350 # BootManager requires current packages
351 BootManager: $(filter-out BootManager,$(ALL))
353 # ...and the yum manifest
354 BootManager: RPMS/yumgroups.xml
360 BootCD-MODULE := BootCD build BootManager
361 BootCD-SPEC := bootcd.spec
362 BootCD-RPMBUILD := sudo bash ./rpmbuild.sh
365 # BootCD requires current packages
366 # BootCD: $(filter-out BootCD,$(ALL))
372 MyPLC-MODULE := MyPLC build WWW
373 MyPLC-SPEC := myplc.spec
374 # Package must be built as root
375 MyPLC-RPMBUILD := sudo bash ./rpmbuild.sh
378 # MyPLC may require current packages
379 #MyPLC: $(filter-out MyPLC,$(ALL))
381 # ...and the yum manifest
382 MyPLC: RPMS/yumgroups.xml
385 # MyPLC development environment
388 myplc-devel-MODULE := MyPLC build
389 myplc-devel-SPEC := myplc-devel.spec
390 # Package must be built as root
391 myplc-devel-RPMBUILD := sudo bash ./rpmbuild.sh
398 myplc-native-MODULE := MyPLC build
399 myplc-native-SPEC := myplc-native.spec
400 # Package must be built as root
401 myplc-native-RPMBUILD := sudo bash ./rpmbuild.sh
404 # MyPLC may require current packages
405 myplc-native: $(filter-out MyPLC,$(ALL))
407 # ...and the yum manifest
408 myplc-native: RPMS/yumgroups.xml
415 myplc-devel-native-MODULE := MyPLC
416 myplc-devel-native-SPEC := myplc-devel-native.spec
417 ALL += myplc-devel-native
422 # [daniel] wait for latest Fedora release
423 # (03:29:46 PM) daniel_hozac: interfacing with the kernel directly when dealing with netlink was fugly, so... i had to find something nicer.
424 # (03:29:53 PM) daniel_hozac: the one in Fedora is lacking certain APIs i need.
427 libnl-MODULE := libnl
428 libnl-SPEC := libnl.spec
437 # Upload packages to boot server
438 SERVERA := build@boot1.planet-lab.org
439 SERVERB := build@boot2.planet-lab.org
440 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
442 # Put nightly alpha builds in a subdirectory
444 ARCHIVE := $(ARCHIVE)/planetlab-alpha
445 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
449 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
453 @echo make install is only meant to be called from ./build.sh
455 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
456 # Sign all RPMS. setsid detaches rpm from the terminal,
457 # allowing the (hopefully blank) GPG password to be entered
458 # from stdin instead of /dev/tty. Obviously, the build server
461 --define "_signature gpg" \
462 --define "_gpg_path /etc/planetlab" \
463 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
464 --resign RPMS/*/*.rpm
468 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
469 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
471 # Create package manifest
472 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
473 # Update yum metadata
474 yum-arch RPMS >/dev/null
475 createrepo -g yumgroups.xml RPMS >/dev/null
476 # Populate repository
478 --exclude '*-debuginfo-*' \
479 --recursive --links --perms --times --group --compress --rsh=ssh \
480 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
482 --exclude '*-debuginfo-*' \
483 --recursive --links --perms --times --group --compress --rsh=ssh \
484 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
486 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
487 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
488 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
490 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
491 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
492 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \