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.39 2006/12/26 21:21:30 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 kernel-x86_64-MODULE := linux-2.6
53 kernel-x86_64-RPMFLAGS:= --target x86_64
54 kernel-x86_64-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
57 kernel-i686-MODULE := linux-2.6
58 kernel-i686-RPMFLAGS:= --target i686
59 kernel-i686-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
62 kernel-i586-MODULE := linux-2.6
63 kernel-i586-RPMFLAGS:= --target i586
64 kernel-i586-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
67 kernel: kernel-i586 kernel-i686
74 vnet-SPEC := vnet/vnet.spec
77 # Build kernel first so we can bootstrap off of its build
84 madwifi-ng-MODULE := madwifi-ng
85 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
93 #ivtv-SPEC := ivtv/ivtv.spec
100 util-vserver-MODULE := util-vserver
101 util-vserver-SPEC := util-vserver/util-vserver.spec
109 yum-SPEC := yum/yum.spec
116 PlanetLabAccounts-MODULE := PlanetLabAccounts
117 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
118 ALL += PlanetLabAccounts
124 NodeUpdate-MODULE := NodeUpdate
125 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
132 PlanetLabConf-MODULE := PlanetLabConf
133 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
141 ipod-SPEC := ipod/ipod.spec
149 sudo-SPEC := sudo/planetlab_sudo.spec
156 pycurl-MODULE := pycurl
157 pycurl-SPEC := pycurl/pycurl.spec
164 BootServerRequest-MODULE := BootServerRequest
165 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
166 ALL += BootServerRequest
172 PlanetLabID-MODULE := PlanetLabID
173 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
180 NodeManager-MODULE := NodeManager
181 NodeManager-SPEC := NodeManager/NodeManager.spec
188 pl_sshd-MODULE := pl_sshd
189 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
196 libhttpd++-MODULE := libhttpd++
197 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
201 # Proper: Privileged Operations Service
204 proper-MODULE := proper
205 proper-SPEC := proper/proper.spec
214 mysql-MODULE := mysql
215 mysql-SPEC := mysql/mysql.spec
222 ulogd-MODULE := ulogd
223 ulogd-SPEC := ulogd/ulogd.spec
226 ulogd: kernel proper mysql
232 netflow-MODULE := netflow
233 netflow-SPEC := netflow/netflow.spec
239 # PlanetLab Mom: Cleans up your mess
242 pl_mom-MODULE := pl_mom
243 pl_mom-SPEC := pl_mom/pl_mom.spec
250 iptables-MODULE := iptables
251 iptables-SPEC := iptables/iptables.spec
260 iproute-MODULE := iproute2
261 iproute-SPEC := iproute2/iproute.spec
268 kexec-tools-MODULE := kexec-tools
269 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
277 dhcp-SPEC := dhcp/dhcp.spec
284 util-python-MODULE := util-python
285 util-python-SPEC := util-python/util-python.spec
288 # proper and util-vserver both use scripts in util-python for building
290 util-vserver: util-python
291 PlanetLabAuth: util-python
297 PlanetLabAuth-MODULE := pl_auth
298 PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
305 plcapilib-MODULE := plcmdline
306 plcapilib-SPEC := plcmdline/plcapilib.spec
313 PLCAPI-MODULE := new_plc_api
314 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
321 vserver-reference-MODULE := vserver-reference build
322 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
323 # Package must be built as root
324 vserver-reference-RPMBUILD := sudo rpmbuild
325 ALL += vserver-reference
327 # vserver-reference may require current packages
328 vserver-reference: $(filter-out vserver-reference,$(ALL))
334 bootmanager-MODULE := bootmanager build
335 bootmanager-SPEC := bootmanager/bootmanager.spec
336 bootmanager-RPMBUILD := sudo rpmbuild
339 # bootmanager requires current packages
340 bootmanager: $(filter-out bootmanager,$(ALL))
342 # ...and the yum manifest
343 bootmanager: RPMS/yumgroups.xml
349 bootcd-MODULE := bootcd build bootmanager
350 bootcd-SPEC := bootcd/bootcd.spec
351 bootcd-RPMBUILD := sudo rpmbuild
354 # bootcd requires current packages
355 bootcd: $(filter-out bootcd,$(ALL))
361 myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
362 myplc-SPEC := myplc/myplc.spec
363 # Package must be built as root
364 myplc-RPMBUILD := sudo rpmbuild
367 # MyPLC may require current packages
368 myplc: $(filter-out myplc,$(ALL))
370 # ...and the yum manifest
371 myplc: RPMS/yumgroups.xml
377 # Upload packages to boot server
378 SERVER := build@boot.planet-lab.org
379 ARCHIVE := /var/www/html/install-rpms/archive
381 # Put nightly alpha builds in a subdirectory
383 ARCHIVE := $(ARCHIVE)/planetlab-alpha
384 REPOS := /var/www/html/install-rpms/planetlab-alpha
388 install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
392 @echo make install is only meant to be called from ./build.sh
394 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
395 # Sign all RPMS. setsid detaches rpm from the terminal,
396 # allowing the (hopefully blank) GPG password to be entered
397 # from stdin instead of /dev/tty. Obviously, the build server
400 --define "_signature gpg" \
401 --define "_gpg_path /etc/planetlab" \
402 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
403 --resign RPMS/*/*.rpm SRPMS/*.rpm
407 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
409 # Create package manifest
410 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
411 # Populate repository
412 ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
413 rsync --delete --links --perms --times --group --compress --rsh=ssh \
414 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*.rpm))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
415 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
416 ssh $(SERVER) createrepo -g yumgroups.xml $(ARCHIVE)/$(BASE)/RPMS >/dev/null
417 rsync --delete --links --perms --times --group --compress --rsh=ssh \
418 $(wildcard SRPMS/*.rpm) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
419 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
420 ssh $(SERVER) createrepo $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
422 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
423 if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
424 ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \