2 # Thierry Parmentelat - INRIA Sophia Antipolis
4 ### $Id: onelab-install.mk 685 2007-07-19 09:01:41Z thierry $
10 # uses $(PLCSSH) as an ssh address for the destination host
11 # first copies everything on a separate rpm repo, prepares it,
12 # and then renames it into planetlab
14 # Upload packages to boot server
18 PLCSSH:=root@$(PLCHOST)
20 # if nothing's defined : use this default
22 PLCSSH := root@private.one-lab.org
25 RPMSAREA := /var/www/html/install-rpms/
28 BASENEW := build-$(notdir $(shell pwd))
29 BASEBAK := planetlab-bak
33 # if make is invoked with -n, run rsync, but with --dry-run
34 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
35 RSYNC := rsync $(RSYNC_COND_DRY_RUN)
37 INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
38 install: $(INSTALL-TARGETS)
39 .PHONY: install $(INSTALL-TARGETS)
42 @echo install: $(INSTALL-TARGETS)
44 install-rpms:RPMS/yumgroups.xml
46 ssh $(PLCSSH) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
48 +$(RSYNC) -v --perms --times --group --compress --rsh=ssh \
49 RPMS/yumgroups.xml $(wildcard RPMS/*/*.rpm) $(PLCSSH):/plc/data/$(RPMSAREA)/$(BASENEW)/
52 # sign and index new repository
53 ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
56 # sign and index new repository
57 ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
61 ssh $(PLCSSH) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
63 ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
65 ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
69 ssh $(PLCSSH) chroot /plc/root yum -y update bootstrapfs