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.42 2007/01/17 15:44:44 mlhuang 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
88 # Build kernel first so we can bootstrap off of its build
96 #ivtv-SPEC := ivtv/ivtv.spec
103 util-vserver-MODULE := util-vserver
104 util-vserver-SPEC := util-vserver/util-vserver.spec
105 util-vserver-RPMFLAGS:= --without dietlibc
113 yum-SPEC := yum/yum.spec
120 PlanetLabAccounts-MODULE := PlanetLabAccounts
121 PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
122 ALL += PlanetLabAccounts
128 NodeUpdate-MODULE := NodeUpdate
129 NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
136 PlanetLabConf-MODULE := PlanetLabConf
137 PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
145 ipod-SPEC := ipod/ipod.spec
153 sudo-SPEC := sudo/planetlab_sudo.spec
160 pycurl-MODULE := pycurl
161 pycurl-SPEC := pycurl/pycurl.spec
168 BootServerRequest-MODULE := BootServerRequest
169 BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
170 ALL += BootServerRequest
176 PlanetLabID-MODULE := PlanetLabID
177 PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
184 NodeManager-MODULE := NodeManager
185 NodeManager-SPEC := NodeManager/NodeManager.spec
192 pl_sshd-MODULE := pl_sshd
193 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
200 libhttpd++-MODULE := libhttpd++
201 libhttpd++-SPEC := libhttpd++/libhttpd++.spec
205 # Proper: Privileged Operations Service
208 proper-MODULE := proper
209 proper-SPEC := proper/proper.spec
218 mysql-MODULE := mysql
219 mysql-SPEC := mysql/mysql.spec
226 ulogd-MODULE := ulogd
227 ulogd-SPEC := ulogd/ulogd.spec
230 ulogd: kernel proper mysql
236 netflow-MODULE := netflow
237 netflow-SPEC := netflow/netflow.spec
243 # PlanetLab Mom: Cleans up your mess
246 pl_mom-MODULE := pl_mom
247 pl_mom-SPEC := pl_mom/pl_mom.spec
254 iptables-MODULE := iptables
255 iptables-SPEC := iptables/iptables.spec
264 iproute-MODULE := iproute2
265 iproute-SPEC := iproute2/iproute.spec
272 kexec-tools-MODULE := kexec-tools
273 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
281 dhcp-SPEC := dhcp/dhcp.spec
288 util-python-MODULE := util-python
289 util-python-SPEC := util-python/util-python.spec
292 # proper and util-vserver both use scripts in util-python for building
294 util-vserver: util-python
295 PlanetLabAuth: util-python
301 PlanetLabAuth-MODULE := pl_auth
302 PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
309 plcapilib-MODULE := plcmdline
310 plcapilib-SPEC := plcmdline/plcapilib.spec
317 PLCAPI-MODULE := new_plc_api
318 PLCAPI-SPEC := new_plc_api/PLCAPI.spec
325 vserver-reference-MODULE := vserver-reference build
326 vserver-reference-SPEC := vserver-reference/vserver-reference.spec
327 # Package must be built as root
328 vserver-reference-RPMBUILD := sudo rpmbuild
329 ALL += vserver-reference
331 # vserver-reference may require current packages
332 vserver-reference: $(filter-out vserver-reference,$(ALL))
338 bootmanager-MODULE := bootmanager build
339 bootmanager-SPEC := bootmanager/bootmanager.spec
340 bootmanager-RPMBUILD := sudo rpmbuild
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/bootcd.spec
355 bootcd-RPMBUILD := sudo rpmbuild
358 # bootcd requires current packages
359 bootcd: $(filter-out bootcd,$(ALL))
365 myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
366 myplc-SPEC := myplc/myplc.spec
367 # Package must be built as root
368 myplc-RPMBUILD := sudo rpmbuild
371 # MyPLC may require current packages
372 myplc: $(filter-out myplc,$(ALL))
374 # ...and the yum manifest
375 myplc: RPMS/yumgroups.xml
381 # Upload packages to boot server
382 SERVER := build@boot.planet-lab.org
383 ARCHIVE := /var/www/html/install-rpms/archive
385 # Put nightly alpha builds in a subdirectory
387 ARCHIVE := $(ARCHIVE)/planetlab-alpha
388 REPOS := /var/www/html/install-rpms/planetlab-alpha
392 install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
396 @echo make install is only meant to be called from ./build.sh
398 ifneq ($(wildcard /etc/planetlab/secring.gpg),)
399 # Sign all RPMS. setsid detaches rpm from the terminal,
400 # allowing the (hopefully blank) GPG password to be entered
401 # from stdin instead of /dev/tty. Obviously, the build server
404 --define "_signature gpg" \
405 --define "_gpg_path /etc/planetlab" \
406 --define "_gpg_name PlanetLab <info@planet-lab.org>" \
407 --resign RPMS/*/*.rpm SRPMS/*.rpm
411 echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
413 # Create package manifest
414 sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
415 # Populate repository
416 ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
417 rsync --delete --links --perms --times --group --compress --rsh=ssh \
418 $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*.rpm))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
419 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
420 ssh $(SERVER) createrepo -g yumgroups.xml $(ARCHIVE)/$(BASE)/RPMS >/dev/null
421 rsync --delete --links --perms --times --group --compress --rsh=ssh \
422 $(wildcard SRPMS/*.rpm) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
423 ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
424 ssh $(SERVER) createrepo $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
426 # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
427 if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
428 ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \