Added rules to build util-python package
[build.git] / Makefile
index dafdb76..6a5a501 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,38 +1,10 @@
 #
 # PlanetLab RPM generation
 #
-# Copyright (c) 2003  The Trustees of Princeton University (Trustees).
-# All Rights Reserved.
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: 
-# 
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-# 
-#     * Redistributions in binary form must reproduce the above
-#       copyright notice, this list of conditions and the following
-#       disclaimer in the documentation and/or other materials provided
-#       with the distribution.
-# 
-#     * Neither the name of the copyright holder nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# $Id: Makefile,v 1.24 2004/04/13 22:16:32 mlh-pl_rpm Exp $
+# Mark Huang <mlhuang@cs.princeton.edu>
+# Copyright (C) 2003-2005 The Trustees of Princeton University
+#
+# $Id: Makefile,v 1.69 2005/05/04 21:47:39 mlhuang Exp $
 #
 
 # Default target
@@ -41,8 +13,8 @@ all:
 #
 # CVSROOT: CVSROOT to use
 # INITIAL: CVS tag to use for Source0 tarball
-# TAG: CVS tag to patch to
-# MODULE: CVS module name to use
+# TAG: CVS tag to patch to (if not HEAD)
+# MODULE: CVS module name to use (if not HEAD)
 # SPEC: RPM spec file template
 # RPMFLAGS: Miscellaneous RPM flags
 # CVS_RSH: If not ssh
@@ -57,54 +29,58 @@ all:
 # spec file are generated automatically.
 #
 
+# Default values
+INITIAL := HEAD
+TAG := HEAD
+CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+
 #
 # kernel
 #
 
-kernel-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-kernel-INITIAL := linux-2_4_22
-kernel-TAG := HEAD
-kernel-MODULE := linux-2.4
-kernel-SPEC := linux-2.4/scripts/kernel-planetlab.spec
+kernel-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+kernel-MODULE := linux-2.6
+kernel-SPEC := linux-2.6/scripts/kernel-2.6-planetlab.spec
 ALL += kernel
 
 #
-# plkmod
+# vnet
 #
 
-plkmod-CVSROOT := pup-silk@cvs.planet-lab.org:/cvs
-plkmod-INITIAL := HEAD
-plkmod-TAG := HEAD
-plkmod-MODULE := sys-v3
-plkmod-SPEC := sys-v3/rpm/plkmod.spec
-plkmod-RPMFLAGS = --define "kernelver $(shell rpmquery --queryformat '%{VERSION}-%{RELEASE}\n' --specfile SPECS/$(notdir $(kernel-SPEC)) | head -1)"
-ALL += plkmod
+vnet-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+vnet-MODULE := vnet
+vnet-SPEC := vnet/vnet.spec
+ALL += vnet
 
 # Build kernel first so we can bootstrap off of its build
-plkmod: kernel
+vnet: kernel
 
 #
-# vdk
+# util-vserver
 #
 
-vdk-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-vdk-INITIAL := vdk_918
-vdk-TAG := HEAD
-vdk-MODULE := vdk
-vdk-SPEC := vdk/vtune_driver.spec
-vdk-RPMFLAGS = --define "kernelver $(shell rpmquery --queryformat '%{VERSION}-%{RELEASE}\n' --specfile SPECS/$(notdir $(kernel-SPEC)) | head -1)"
-ALL += vdk
+util-vserver-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+util-vserver-MODULE := util-vserver
+util-vserver-SPEC := util-vserver/util-vserver.spec
+ALL += util-vserver
 
 # Build kernel first so we can bootstrap off of its build
-vdk: kernel
+util-vserver: kernel
+
+#
+# vserver-reference
+#
+
+vserver-reference-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+vserver-reference-MODULE := vserver-reference
+vserver-reference-SPEC := vserver-reference/vserver-reference.spec
+ALL += vserver-reference
 
 #
 # lkcdutils
 #
 
-lkcdutils-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-lkcdutils-INITIAL := lkcdutils-4_1
-lkcdutils-TAG := HEAD
+lkcdutils-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
 lkcdutils-MODULE := lkcdutils
 lkcdutils-SPEC := lkcdutils/spec/lkcdutils.spec
 ALL += lkcdutils
@@ -113,248 +89,247 @@ ALL += lkcdutils
 lkcdutils: kernel
 
 #
-# vserver
+# yum
 #
 
-vserver-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-vserver-INITIAL := vserver-0_29
-vserver-TAG := HEAD
-vserver-MODULE := vserver
-vserver-SPEC := vserver/vserver.spec
-ALL += vserver
+yum-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+yum-MODULE := yum
+yum-SPEC := yum/yum.spec
+ALL += yum
 
 #
-# vserver-init
+# ksymoops
 #
 
-vserver-init-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-vserver-init-INITIAL := HEAD
-vserver-init-TAG := HEAD
-vserver-init-MODULE := vserver-init
-vserver-init-SPEC := vserver-init/vserver-init.spec
-ALL += vserver-init
+ksymoops-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+ksymoops-INITIAL := ksymoops-2_4_9
+ksymoops-MODULE := ksymoops
+ksymoops-SPEC := ksymoops/ksymoops.spec
+ALL += ksymoops
 
 #
-# vr-tools
+# PlanetLabAccounts
 #
 
-vr-tools-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-vr-tools-INITIAL := HEAD
-vr-tools-TAG := HEAD
-vr-tools-MODULE := vr-tools
-vr-tools-SPEC := vr-tools/vr-tools.spec
-ALL += vr-tools
+PlanetLabAccounts-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+PlanetLabAccounts-MODULE := PlanetLabAccounts
+PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
+ALL += PlanetLabAccounts
 
 #
-# vsh
+# NodeUpdate
 #
 
-vsh-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-vsh-INITIAL := bash-2_05
-vsh-TAG := HEAD
-vsh-MODULE := vsh
-vsh-SPEC := vsh/vsh-planetlab.spec
-ALL += vsh
-
-# Build kernel first so we can bootstrap off of its build
-vsh: kernel
+NodeUpdate-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+NodeUpdate-MODULE := NodeUpdate
+NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
+ALL += NodeUpdate
 
 #
-# e2fsprogs
+# PlanetLabConf
 #
 
-e2fsprogs-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-e2fsprogs-INITIAL := e2fsprogs-1_33
-e2fsprogs-TAG := HEAD
-e2fsprogs-MODULE := e2fsprogs
-e2fsprogs-SPEC := e2fsprogs/e2fsprogs.spec
-ALL += e2fsprogs
+PlanetLabConf-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+PlanetLabConf-MODULE := PlanetLabConf
+PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
+ALL += PlanetLabConf
 
 #
-# initscripts
+# PlanetLabKeys
 #
 
-initscripts-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-initscripts-INITIAL := initscripts-7_14
-initscripts-TAG := HEAD
-initscripts-MODULE := initscripts
-initscripts-SPEC := initscripts/initscripts.spec
-ALL += initscripts
+PlanetLabKeys-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+PlanetLabKeys-MODULE := PlanetLabKeys
+PlanetLabKeys-SPEC := PlanetLabKeys/PlanetLabKeys.spec
+ALL += PlanetLabKeys
 
 #
-# cq-tools
+# ipod
 #
 
-cq-tools-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-cq-tools-INITIAL := HEAD
-cq-tools-TAG := HEAD
-cq-tools-MODULE := cq-tools
-cq-tools-SPEC := cq-tools/cq-tools.spec
-ALL += cq-tools
+ipod-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+ipod-MODULE := ipod
+ipod-SPEC := ipod/ipod.spec
+ALL += ipod
 
 #
-# yum
+# sudo
 #
 
-yum-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-yum-INITIAL := YUM_2_0_3
-yum-TAG := HEAD
-yum-MODULE := yum
-yum-SPEC := yum/yum.spec
-ALL += yum
+sudo-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+sudo-MODULE := sudo
+sudo-SPEC := sudo/planetlab_sudo.spec
+ALL += sudo
 
 #
-# ksymoops
+# pycurl
 #
 
-ksymoops-CVSROOT := pup-pl_kernel@cvs.planet-lab.org:/cvs
-ksymoops-INITIAL := ksymoops-2_4_9
-ksymoops-TAG := HEAD
-ksymoops-MODULE := ksymoops
-ksymoops-SPEC := ksymoops/ksymoops.spec
-ALL += ksymoops
+pycurl-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+pycurl-MODULE := pycurl
+pycurl-SPEC := pycurl/pycurl.spec
+ALL += pycurl
 
 #
-# PlanetLabAccounts
+# BootServerRequest
 #
 
-PlanetLabAccounts-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-PlanetLabAccounts-INITIAL := HEAD
-PlanetLabAccounts-TAG := HEAD
-PlanetLabAccounts-MODULE := PlanetLabAccounts
-PlanetLabAccounts-SPEC := PlanetLabAccounts/PlanetLabAccounts.spec
-ALL += PlanetLabAccounts
+BootServerRequest-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+BootServerRequest-MODULE := BootServerRequest
+BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
+ALL += BootServerRequest
 
 #
-# MAKEDEV
+# PlanetLabID
 #
 
-MAKEDEV-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-MAKEDEV-INITIAL := MAKEDEV_3_2_2
-MAKEDEV-TAG := HEAD
-MAKEDEV-MODULE := MAKEDEV
-MAKEDEV-SPEC := MAKEDEV/MAKEDEV.spec
-ALL += MAKEDEV
+PlanetLabID-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+PlanetLabID-MODULE := PlanetLabID
+PlanetLabID-SPEC := PlanetLabID/PlanetLabID.spec
+ALL += PlanetLabID
 
 #
-# NodeUpdate
+# Node Manager
 #
 
-NodeUpdate-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-NodeUpdate-INITIAL := HEAD
-NodeUpdate-TAG := HEAD
-NodeUpdate-MODULE := NodeUpdate
-NodeUpdate-SPEC := NodeUpdate/NodeUpdate.spec
-ALL += NodeUpdate
+sidewinder-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+sidewinder-MODULE := sidewinder
+sidewinder-SPEC := sidewinder/sidewinder.spec
+ALL += sidewinder
 
 #
-# PlanetLabConf
+# pl_sshd
 #
 
-PlanetLabConf-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-PlanetLabConf-INITIAL := HEAD
-PlanetLabConf-TAG := HEAD
-PlanetLabConf-MODULE := PlanetLabConf
-PlanetLabConf-SPEC := PlanetLabConf/PlanetLabConf.spec
-ALL += PlanetLabConf
+pl_sshd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+pl_sshd-MODULE := pl_sshd
+pl_sshd-SPEC := pl_sshd/pl_sshd.spec
+ALL += pl_sshd
 
 #
-# PlanetLabKeys
+# Resource Management Tools
 #
 
-PlanetLabKeys-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-PlanetLabKeys-INITIAL := HEAD
-PlanetLabKeys-TAG := HEAD
-PlanetLabKeys-MODULE := PlanetLabKeys
-PlanetLabKeys-SPEC := PlanetLabKeys/PlanetLabKeys.spec
-ALL += PlanetLabKeys
+resman-CVSROOT := :pserver:anon@build.planet-lab.org:/cvs
+resman-MODULE := resman
+resman-SPEC := resman/resman.spec
+ALL += resman
 
 #
-# BWLimit
+# Proper: Privileged Operations Service
 #
 
-BWLimit-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-BWLimit-INITIAL := HEAD
-BWLimit-TAG := HEAD
-BWLimit-MODULE := BWLimit
-BWLimit-SPEC := BWLimit/BWLimit.spec
-ALL += BWLimit
+proper-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+proper-MODULE := proper
+proper-SPEC := proper/proper.spec
+ALL += proper
 
 #
-# perl-IO-Stty
+# ulogd
 #
 
-perl-IO-Stty-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-perl-IO-Stty-INITIAL := PERL-IO-STTY_0_2
-perl-IO-Stty-TAG := HEAD
-perl-IO-Stty-MODULE := perl-IO-Stty
-perl-IO-Stty-SPEC := perl-IO-Stty/perl-IO-Stty.spec
-ALL += perl-IO-Stty
+ulogd-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+ulogd-MODULE := ulogd
+ulogd-SPEC := ulogd/ulogd.spec
+ALL += ulogd
+
+ulogd: kernel proper
 
 #
-# ipod
+# netflow
 #
 
-ipod-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-ipod-INITIAL := HEAD
-ipod-TAG := HEAD
-ipod-MODULE := ipod
-ipod-SPEC := ipod/ipod.spec
-ALL += ipod
+netflow-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+netflow-MODULE := netflow
+netflow-SPEC := netflow/netflow.spec
+ALL += netflow
 
 #
-# sudo
+# PlanetLab Mom: Cleans up your mess
 #
 
-sudo-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-sudo-INITIAL := HEAD
-sudo-TAG := HEAD
-sudo-MODULE := sudo
-sudo-SPEC := sudo/planetlab_sudo.spec
-ALL += sudo
+pl_mom-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+pl_mom-MODULE := pl_mom
+pl_mom-SPEC := pl_mom/pl_mom.spec
+ALL += pl_mom
 
 #
-# blacklist
+# iptables
 #
 
-blacklist-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-blacklist-INITIAL := HEAD
-blacklist-TAG := HEAD
-blacklist-MODULE := blacklist
-blacklist-SPEC := blacklist/PlanetLab-blacklist.spec
-ALL += blacklist
+iptables-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+iptables-MODULE := iptables
+iptables-SPEC := iptables/iptables.spec
+ALL += iptables
+
+iptables: kernel
 
 #
-# httpd
+# kexec-tools
 #
 
-httpd-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-httpd-INITIAL := HEAD
-httpd-TAG := HEAD
-httpd-MODULE := httpd
-httpd-SPEC := httpd/httpd.spec
-ALL += httpd
+kexec-tools-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+kexec-tools-MODULE := kexec-tools
+kexec-tools-SPEC := kexec-tools/kexec-tools.spec
+ALL += kexec-tools
 
 #
-# BootServerRequest
+# util-python
 #
+util-python-CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+util-python-MODULE := util-python
+util-python-SPEC := util-python/util-python.spec
+ALL += util-python
+
 
-BootServerRequest-CVSROOT := pup-node_pkgs@cvs.planet-lab.org:/cvs
-BootServerRequest-INITIAL := HEAD
-BootServerRequest-TAG := HEAD
-BootServerRequest-MODULE := BootServerRequest
-BootServerRequest-SPEC := BootServerRequest/PLBootServerRequest.spec
-ALL += BootServerRequest
 
 ifeq ($(findstring $(package),$(ALL)),)
 
 # Build all packages
 all: $(ALL)
+        # XXX Should check out a tagged version of yumgroups.xml
+       cvs -d $(CVSROOT) checkout -p alpina/groups/v3_yumgroups.xml > RPMS/yumgroups.xml
+        # Create package manifest
+       sh ./packages.sh -b "http://build.planet-lab.org/$(subst $(HOME)/,,$(shell pwd))/SRPMS" SRPMS > SRPMS/packages.xml
 
 # Recurse
 $(ALL):
        $(MAKE) package=$@
 
+# Upload packages to boot server
+SERVER := build@boot.planet-lab.org
+ARCHIVE := /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
+endif
+
+install:
+ifeq ($(BASE),)
+       @echo make install is only meant to be called from ./build.sh
+else
+ifneq ($(BUILDS),)
+        # Remove old runs
+       echo "cd $(ARCHIVE) && ls -t | sed -n $(BUILDS)~1p | xargs rm -rf" | ssh $(SERVER) /bin/bash -s
+endif
+        # Populate repository
+       ssh $(SERVER) mkdir -p $(ARCHIVE)/$(BASE)/RPMS $(ARCHIVE)/$(BASE)/SRPMS
+       rsync --links --perms --times --group --compress --rsh=ssh \
+           $(sort $(subst -debuginfo,,$(wildcard RPMS/yumgroups.xml RPMS/*/*))) $(SERVER):$(ARCHIVE)/$(BASE)/RPMS/
+       ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/RPMS >/dev/null
+       rsync --links --perms --times --group --compress --rsh=ssh \
+           $(wildcard SRPMS/*) $(SERVER):$(ARCHIVE)/$(BASE)/SRPMS/
+       ssh $(SERVER) yum-arch $(ARCHIVE)/$(BASE)/SRPMS >/dev/null
+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) ; \
+       fi
+endif
+endif
+
 # Remove files generated by this package
 $(foreach package,$(ALL),$(package)-clean): %-clean:
        $(MAKE) package=$* clean
@@ -368,9 +343,9 @@ clean:
 else
 
 # Define variables for Makerules
-CVSROOT := $($(package)-CVSROOT)
-INITIAL := $($(package)-INITIAL)
-TAG := $($(package)-TAG)
+CVSROOT := $(if $($(package)-CVSROOT),$($(package)-CVSROOT),$(CVSROOT))
+INITIAL := $(if $($(package)-INITIAL),$($(package)-INITIAL),$(INITIAL))
+TAG := $(if $($(package)-TAG),$($(package)-TAG),$(TAG))
 MODULE := $($(package)-MODULE)
 SPEC := $($(package)-SPEC)
 RPMFLAGS := $($(package)-RPMFLAGS)