extracts tag definition
[build.git] / onelab.mk
index 17c69fd..da2bb02 100644 (file)
--- a/onelab.mk
+++ b/onelab.mk
@@ -4,7 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2003-2006 The Trustees of Princeton University
 #
-# $Id: onelab.mk,v 1.2 2007/01/29 09:41:43 thierry Exp $
+# $Id: onelab.mk,v 1.16 2007/03/16 16:07:57 thierry Exp $
 #
 
 #
 # Add to ALL if you want the package built as part of the default set.
 #
 
+####
+# we do not use TAG directly anymore, and let it to HEAD
+# this because we want the rpm's releases to reflect the date even when a tag is used
+# our build script defines COMMON_TAG that the various components are free to use or not
+# COMMON_TAG set from the build script
+
+include onelab-tags.mk
+
 #
 # Default values
 #
 
 CVSROOT := :pserver:anon@cvs.planet-lab.org:/cvs
+# it's useless to set this here because it's overriden on the command line by nightly-build.sh
 TAG := HEAD
 
 # Check if a tag has been checked out
@@ -97,7 +107,7 @@ madwifi-ng: kernel
 
 wireless-tools-MODULE = wireless-tools
 wireless-tools-SPEC := wireless-tools.spec
-wireless-tools-CVSROOT := /cvs
+wireless-tools-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/wireless-tools/tags/29pre14
 ALL += wireless-tools
 
 #
@@ -117,14 +127,6 @@ 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
 #
@@ -285,14 +287,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
 #
@@ -306,28 +300,13 @@ proper: 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
 #
 
 PLCAPI-MODULE := new_plc_api
-PLCAPI-SPEC := new_plc_api/PLCAPI.spec
+PLCAPI-SPEC := PLCAPI.spec
+PLCAPI-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/new_plc_api/trunk
 ALL += PLCAPI
 
 #
@@ -350,6 +329,7 @@ vserver-reference: $(filter-out vserver-reference,$(ALL))
 bootmanager-MODULE := bootmanager build
 bootmanager-SPEC := bootmanager/bootmanager.spec
 bootmanager-RPMBUILD := sudo rpmbuild
+bootmanager-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/bootmanager/trunk
 ALL += bootmanager
 
 # bootmanager requires current packages
@@ -365,6 +345,7 @@ bootmanager: RPMS/yumgroups.xml
 bootcd-MODULE := bootcd build bootmanager
 bootcd-SPEC := bootcd/bootcd.spec
 bootcd-RPMBUILD := sudo rpmbuild
+bootcd-SVNPATH := svn+ssh://build@svn.one-lab.org/svn/bootcd/trunk
 ALL += bootcd
 
 # bootcd requires current packages
@@ -374,7 +355,7 @@ bootcd: $(filter-out bootcd,$(ALL))
 # 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
@@ -402,43 +383,56 @@ myplc: RPMS/yumgroups.xml
 
 # Upload packages to boot server
 SERVER         := root@onelab-plc.inria.fr
-RPMSAREA       := /plc/data/var/www/html/install-rpms/
-BOOTAREA       := /plc/data/var/www/html/boot/
+RPMSAREA       := /var/www/html/install-rpms/
+BOOTAREA       := /var/www/html/boot/
+
+ifeq ($(PLDISTRO),planetlab)
+YUMGROUPS      := groups/v3_yumgroups.xml
+else
+YUMGROUPS      := groups/v4_onelab.xml
+endif
 
-YUMGROUPS      := $(PLDISTRO).xml
 #BASE          := onelab
-BASETMP                := planetlab-upgrading
+BASENEW                := build-$(notdir $(shell pwd))
 BASEBAK                := planetlab-bak
 BASE           := planetlab
 
 RPMS/yumgroups.xml:
        install -D -m 644 $(YUMGROUPS) RPMS/yumgroups.xml
 
-install: install-rpms install-index install-bootstrap
+INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
+install: $(INSTALL-TARGETS)
+
+install-help:
+       @echo install: $(INSTALL-TARGETS)
 
 install-rpms:RPMS/yumgroups.xml
         # create repository
-       ssh $(SERVER) mkdir -p $(RPMSAREA)/$(BASETMP)
+       ssh $(SERVER) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
        # populate
        rsync -v --perms --times --group --compress --rsh=ssh \
-          RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(SERVER):$(RPMSAREA)/$(BASETMP)/
+          RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(SERVER):/plc/data/$(RPMSAREA)/$(BASENEW)/
 
-# would be better if we could run plc.d/packages on a temporary dir
-# currently while we run packages clients wont be able to use the repo (nor signed nor indexed)
 install-index:
+       # sign and index new repository
+       ssh $(SERVER) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
+
+install-clean-index:
+       # sign and index new repository
+       ssh $(SERVER) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
+
+install-adopt:
        # cleanup former bak
-       ssh $(SERVER) rm -rf $(RPMSAREA)/$(BASEBAK)
+       ssh $(SERVER) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
        # bak previous repo
-       ssh $(SERVER) mv $(RPMSAREA)/$(BASE) $(RPMSAREA)/$(BASEBAK)
+       ssh $(SERVER) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
        # install new repo
-       ssh $(SERVER) mv $(RPMSAREA)/$(BASETMP) $(RPMSAREA)/$(BASE)
-       # sign and re-index
-       ssh $(SERVER) chroot /plc/root service plc start packages
+       ssh $(SERVER) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
 
 install-bootstrap:
        # install node image
        install_bz2=$(wildcard BUILD/bootmanager-*/bootmanager/support-files/PlanetLab-Bootstrap.tar.bz2) ; \
-         if [ -n "$$install_bz2" ] ; then rsync $$install_bz2 $(SERVER):$(BOOTAREA) ; fi
+         if [ -n "$$install_bz2" ] ; then rsync $$install_bz2 $(SERVER):/plc/data/$(BOOTAREA) ; fi
 #endif
 
 .PHONY: install