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.36 2006/12/18 05:18:44 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-MODULE := linux-2.6
53 kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
61 vnet-SPEC := vnet/vnet.spec
64 # Build kernel first so we can bootstrap off of its build
71 madwifi-ng-MODULE := madwifi-ng
72 madwifi-ng-SPEC := madwifi-ng/madwifi.spec
80 ivtv-SPEC := ivtv/ivtv.spec
87 util-vserver-MODULE := util-vserver
88 util-vserver-SPEC := util-vserver/util-vserver.spec
96 yum-SPEC := yum/yum.spec
103 PlanetLabAccounts-MODULE := PlanetLabAccounts
104 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
105 ALL += PlanetLabAccounts
111 NodeUpdate-MODULE := NodeUpdate
112 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
119 PlanetLabConf-MODULE := PlanetLabConf
120 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
128 ipod-SPEC := ipod/ipod.spec
136 sudo-SPEC := sudo/planetlab_sudo.spec
143 pycurl-MODULE := pycurl
144 pycurl-SPEC := pycurl/pycurl.spec
151 BootServerRequest-MODULE := BootServerRequest
152 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
153 ALL += BootServerRequest
159 PlanetLabID-MODULE := PlanetLabID
160 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
167 NodeManager-MODULE := NodeManager
168 NodeManager-SPEC := NodeManager/NodeManager.spec
175 pl_sshd-MODULE := pl_sshd
176 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
183 libhttpd++-MODULE := libhttpd++
184 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
188 # Proper: Privileged Operations Service
191 proper-MODULE := proper
192 proper-SPEC := proper/proper.spec
201 mysql-MODULE := mysql
202 mysql-SPEC := mysql/mysql.spec
209 ulogd-MODULE := ulogd
210 ulogd-SPEC := ulogd/ulogd.spec
213 ulogd: kernel proper mysql
219 netflow-MODULE := netflow
220 netflow-SPEC := netflow/netflow.spec
226 # PlanetLab Mom: Cleans up your mess
229 pl_mom-MODULE := pl_mom
230 pl_mom-SPEC := pl_mom/pl_mom.spec
237 iptables-MODULE := iptables
238 iptables-SPEC := iptables/iptables.spec
247 iproute-MODULE := iproute2
248 iproute-SPEC := iproute2/iproute.spec
255 kexec-tools-MODULE := kexec-tools
256 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
264 dhcp-SPEC := dhcp/dhcp.spec
271 util-python-MODULE := util-python
272 util-python-SPEC := util-python/util-python.spec
275 # proper and util-vserver both use scripts in util-python for building
277 util-vserver: util-python
278 PlanetLabAuth: util-python
284 PlanetLabAuth-MODULE := pl_auth
285 PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
292 plcapilib-MODULE := plcmdline
293 plcapilib-SPEC := plcmdline/plcapilib.spec
300 PLCAPI-MODULE := new_plc_api
301 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
308 vserver-reference-MODULE := vserver-reference build
309 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
310 # Package must be built as root
311 vserver-reference-RPMBUILD := sudo rpmbuild
312 ALL += vserver-reference
314 # vserver-reference may require current packages
315 vserver-reference: $(filter-out vserver-reference,$(ALL))
321 bootmanager-MODULE := bootmanager build
322 bootmanager-SPEC := bootmanager/bootmanager.spec
323 bootmanager-RPMBUILD := sudo rpmbuild
326 # bootmanager requires current packages
327 bootmanager: $(filter-out bootmanager,$(ALL))
329 # ...and the yum manifest
330 bootmanager: RPMS/yumgroups.xml
336 bootcd-MODULE := bootcd build bootmanager
337 bootcd-SPEC := bootcd/bootcd.spec
338 bootcd-RPMBUILD := sudo rpmbuild
341 # bootcd requires current packages
342 bootcd: $(filter-out bootcd,$(ALL))
348 myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
349 myplc-SPEC := myplc/myplc.spec
350 # Package must be built as root
351 myplc-RPMBUILD := sudo rpmbuild
354 # MyPLC may require current packages
355 myplc: $(filter-out myplc,$(ALL))
357 # ...and the yum manifest
358 myplc: RPMS/yumgroups.xml
364 # Upload packages to boot server
365 SERVER := build@boot.planet-lab.org
366 ARCHIVE := /var/www/html/install-rpms/archive
368 # Put nightly alpha builds in a subdirectory
370 ARCHIVE := $(ARCHIVE)/planetlab-alpha
371 REPOS := /var/www/html/install-rpms/planetlab-alpha
375 install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
379 @echo make install is only meant to be called from ./build.sh
381 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
382 # Sign all RPMS. setsid detaches rpm from the terminal,
383 # allowing the (hopefully blank) GPG password to be entered
384 # from stdin instead of /dev/tty. Obviously, the build server
387 --define "_signature gpg" \
388 --define "_gpg_path /etc/planetlab" \
389 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
390 --resign RPMS/*/*.rpm SRPMS/*.rpm
394 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
396 # Create package manifest
397 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
398 # Populate repository
399 ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
400 rsync --delete --links --perms --times --group --compress --rsh=ssh \
401 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*.rpm))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
402 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
403 ssh $(SERVER) createrepo -g yumgroups.xml $(ARCHIVE)/$(BASE)/RPMS >/dev/null
404 rsync --delete --links --perms --times --group --compress --rsh=ssh \
405 $(wildcard SRPMS/*.rpm) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
406 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
407 ssh $(SERVER) createrepo $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
409 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
410 if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
411 ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \