[LON-CAPA-cvs] cvs: nsdl /build Makefile
harris41
lon-capa-cvs@mail.lon-capa.org
Wed, 29 May 2002 00:58:20 -0000
harris41 Tue May 28 20:58:20 2002 EDT
Modified files:
/nsdl/build Makefile
Log:
supporting network distributed installation
Index: nsdl/build/Makefile
diff -u nsdl/build/Makefile:1.3 nsdl/build/Makefile:1.4
--- nsdl/build/Makefile:1.3 Thu May 23 15:58:49 2002
+++ nsdl/build/Makefile Tue May 28 20:58:20 2002
@@ -1,7 +1,7 @@
# The NSDL to LON-CAPA Gateway Server
# Scott Harrison
-# $Id: Makefile,v 1.3 2002/05/23 19:58:49 harris41 Exp $
+# $Id: Makefile,v 1.4 2002/05/29 00:58:20 harris41 Exp $
DISTPROBE=`perl ./distprobe`
DIST=$(DISTPROBE)
@@ -57,6 +57,11 @@
build:
@echo "Not yet implemented"
+NET_install:
+ make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
+ MTARGET="install" HOSTNAME="$(HOSTNAME)" lpmladm
+ make warningnote
+
install: Makefile.install
@echo -n "" > WARNINGS
make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
@@ -112,6 +117,39 @@
echo "!!!! correct and taken care of !!!!"; \
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
fi
+
+lpmladm:
+ @if (test $(METAMTARGET) = "TRANSPORT"); then \
+ echo "Transporting to $(HOSTNAME)"; \
+ sudo mkdir lpmladm.$(TIMESTAMP); \
+ sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
+ SOURCE="$(SOURCE)" \
+ TARGET="lpmladm.$(TIMESTAMP)" \
+ NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
+ cd lpmladm.$(TIMESTAMP); \
+ sudo tar czf ../tarball$(TIMESTAMP).tar.gz .; \
+ cd ..; scp tarball$(TIMESTAMP).tar.gz \
+ lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
+ sudo rm -Rf lpmladm.$(TIMESTAMP); \
+ sudo rm -f tarball$(TIMESTAMP).tar.gz; \
+ ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
+ ssh lpmladm@$(HOSTNAME) sudo tar -x -z -C / \
+ -p --same-owner -f \
+ /tarball$(TIMESTAMP).tar.gz; \
+ ssh lpmladm@$(HOSTNAME) sudo rm -f \
+ /tarball$(TIMESTAMP).tar.gz; \
+ elif (test $(METAMTARGET) = "LAUNCH"); then \
+ echo "Launching process on $(HOSTNAME)"; \
+ LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
+ make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
+ TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
+ LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
+ scp $(SAVE) lpmladm@$(HOSTNAME):$(SAVE); \
+ ssh lpmladm@$(HOSTNAME) sudo -u $(LAUNCHUSER) perl $(SAVE); \
+ else \
+ echo "**** ERROR **** Incorrect METAMTARGET"; \
+ fi
+# ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
clean:
@echo "Not yet implemented"