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.65 2007/08/22 14:41:32 mef 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
34 # Check if a tag has been checked out
35 ifneq ($(wildcard CVS/Root),)
36 # Check if we are able to access CVS
37 CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
39 CVSROOT := $(shell cat CVS/Root)
40 ifeq ($(CVSTAG),(none))
52 # Figure out whether we are building on i386 or x86_64 host
53 HOSTARCH := $(shell uname -i)
55 kernel-$(HOSTARCH)-MODULE := linux-2.6
56 kernel-$(HOSTARCH)-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
57 ifeq ($(HOSTARCH),i386)
58 kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
60 kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
63 ALL += kernel-$(HOSTARCH)
65 kernel-clean: kernel-$(HOSTARCH)-clean
66 kernel: kernel-$(HOSTARCH)
72 madwifi-ng-MODULE := madwifi-ng
73 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
76 # Build kernel first so we can bootstrap off of its build
84 ivtv-SPEC := ivtv/ivtv.spec
91 util-vserver-MODULE := util-vserver
92 util-vserver-SPEC := util-vserver/util-vserver.spec
93 util-vserver-RPMFLAGS:= --without dietlibc
100 PlanetLabAccounts-MODULE := PlanetLabAccounts
101 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
102 ALL += PlanetLabAccounts
108 NodeUpdate-MODULE := NodeUpdate
109 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
116 PlanetLabConf-MODULE := PlanetLabConf
117 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
125 ipod-SPEC := ipod/ipod.spec
133 sudo-SPEC := sudo/planetlab_sudo.spec
140 pycurl-MODULE := pycurl
141 pycurl-SPEC := pycurl/pycurl.spec
148 BootServerRequest-MODULE := BootServerRequest
149 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
150 ALL += BootServerRequest
156 PlanetLabID-MODULE := PlanetLabID
157 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
164 NodeManager-MODULE := NodeManager
165 NodeManager-SPEC := NodeManager/NodeManager.spec
172 pl_sshd-MODULE := pl_sshd
173 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
180 libhttpd++-MODULE := libhttpd++
181 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
185 # Proper: Privileged Operations Service
188 proper-MODULE := proper
189 proper-SPEC := proper/proper.spec
190 proper-RPMBUILD := sudo sh .rpmbuild.sh
196 # CoDemux: Port 80 demux
199 codemux-MODULE := codemux
200 codemux-SPEC := codemux/codemux.spec
207 mysql-MODULE := mysql
208 mysql-SPEC := mysql/mysql.spec
215 ulogd-MODULE := ulogd
216 ulogd-SPEC := ulogd/ulogd.spec
219 ulogd: kernel proper #mysql
225 netflow-MODULE := netflow
226 netflow-SPEC := netflow/netflow.spec
232 # PlanetLab Mom: Cleans up your mess
235 pl_mom-MODULE := pl_mom
236 pl_mom-SPEC := pl_mom/pl_mom.spec
243 iptables-MODULE := iptables
244 iptables-SPEC := iptables/iptables.spec
253 iproute-MODULE := iproute2
254 iproute-SPEC := iproute2/iproute.spec
261 kexec-tools-MODULE := kexec-tools
262 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
269 util-python-MODULE := util-python
270 util-python-SPEC := util-python/util-python.spec
273 # proper and util-vserver both use scripts in util-python for building
275 util-vserver: util-python
276 PlanetLabAuth: util-python
282 PLCAPI-MODULE := new_plc_api
283 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
290 vserver-reference-MODULE := vserver-reference build
291 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
292 # Package must be built as root
293 vserver-reference-RPMBUILD := sudo sh .rpmbuild.sh
294 ALL += vserver-reference
296 # vserver-reference may require current packages
297 vserver-reference: $(filter-out vserver-reference,$(ALL))
303 bootmanager-MODULE := bootmanager build
304 bootmanager-SPEC := bootmanager/bootmanager.spec
305 bootmanager-RPMBUILD := sudo sh .rpmbuild.sh
308 # bootmanager requires current packages
309 bootmanager: $(filter-out bootmanager,$(ALL))
311 # ...and the yum manifest
312 bootmanager: RPMS/yumgroups.xml
318 bootcd-MODULE := bootcd build bootmanager
319 bootcd-SPEC := bootcd/bootcd.spec
320 bootcd-RPMBUILD := sudo sh .rpmbuild.sh
323 # bootcd requires current packages
324 bootcd: $(filter-out bootcd,$(ALL))
330 myplc-MODULE := build myplc new_plc_www plc/scripts
331 myplc-SPEC := myplc/myplc.spec
332 # Package must be built as root
333 myplc-RPMBUILD := sudo sh .rpmbuild.sh
336 # MyPLC may require current packages
337 myplc: $(filter-out myplc,$(ALL))
339 # ...and the yum manifest
340 myplc: RPMS/yumgroups.xml
343 # MyPLC development environment
346 myplc-devel-MODULE := build myplc
347 myplc-devel-SPEC := myplc/myplc-devel.spec
348 # Package must be built as root
349 myplc-devel-RPMBUILD := sudo sh .rpmbuild.sh
356 libnl-MODULE := libnl
357 libnl-SPEC := libnl/libnl.spec
366 # Upload packages to boot server
367 SERVERA := build@boot1.planet-lab.org
368 SERVERB := build@boot2.planet-lab.org
369 ARCHIVE := /plc/data/var/www/html/install-rpms/archive
371 # Put nightly alpha builds in a subdirectory
373 ARCHIVE := $(ARCHIVE)/planetlab-alpha
374 REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
378 install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
382 @echo make install is only meant to be called from ./build.sh
384 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
385 # Sign all RPMS. setsid detaches rpm from the terminal,
386 # allowing the (hopefully blank) GPG password to be entered
387 # from stdin instead of /dev/tty. Obviously, the build server
390 --define "_signature gpg" \
391 --define "_gpg_path /etc/planetlab" \
392 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
393 --resign RPMS/*/*.rpm
397 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
398 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
400 # Create package manifest
401 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
402 # Update yum metadata
403 yum-arch RPMS >/dev/null
404 createrepo -g yumgroups.xml RPMS >/dev/null
405 # Populate repository
407 --exclude '*-debuginfo-*' \
408 --recursive --links --perms --times --group --compress --rsh=ssh \
409 RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
411 --exclude '*-debuginfo-*' \
412 --recursive --links --perms --times --group --compress --rsh=ssh \
413 RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
415 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
416 if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
417 ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
419 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
420 if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
421 ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \