Revert to 1.30
[build.git] / planetlab.mk
index 47836c6..daef499 100644 (file)
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2003-2006 The Trustees of Princeton University
 #
-# $Id$
+# $Id: planetlab.mk,v 1.45.2.7 2007/02/09 01:34:38 mlhuang Exp $
 #
 
 #
 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
 TAG := HEAD
 
+# Check if a tag has been checked out
+ifneq ($(wildcard CVS/Root),)
+# Check if we are able to access CVS
+CVSTAG := $(shell cvs status planetlab.mk 2>/dev/null | sed -ne 's/[[:space:]]*Sticky Tag:[[:space:]]*\([^[:space:]]*\).*/\1/p')
+ifneq ($(CVSTAG),)
+CVSROOT := $(shell cat CVS/Root)
+ifeq ($(CVSTAG),(none))
+TAG := HEAD
+else
+TAG := $(CVSTAG)
+endif
+endif
+endif
+
 #
 # kernel
 #
@@ -56,35 +70,9 @@ vnet: kernel
 
 util-vserver-MODULE := util-vserver
 util-vserver-SPEC := util-vserver/util-vserver.spec
+util-vserver-RPMFLAGS:= --without dietlibc
 ALL += util-vserver
 
-#
-# lkcdutils
-#
-
-lkcdutils-MODULE := lkcdutils
-lkcdutils-SPEC := lkcdutils/spec/lkcdutils.spec
-ALL += lkcdutils
-
-# Build kernel first so we can bootstrap off of its build
-lkcdutils: kernel
-
-#
-# yum
-#
-
-yum-MODULE := yum
-yum-SPEC := yum/yum.spec
-ALL += yum
-
-#
-# ksymoops
-#
-
-ksymoops-MODULE := ksymoops
-ksymoops-SPEC := ksymoops/ksymoops.spec
-ALL += ksymoops
-
 #
 # PlanetLabAccounts
 #
@@ -153,9 +141,9 @@ ALL += PlanetLabID
 # Node Manager
 #
 
-sidewinder-MODULE := sidewinder
-sidewinder-SPEC := sidewinder/sidewinder.spec
-ALL += sidewinder
+NodeManager-MODULE := NodeManager
+NodeManager-SPEC := NodeManager/NodeManager.spec
+ALL += NodeManager
 
 #
 # pl_sshd
@@ -165,14 +153,6 @@ pl_sshd-MODULE := pl_sshd
 pl_sshd-SPEC := pl_sshd/pl_sshd.spec
 ALL += pl_sshd
 
-#
-# Resource Management Tools
-#
-
-resman-MODULE := resman
-resman-SPEC := resman/resman.spec
-ALL += resman
-
 #
 # libhttpd++: 
 #
@@ -191,6 +171,14 @@ ALL += proper
 
 proper: libhttpd++
 
+#
+# MySQL
+#
+
+mysql-MODULE := mysql
+mysql-SPEC := mysql/mysql.spec
+ALL += mysql
+
 #
 # ulogd
 #
@@ -199,7 +187,7 @@ ulogd-MODULE := ulogd
 ulogd-SPEC := ulogd/ulogd.spec
 ALL += ulogd
 
-ulogd: kernel proper
+ulogd: kernel proper mysql
 
 #
 # netflow
@@ -209,6 +197,8 @@ netflow-MODULE := netflow
 netflow-SPEC := netflow/netflow.spec
 ALL += netflow
 
+netflow: mysql
+
 #
 # PlanetLab Mom: Cleans up your mess
 #
@@ -243,14 +233,6 @@ kexec-tools-MODULE := kexec-tools
 kexec-tools-SPEC := kexec-tools/kexec-tools.spec
 ALL += kexec-tools
 
-#
-# dhcp
-#
-
-dhcp-MODULE := dhcp
-dhcp-SPEC := dhcp/dhcp.spec
-ALL += dhcp
-
 #
 # util-python
 #
@@ -262,14 +244,15 @@ ALL += util-python
 # proper and util-vserver both use scripts in util-python for building
 proper: util-python
 util-vserver: util-python
+PlanetLabAuth: util-python
 
 #
-# plcapilib
+# PLCAPI
 #
 
-plcapilib-MODULE := plcmdline
-plcapilib-SPEC := plcmdline/plcapilib.spec
-ALL += plcapilib
+PLCAPI-MODULE := new_plc_api
+PLCAPI-SPEC := new_plc_api/PLCAPI.spec
+ALL += PLCAPI
 
 #
 # vserver-reference
@@ -288,7 +271,7 @@ vserver-reference: $(filter-out vserver-reference,$(ALL))
 # bootmanager
 #
 
-bootmanager-MODULE := bootmanager
+bootmanager-MODULE := bootmanager build
 bootmanager-SPEC := bootmanager/bootmanager.spec
 bootmanager-RPMBUILD := sudo rpmbuild
 ALL += bootmanager
@@ -303,8 +286,8 @@ bootmanager: RPMS/yumgroups.xml
 # bootcd
 #
 
-bootcd-MODULE := bootcd_v3 build bootmanager
-bootcd-SPEC := bootcd_v3/bootcd.spec
+bootcd-MODULE := bootcd build bootmanager
+bootcd-SPEC := bootcd/bootcd.spec
 bootcd-RPMBUILD := sudo rpmbuild
 ALL += bootcd
 
@@ -315,7 +298,7 @@ bootcd: $(filter-out bootcd,$(ALL))
 # MyPLC
 #
 
-myplc-MODULE := myplc build pl_db plc_api 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
@@ -327,18 +310,28 @@ myplc: $(filter-out myplc,$(ALL))
 # ...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 rpmbuild
+ALL += myplc-devel
+
 #
 # Installation rules
 # 
 
 # Upload packages to boot server
 SERVER := build@boot.planet-lab.org
-ARCHIVE := /var/www/html/install-rpms/archive
+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:
@@ -348,26 +341,35 @@ install:
 ifeq ($(BASE),)
        @echo make install is only meant to be called from ./build.sh
 else
+ifneq ($(wildcard /etc/planetlab/secring.gpg),)
+        # Sign all RPMS. setsid detaches rpm from the terminal,
+        # allowing the (hopefully blank) GPG password to be entered
+        # from stdin instead of /dev/tty. Obviously, the build server
+        # should be secure.
+       echo | setsid rpm \
+       --define "_signature gpg" \
+       --define "_gpg_path /etc/planetlab" \
+       --define "_gpg_name PlanetLab <info@planet-lab.org>" \
+       --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
 endif
         # Create package manifest
-       sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/SRPMS" SRPMS > SRPMS/packages.xml
+       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 $(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/ $(SERVER):$(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) ; \
+           ssh $(SERVER) ln -nsf $(ARCHIVE)/$(BASE) $(REPOS) ; \
        fi
 endif
 endif