Annotation of nsdl/build/Makefile, revision 1.4
1.1 harris41 1: # The NSDL to LON-CAPA Gateway Server
2:
3: # Scott Harrison
1.4 ! harris41 4: # $Id: Makefile,v 1.3 2002/05/23 19:58:49 harris41 Exp $
1.1 harris41 5:
6: DISTPROBE=`perl ./distprobe`
7: DIST=$(DISTPROBE)
8: CATEGORY="development"
1.3 harris41 9: SOURCE=..
1.1 harris41 10: TARGET=""
11: NORESTORECONF="0"
12: HOSTNAME=""
13: LAUNCH=| perl
14: OUTSTREAM=>
15: SAVE=program.pl.$(TIMESTAMP)
16: LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
17: METAMTARGET=""
18: MTARGET=""
19: VERSION=0.1
20:
21: help:
22: @echo "*** You need to specify a valid target ***"
23: @echo "NOTE: You can specify options to your Makefile target."
24: @echo "(option) DIST can be redhat6, redhat7, debian2.2, or default"
25: @echo "(option) CATEGORY can be runtime or development"
26: @echo "(option) SOURCE is an absolute or relative directory path"
27: @echo "(option) TARGET is an absolute or relative directory path"
28: @echo "build: compile the CVS source tree"
29: @echo "install: install from a compiled CVS source tree to a "
30: @echo " specified TARGET destination on the filesystem"
31: @echo "test: test different parts of the LON-CAPA system (TEST_*)"
32: @echo "TEST_lpml_scripts: make sure that the system can process "
33: @echo " the Linux Packaging Markup Language"
34: @echo "TEST_system_dependencies: make sure that all needed system "
35: @echo " components are active and present "
36: @echo " on the server such as perl modules"
37: @echo " and the MySQL database"
38: @echo "TEST_web_layer: mimic various web-based interactions with "
39: @echo " respect to the login and various system "
40: @echo " actions on the Gateway server"
41: @echo "HTML: generate an HTML-formatted description of the "
42: @echo " NSDL to LON-CAPA Gateway Server CVS source files"
43: @echo "doc: compiles documentation for the system administration of"
44: @echo " the gateway server"
45: @echo "status: compare the TARGET filesystem with a compiled CVS "
46: @echo " source directory"
47: @echo "statuspost: post the results of "make status" to "
48: @echo " TARGET/home/httpd/html/lon-status/filestatus.html"
49: @echo "rpmstatus: compare the rpms on a system to defined lists "
50: @echo " CVS:doc/otherfiles/cd_rpms and "
51: @echo " CVS:doc/otherfiles/rpm_list.txt"
52: @echo "rpmstatuspost: post the results of "make rpmstatus" to "
53: @echo " TARGET/home/httpd/html/lon-status/rpmstatus.html"
54: @echo "tardist: build a tarball that will upgrade the software on a "
55: @echo " system"
56:
57: build:
58: @echo "Not yet implemented"
59:
1.4 ! harris41 60: NET_install:
! 61: make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
! 62: MTARGET="install" HOSTNAME="$(HOSTNAME)" lpmladm
! 63: make warningnote
! 64:
1.3 harris41 65: install: Makefile.install
66: @echo -n "" > WARNINGS
67: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
68: directories
69: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
70: make warningnote
71:
72: Makefile.install: Makefile alwaysrun
73: cat gatewayfiles.lpml | \
74: perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
75: "$(TARGET)" > Makefile.install
76:
77: alwaysrun:
1.1 harris41 78:
79: test:
80: @echo "Not yet implemented"
81:
82: TEST_lpml_scripts:
83: @echo "Not yet implemented"
84:
85: TEST_system_dependencies:
86: @echo "Not yet implemented"
87:
88: TEST_web_layer:
89: @echo "Not yet implemented"
90:
91: HTML:
92: @echo "Not yet implemented"
93:
94: doc:
95: @echo "Not yet implemented"
96:
97: status:
98: @echo "Not yet implemented"
99:
100: statuspost:
101: @echo "Not yet implemented"
102:
103: tardist:
104: @echo "Not yet implemented"
1.3 harris41 105:
106: warningnote:
107: @if (test -s WARNINGS); then \
108: W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
109: E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
110: N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
111: echo "---> $$W WARNINGS ENCOUNTERED! "; \
112: echo "---> $$E ERRORS ENCOUNTERED! "; \
113: echo "---> $$N NOTES ENCOUNTERED! "; \
114: echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
115: echo "!!!! Please read the WARNINGS file !!!!"; \
116: echo "!!!! to make sure everything is !!!!"; \
117: echo "!!!! correct and taken care of !!!!"; \
118: echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
119: fi
1.4 ! harris41 120:
! 121: lpmladm:
! 122: @if (test $(METAMTARGET) = "TRANSPORT"); then \
! 123: echo "Transporting to $(HOSTNAME)"; \
! 124: sudo mkdir lpmladm.$(TIMESTAMP); \
! 125: sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
! 126: SOURCE="$(SOURCE)" \
! 127: TARGET="lpmladm.$(TIMESTAMP)" \
! 128: NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
! 129: cd lpmladm.$(TIMESTAMP); \
! 130: sudo tar czf ../tarball$(TIMESTAMP).tar.gz .; \
! 131: cd ..; scp tarball$(TIMESTAMP).tar.gz \
! 132: lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
! 133: sudo rm -Rf lpmladm.$(TIMESTAMP); \
! 134: sudo rm -f tarball$(TIMESTAMP).tar.gz; \
! 135: ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
! 136: ssh lpmladm@$(HOSTNAME) sudo tar -x -z -C / \
! 137: -p --same-owner -f \
! 138: /tarball$(TIMESTAMP).tar.gz; \
! 139: ssh lpmladm@$(HOSTNAME) sudo rm -f \
! 140: /tarball$(TIMESTAMP).tar.gz; \
! 141: elif (test $(METAMTARGET) = "LAUNCH"); then \
! 142: echo "Launching process on $(HOSTNAME)"; \
! 143: LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
! 144: make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
! 145: TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
! 146: LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
! 147: scp $(SAVE) lpmladm@$(HOSTNAME):$(SAVE); \
! 148: ssh lpmladm@$(HOSTNAME) sudo -u $(LAUNCHUSER) perl $(SAVE); \
! 149: else \
! 150: echo "**** ERROR **** Incorrect METAMTARGET"; \
! 151: fi
! 152: # ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
1.1 harris41 153:
1.2 harris41 154: clean:
155: @echo "Not yet implemented"
1.1 harris41 156:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>