# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2003-2006 The Trustees of Princeton University
#
-# $Id: planetlab.mk,v 1.36 2006/12/18 05:18:44 mef Exp $
+# $Id: planetlab.mk,v 1.64 2007/08/14 16:16:39 faiyaza Exp $
#
#
# kernel
#
-kernel-MODULE := linux-2.6
-kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
-ALL += kernel
+# Figure out whether we are building on i386 or x86_64 host
+HOSTARCH := $(shell uname -i)
-#
-# vnet
-#
+kernel-$(HOSTARCH)-MODULE := linux-2.6
+kernel-$(HOSTARCH)-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
+ifeq ($(HOSTARCH),i386)
+kernel-$(HOSTARCH)-RPMFLAGS:= --target i686
+else
+kernel-$(HOSTARCH)-RPMFLAGS:= --target $(HOSTARCH)
+endif
-vnet-MODULE := vnet
-vnet-SPEC := vnet/vnet.spec
-ALL += vnet
+ALL += kernel-$(HOSTARCH)
-# Build kernel first so we can bootstrap off of its build
-vnet: kernel
+kernel-clean: kernel-$(HOSTARCH)-clean
+kernel: kernel-$(HOSTARCH)
#
# madwifi
madwifi-ng-MODULE := madwifi-ng
madwifi-ng-SPEC := madwifi-ng/madwifi.spec
-ALL += madwifi-ng
+#ALL += madwifi-ng
+
+# Build kernel first so we can bootstrap off of its build
+madwifi-ng: kernel
#
# ivtv
ivtv-MODULE := ivtv
ivtv-SPEC := ivtv/ivtv.spec
-ALL += ivtv
+#ALL += ivtv
#
# util-vserver
util-vserver-MODULE := util-vserver
util-vserver-SPEC := util-vserver/util-vserver.spec
+util-vserver-RPMFLAGS:= --without dietlibc
ALL += util-vserver
-#
-# yum
-#
-
-yum-MODULE := yum
-yum-SPEC := yum/yum.spec
-ALL += yum
-
#
# PlanetLabAccounts
#
proper-MODULE := proper
proper-SPEC := proper/proper.spec
+proper-RPMBUILD := sudo sh .rpmbuild.sh
ALL += proper
proper: libhttpd++
+#
+# CoDemux: Port 80 demux
+#
+
+codemux-MODULE := codemux
+codemux-SPEC := codemux/codemux.spec
+#ALL += codemux
+
#
# MySQL
#
kexec-tools-SPEC := kexec-tools/kexec-tools.spec
ALL += kexec-tools
-#
-# dhcp
-#
-
-dhcp-MODULE := dhcp
-dhcp-SPEC := dhcp/dhcp.spec
-ALL += dhcp
-
#
# util-python
#
util-vserver: util-python
PlanetLabAuth: util-python
-#
-# PlanetLabAuth
-#
-
-PlanetLabAuth-MODULE := pl_auth
-PlanetLabAuth-SPEC := pl_auth/pl_auth.spec
-ALL += PlanetLabAuth
-
-#
-# plcapilib
-#
-
-plcapilib-MODULE := plcmdline
-plcapilib-SPEC := plcmdline/plcapilib.spec
-ALL += plcapilib
-
#
# PLCAPI
#
vserver-reference-MODULE := vserver-reference build
vserver-reference-SPEC := vserver-reference/vserver-reference.spec
# Package must be built as root
-vserver-reference-RPMBUILD := sudo rpmbuild
+vserver-reference-RPMBUILD := sudo sh .rpmbuild.sh
ALL += vserver-reference
# vserver-reference may require current packages
bootmanager-MODULE := bootmanager build
bootmanager-SPEC := bootmanager/bootmanager.spec
-bootmanager-RPMBUILD := sudo rpmbuild
+bootmanager-RPMBUILD := sudo sh .rpmbuild.sh
ALL += bootmanager
# bootmanager requires current packages
bootcd-MODULE := bootcd build bootmanager
bootcd-SPEC := bootcd/bootcd.spec
-bootcd-RPMBUILD := sudo rpmbuild
+bootcd-RPMBUILD := sudo sh .rpmbuild.sh
ALL += bootcd
# bootcd requires current packages
# MyPLC
#
-myplc-MODULE := $(sort $(foreach module,$(ALL),$($(module)-MODULE)) myplc new_plc_www plc/scripts)
+myplc-MODULE := build myplc new_plc_www plc/scripts
myplc-SPEC := myplc/myplc.spec
# Package must be built as root
-myplc-RPMBUILD := sudo rpmbuild
+myplc-RPMBUILD := sudo sh .rpmbuild.sh
ALL += myplc
# MyPLC may require current packages
# ...and the yum manifest
myplc: RPMS/yumgroups.xml
+#
+# MyPLC development environment
+#
+
+myplc-devel-MODULE := build myplc
+myplc-devel-SPEC := myplc/myplc-devel.spec
+# Package must be built as root
+myplc-devel-RPMBUILD := sudo sh .rpmbuild.sh
+ALL += myplc-devel
+
+#
+# libnl
+#
+
+libnl-MODULE := libnl
+libnl-SPEC := libnl/libnl.spec
+ALL += libnl
+
+util-vserver: libnl
+
#
# Installation rules
#
# Upload packages to boot server
-SERVER := build@boot.planet-lab.org
-ARCHIVE := /var/www/html/install-rpms/archive
+SERVERA := build@boot1.planet-lab.org
+SERVERB := build@boot2.planet-lab.org
+ARCHIVE := /plc/data/var/www/html/install-rpms/archive
# Put nightly alpha builds in a subdirectory
ifeq ($(TAG),HEAD)
ARCHIVE := $(ARCHIVE)/planetlab-alpha
-REPOS := /var/www/html/install-rpms/planetlab-alpha
+REPOS := /plc/data/var/www/html/install-rpms/planetlab-alpha
endif
RPMS/yumgroups.xml:
- install -D -m 644 groups/v3_yumgroups.xml RPMS/yumgroups.xml
+ install -D -m 644 groups/v4_yumgroups.xml RPMS/yumgroups.xml
install:
ifeq ($(BASE),)
--define "_signature gpg" \
--define "_gpg_path /etc/planetlab" \
--define "_gpg_name PlanetLab <info@planet-lab.org>" \
- --resign RPMS/*/*.rpm SRPMS/*.rpm
+ --resign RPMS/*/*.rpm
endif
ifneq ($(BUILDS),)
# Remove old runs
- echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
+ echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERA) /bin/bash -s
+ echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVERB) /bin/bash -s
endif
# Create package manifest
sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/RPMS" RPMS > packages.xml
+ # Update yum metadata
+ yum-arch RPMS >/dev/null
+ createrepo -g yumgroups.xml RPMS >/dev/null
# Populate repository
- ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
- rsync --delete --links --perms --times --group --compress --rsh=ssh \
- $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*.rpm))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
- ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
- ssh $(SERVER) createrepo -g yumgroups.xml $(ARCHIVE)/$(BASE)/RPMS >/dev/null
- rsync --delete --links --perms --times --group --compress --rsh=ssh \
- $(wildcard SRPMS/*.rpm) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
- ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
- ssh $(SERVER) createrepo $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
+ rsync \
+ --exclude '*-debuginfo-*' \
+ --recursive --links --perms --times --group --compress --rsh=ssh \
+ RPMS/ $(SERVERA):$(ARCHIVE)/$(BASE)
+ rsync \
+ --exclude '*-debuginfo-*' \
+ --recursive --links --perms --times --group --compress --rsh=ssh \
+ RPMS/ $(SERVERB):$(ARCHIVE)/$(BASE)
ifeq ($(TAG),HEAD)
# Update nightly alpha symlink if it does not exist or is broken, or it is Monday
- if ! ssh $(SERVER) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
- ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE)/RPMS/ $(REPOS) ; \
+ if ! ssh $(SERVERA) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
+ ssh $(SERVERA) ln -nsf archive/$(BASE) $(REPOS) ; \
fi
+ # Update nightly alpha symlink if it does not exist or is broken, or it is Monday
+ if ! ssh $(SERVERB) "[ -e $(REPOS) ] && exit 0 || exit 1" || [ "$(shell date +%A)" = "Monday" ] ; then \
+ ssh $(SERVERB) ln -nsf archive/$(BASE) $(REPOS) ; \
+ fi
+
endif
endif