Annotation of loncom/build/Makefile, revision 1.138
1.48 harris41 1: # The LearningOnline Network with CAPA
2:
1.129 harris41 3: # Scott Harrison, your friendly neighborhood volunteer
1.138 ! albertel 4: # $Id: Makefile,v 1.137 2002/12/11 22:20:11 albertel Exp $
1.1 harris41 5:
1.129 harris41 6: # TYPICAL USAGE of this Makefile is primarily for two targets:
7: # "make build" and "make install".
8: # Many other targets and features are supported (see the initial
9: # help targets).
10:
11: # ======================================= Default settings for Makefile options
1.79 harris41 12: DISTPROBE=`perl ./distprobe`
13: DIST=$(DISTPROBE)
1.39 harris41 14: CATEGORY="development"
1.80 harris41 15: SOURCE=../..
1.51 harris41 16: TARGET=""
1.55 harris41 17: NORESTORECONF="0"
1.66 harris41 18: HOSTNAME=""
19: LAUNCH=| perl
1.106 harris41 20: QUERYLAUNCH=> /tmp/loncapa_query.pl; perl /tmp/loncapa_query.pl
1.66 harris41 21: OUTSTREAM=>
22: SAVE=program.pl.$(TIMESTAMP)
23: LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
24: METAMTARGET=""
25: MTARGET=""
1.138 ! albertel 26: VERSION=0.6
1.126 harris41 27: DIRTARGET=loncapa-$(VERSION)
1.12 harris41 28:
1.129 harris41 29: # =============================================== Help targets for the Makefile
30: # If 'make' is run without any arguments, the 'help' target is called since
31: # it is the first target.
1.105 harris41 32: help:
1.52 harris41 33: @echo "*** You need to specify a valid target ***"
1.129 harris41 34: @echo "To get a list of valid targets: \"make help_TARGETS\""
35: @echo "To get a list of valid options: \"make help_OPTIONS\""
36: @echo " "
37: @echo "Typically invoked targets are:"
38: @echo " make build"
39: @echo " make install"
40: @echo " make test"
41: @echo " make clean"
42:
43: help_OPTIONS:
44: @echo "* ADJUSTABLE OPTIONS *"
1.105 harris41 45: @echo "(option) DIST can be redhat7, debian, redhat6.2, or default"
1.129 harris41 46: @echo " You probably do not need to specify this; it is"
47: @echo " automatically probed for."
48: @echo "(option) CATEGORY can be 'runtime' or 'development'; currently"
49: @echo " the 'development' setting is the most reliable;"
50: @echo " eventually, production machines should be using the"
51: @echo " 'runtime' settings"
52: @echo "(option) SOURCE is an absolute or relative directory path."
53: @echo " SOURCE corresponds to the root directory of the"
54: @echo " loncapa source release"
55: @echo "(option) TARGET is an absolute or relative directory path."
56: @echo " This is where files will be installed on your system."
57: @echo " Typically, this should be set to nothing (which"
58: @echo " corresponds to the '/' root of the entire filesystem)."
59: @echo "(option) NORESTORECONF, when set to a non-zero value, stops"
60: @echo " filesystem upgrades from overwriting existing "
61: @echo " configuration files. Ordinarily, NORESTORECONF=0, "
62: @echo " because the existing configuration files are safely"
63: @echo " dealt with (or so one hopes... :) )."
64: @echo "(option) HOSTNAME specifies the name of a remote server for"
65: @echo " which a NET_* Makefile target should be launched"
66: @echo "(option) VERSION; especially useful for the 'tardist' target"
67: @echo " this tags the tarball file and internal directories"
68: @echo " with a specific version string (conventionally "
69: @echo " numeric)"
70:
71: help_TARGETS:
72: @echo "*** RUNNING TESTS TO ENSURE SOLID PERFORMANCE ***"
73: @echo "test: test different parts of the LON-CAPA system (TEST_*)."
74: @echo " Makefile-dependent processes as well as horizontal and"
75: @echo " vertical aspects of the LON-CAPA system architecture"
76: @echo " are all tested."
77: @echo "TEST_lpml_scripts: make sure that the system can process"
78: @echo " the Linux Packaging Markup Language."
79: @echo " This is neither horizontal or vertical"
80: @echo " testing. The idea is to make sure that"
81: @echo " the installation software itself works"
82: @echo " as expected."
1.52 harris41 83: @echo "TEST_system_dependencies: make sure that all needed system "
84: @echo " components are active and present "
85: @echo " on the server such as perl modules"
86: @echo " and the MySQL database"
1.129 harris41 87: @echo " (horizontal testing)"
88: @echo "TEST_web_layer: mimic a login and various vertical actions on "
1.52 harris41 89: @echo " a LON-CAPA system"
1.129 harris41 90: @echo "TEST_hosts_tab: make sure that a loncapa/loncom/hosts.tab"
91: @echo " file is specified for installation"
92: @echo "TEST_html2ps: test for the presence of html2ps which is needed"
93: @echo " for making a PDF compilation for pdfdoc"
94: @echo "*** GENERAL TARGETS SUCH AS 'build' AND 'install' ***"
95: @echo "build: compile the source tree"
96: @echo "buildflag: a semaphore that helps educate the user to run"
97: @echo " 'make build' first before running 'make install'"
98: @echo "configinstall: install configuration files and restore with"
99: @echo " prior information"
1.134 albertel 100: @echo "install: install from a ***compiled*** source tree"
1.129 harris41 101: @echo " (see make build) to a specified TARGET destination"
102: @echo " on the filesystem (default setting is TARGET=/)."
103: @echo "rawinstall: just install files, links and directories without"
104: @echo " any bells or whistles (e.g. double-checking"
105: @echo " configurations, fine-tuning webserver, etc.)"
106: @echo "hosts_tab: install the hosts.tab to the filesystem"
107: @echo "webserverconf: fine-tune the web server configuration;"
108: @echo " make sure the proper 'Include' statements"
109: @echo " are appended to httpd.conf"
110: @echo "vanillatar: generate top-level files such as README, UPDATE,"
111: @echo " CHECKRPMS, and TEST (needed by tardist)"
112: @echo "tardist: build a tarball that will upgrade the software on a "
113: @echo " system"
114: @echo "sanitycheck: probe for common errors and recommend fixes to"
115: @echo " the user"
116: @echo "updatequery: solicit the user for machine configuration"
117: @echo " information; to be incorporated during an update"
118: @echo " procedure (via the UPDATE command)"
119: @echo "postinstall: double-check things after installation"
120: @echo "VERSION: tag the filesystem with version information inside"
121: @echo " /etc/loncapa-release"
122: @echo "aboutVERSION: place version information inside about.html"
123: @echo "*** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***"
124: @echo "Makefile.configinstall: generate a Makefile for configuration"
125: @echo " files; built dynamically from"
126: @echo " loncapafiles.lpml"
127: @echo "Makefile.build: generate a Makefile for compiling"
128: @echo " files inside the source directory; "
129: @echo " Makefile.build is generated from"
130: @echo " loncapafiles.lpml"
131: @echo "Makefile.install: generate a Makefile for installing"
132: @echo " files; built dynamically from"
133: @echo " loncapafiles.lpml"
134: @echo "*** TARGETS FOR OPERATING ON FILESYSTEMS ACROSS THE NETWORK ***"
135: @echo "lpmladm: coordinates username=lpmladm mediated secure shell"
136: @echo " processes; needed for the NET_* targets"
137: @echo "NET_hosts_tab: install the hosts.tab to a filesystem elsewhere"
138: @echo " on the network"
139: @echo "NET_webserverconf: fine-tune the web server configuration on a"
140: @echo " filesystem elsewhere on the network"
141: @echo "NET_rawinstall: launch the rawinstall target on a filesystem"
142: @echo " elsewhere on the network"
143: @echo "*** TARGETS FOR MAKING LISTS (MANIFESTS) OF LON-CAPA FILES ***"
144: @echo "MANIFEST_all: generate a list of all files to be included in"
145: @echo " the distributed tarball"
146: @echo "MANIFEST_cvs: essentially a list of all CVS/Entries files used"
147: @echo " for 'time-checking' intelligence"
1.134 albertel 148: @echo "MANIFEST_lpml: a list of all LON-CAPA files to be installed,"
1.129 harris41 149: @echo " compile from, used as building software, and"
150: @echo " testing"
151: @echo "MANIFEST_vanillatar: 'README'-type top-level files that a user"
152: @echo " of the distributed tarball would first"
153: @echo " look at and work with"
154: @echo "*** STATUS REPORT TARGETS ***"
155: @echo "warningnote: analyze the WARNINGS file and produce a synopsis"
156: @echo " and recommended action to the user"
1.52 harris41 157: @echo "HTML: generate an HTML-formatted description of the LON-CAPA"
1.129 harris41 158: @echo " source files"
159: @echo "status: compare the TARGET filesystem with a compiled loncapa "
1.52 harris41 160: @echo " source directory"
161: @echo "statuspost: post the results of "make status" to "
162: @echo " TARGET/home/httpd/html/lon-status/filestatus.html"
163: @echo "rpmstatus: compare the rpms on a system to defined lists "
1.129 harris41 164: @echo " loncapa/doc/otherfiles/cd_rpms and "
165: @echo " loncapa/doc/otherfiles/rpm_list.txt"
166: @echo "rpmstatuspost: post the results of 'make rpmstatus' to "
1.52 harris41 167: @echo " TARGET/home/httpd/html/lon-status/rpmstatus.html"
1.129 harris41 168: @echo "*** ALTERNATIVE PACKAGING TARGETS ***"
169: @echo "RPM: build LON-CAPA-base RPM from loncapa source repository"
170: @echo " (still under development)"
171: @echo "DPKG: build a loncapa Debian package from loncapa source"
172: @echo " repository (still under development)"
173: @echo "base_rpm_file_list: create a file listing to be used for"
174: @echo " generating an RPM software package"
175: @echo "BinaryRoot: create a BinaryRoot directory to be used for"
176: @echo " generating an RPM software package"
177: @echo "*** MASTER DOCUMENTATION TARGETS ***"
178: @echo "doc: generate web-page documentation for install.lon-capa.org"
179: @echo " (and eventually for documentation on installed machines)"
180: @echo "pdfdoc: make a PDF-formatted compilation of all installation"
181: @echo " documentation"
182: @echo "*** KEEPING THINGS CLEAN ***"
183: @echo "clean: remove any files that might (even by remote chance)"
184: @echo " interfere with rebuilding/recompiling software"
185: @echo "reallyclean: remove all files that were generated during"
186: @echo " building or compilation of the software"
1.136 harris41 187: @echo "uninstall: remove all directories that do not contain files"
188: @echo " from other software packages and that do not contain"
189: @echo " student and instructor data; NOTE THAT THIS IS"
190: @echo " INTERACTIVE--you will be given a final chance"
191: @echo " to look at what will and will not be deleted."
192: @echo " Still, be careful. This is a very new target and is"
193: @echo " an alpha-level software feature for now."
194: @echo "backup: rolls a tarball backup of all important student and "
195: @echo " instructor data (NOT YET IMPLEMENTED)"
196: @echo "restore: reseeds a LON-CAPA server with tarball backups "
197: @echo " generated by \"make backup\" (NOT YET IMPLEMENTED)"
1.129 harris41 198: @echo "*** A HELPFUL DEPENDENCY ***"
199: @echo "alwaysrun: blank target that is a dependency for targets"
200: @echo " that should \"always run\""
201:
202: # =========================== *** RUNNING TESTS TO ENSURE SOLID PERFORMANCE ***
1.1 harris41 203:
1.52 harris41 204: test: TEST_lpml_scripts TEST_system_dependencies TEST_web_layer
1.41 harris41 205: @echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
206:
207: TEST_system_dependencies:
1.52 harris41 208: @echo "TESTING SYSTEM DEPENDENCIES"
1.41 harris41 209: cd system_dependencies; make
1.44 harris41 210:
211: TEST_lpml_scripts:
1.52 harris41 212: @echo "TESTING LPML INSTALLATION CODE"
1.44 harris41 213: cd ../test; perl filecomparetest.pl
1.41 harris41 214:
1.52 harris41 215: TEST_web_layer:
1.77 harris41 216: @echo "TESTING WEB LAYER"
217: cd weblayer_test; make
1.2 harris41 218:
1.63 harris41 219: TEST_hosts_tab:
220: @echo "Testing hosts.tab"
1.120 albertel 221: @if (test -e ../hosts.tab); then \
1.129 harris41 222: echo "there is a defined link or file; assume okay"; \
1.63 harris41 223: else echo "**** ERROR **** hosts.tab not defined!" && \
224: echo -n "You need to do one of the following within your " && \
1.92 harris41 225: echo "CVS repository (cd loncapa/loncom)" && \
226: echo " 1) ln -s production_hosts.tab hosts.tab" && \
227: echo " 2) ln -s development_hosts.tab hosts.tab" && \
228: echo "or 3) ln -s rawhide_hosts.tab hosts.tab" && \
1.63 harris41 229: echo "(you most likely want option #1, production_hosts.tab)" && \
230: exit 1; \
231: fi
1.64 harris41 232:
1.129 harris41 233: TEST_html2ps:
234: @if (test -e /usr/local/html2ps/bin/html2ps); then \
235: echo "I can find html2ps; assume okay"; \
236: else \
237: echo "**** ERROR **** cannot find /usr/local/html2ps/bin/html2ps!" && \
238: echo "Please visit http://www.tdb.uu.se/~jan/html2ps.html" && \
239: exit 1; \
240: fi
241:
242: # ======================= *** GENERAL TARGETS SUCH AS 'build' AND 'install' ***
243:
244: build: Makefile.build pod2html.sh pod2man.sh
245: install -d $(SOURCE)/doc/man
246: install -d $(SOURCE)/doc/scripts
247: install -d $(SOURCE)/doc/lib/perl/Apache
248: echo -n "" > WARNINGS
249: make -f Makefile.build all
250: echo '1' > buildflag
251: make warningnote
252:
253: buildflag:
254: @echo "**** ERROR **** You need to run 'make build' first" > WARNINGS
255: make warningnote
256: @need_to_run_make_build_first 2>/dev/null
257:
258: configinstall: Makefile.configinstall
259: make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
260: configfiles
261: if (test "0" = $(NORESTORECONF)); then \
262: perl loncaparestoreconfigurations suffix .lpmlnew; fi
263:
264: install: buildflag VERSION TEST_hosts_tab Makefile.install Makefile
265: echo -n "" > WARNINGS
266: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
267: directories
268: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
269: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
270: make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
271: NORESTORECONF="$(NORESTORECONF)" configinstall
272: make postinstall
273: make warningnote
274: echo "You can run 'make test' to see if your system is ready to go!"
275: echo "NOTE THAT YOUR SYSTEM MUST HAVE MYSQL WITH A USER=\"www\" AND"
276: echo -n "PASSWORD=\"localhostkey\" FOR www\@localhost"
277: echo -n "(YOU MAY NEED TO REINITIALIZE YOUR MYSQL www\@localhost USER)"
278: echo -n "Please see http://install.lon-capa.org/ for more information"
279:
280: rawinstall: VERSION Makefile.install Makefile
281: echo -n "" > WARNINGS
282: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
283: directories
284: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
285: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
286: make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
287: NORESTORECONF="$(NORESTORECONF)" configinstall
1.66 harris41 288:
1.64 harris41 289: hosts_tab: TEST_hosts_tab
1.80 harris41 290: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
291: perl xfml_parse.pl $(SOURCE)/doc/loncapafiles/valid_hosts.xfml | \
1.64 harris41 292: perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
293: "$(TARGET)" > Makefile.install
1.66 harris41 294: make -f Makefile.install directories
1.64 harris41 295: make -f Makefile.install files
296: @echo "If hosts.tab has changed, restart httpd and loncontrol:"
297: @echo " /etc/rc.d/init.d/httpd restart"
298: @echo " /etc/rc.d/init.d/loncontrol restart"
299:
1.129 harris41 300: webserverconf:
301: cat $(SOURCE)/doc/loncapafiles/webserver.piml | \
302: perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH)
303:
304: # ---------------- Top-level files such as README, UPDATE, CHECKRPMS, and TEST
305: vanillatar:
306: # --------------------------- Point UPDATE to the internal make process
307: echo '#!/bin/sh' > $(SOURCE)/UPDATE
308: echo 'touch loncom/build/WARNINGS' >> $(SOURCE)/UPDATE;
309: echo 'ln -s loncom/build/WARNINGS WARNINGS' >> $(SOURCE)/UPDATE;
310: echo 'cd loncom/build; make build' >> $(SOURCE)/UPDATE
311: echo 'make rawinstall' >> $(SOURCE)/UPDATE
312: echo 'make configinstall' >> $(SOURCE)/UPDATE
313: echo 'make updatequery' >> $(SOURCE)/UPDATE
314: echo 'make hosts_tab' >> $(SOURCE)/UPDATE
315: echo 'make postinstall' >> $(SOURCE)/UPDATE
316: echo 'make aboutVERSION' >> $(SOURCE)/UPDATE
317: echo 'make warningnote' >> $(SOURCE)/UPDATE
318: # ----------------------------- Point TEST to the internal make process
319: echo '#!/bin/sh' > $(SOURCE)/TEST
320: echo 'cd loncom/build; make test' >> $(SOURCE)/TEST
1.132 harris41 321: echo 'cd system_dependencies || cd loncom/build/system_dependencies; cp -v CPAN_STATUS_REPORT ../../../CPAN_STATUS_REPORT' >> $(SOURCE)/TEST
1.129 harris41 322: # ----------------------------- Copy CHECKRPMS to the vanilla top-level
323: cp -v $(SOURCE)/loncom/build/CHECKRPMS $(SOURCE)/CHECKRPMS
324: # ----------------------- vanilla executables must indeed be executable
325: chmod a+rx $(SOURCE)/UPDATE
326: chmod a+rx $(SOURCE)/TEST
327: chmod a+rx $(SOURCE)/CHECKRPMS
328: # -------------------------------- Copy README to the vanilla top-level
329: cp -v $(SOURCE)/doc/shortest_path_redhat7.2.txt $(SOURCE)/README
330:
331: tardist:
332: make MANIFEST_all
333: make vanillatar
334: # -------------------------------------------------------- Make tardist
335: @cd $(SOURCE); \
336: if (test -h $(DIRTARGET)); then \
337: echo "$(DIRTARGET) link already defined; assume okay"; \
338: else \
339: ln -s . $(DIRTARGET); \
340: fi
341: cp -v $(SOURCE)/loncom/license/about.html \
342: $(SOURCE)/loncom/license/about.html.orig
343: make aboutVERSION
344: cd $(SOURCE); \
345: tar --no-recursion --numeric-owner --files-from MANIFEST \
346: -h -czf $(DIRTARGET).tar.gz 2>tar_WARNINGS || [ "0" == "0" ]
347: mv -v $(SOURCE)/loncom/license/about.html.orig \
348: $(SOURCE)/loncom/license/about.html
349: cat $(SOURCE)/tar_WARNINGS | \
350: xargs --replace=XXX echo '**** WARNING **** XXX' > WARNINGS
351: rm -f $(SOURCE)/tar_WARNINGS
352: make warningnote
353:
354: sanitycheck:
355: cat $(SOURCE)/doc/loncapafiles/sanitycheck.piml | \
356: perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
357: tee -a WARNINGS
358:
359: updatequery:
360: cat $(SOURCE)/doc/loncapafiles/updatequery.piml | \
361: perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
362:
1.130 albertel 363: reseval_fixup:
364: cat $(SOURCE)/doc/loncapafiles/reseval_fixup.piml | \
365: perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
366: tee -a WARNINGS
367:
1.137 albertel 368: clearoutoldspreadsheetcache:
369: cat $(SOURCE)/doc/loncapafiles/clearoutoldspreadsheetcache.piml | \
370: perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
371: tee -a WARNINGS
372:
1.133 harris41 373: sendmail_fix:
374: cat $(SOURCE)/doc/loncapafiles/sendmail_fix.piml | \
375: perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
376: tee -a WARNINGS
377:
1.129 harris41 378: postinstall:
379: make webserverconf
1.130 albertel 380: make reseval_fixup
1.137 albertel 381: make clearoutoldspreadsheetcache
1.129 harris41 382: make sanitycheck
1.133 harris41 383: make sendmail_fix
1.129 harris41 384:
385: VERSION:
386: install -d $(TARGET)/etc
387: echo -n "LON-CAPA release $(VERSION)-" > $(TARGET)/etc/loncapa-release
388: date +"%Y%m%d" >> $(TARGET)/etc/loncapa-release
389:
390: aboutVERSION:
391: cat $(SOURCE)/loncom/license/about.html | \
392: perl -e '$$d=`date +"%Y%m%d"`;chomp($$d);while(<>){s/\<\!\-\- VERSION \-\-\>/$(VERSION)-$$d/; print;}' > \
393: $(SOURCE)/loncom/license/about.html.new
394: mv -v $(SOURCE)/loncom/license/about.html.new \
395: $(SOURCE)/loncom/license/about.html
396:
397: # ========= *** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***
398:
399: Makefile.configinstall: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml \
400: lpml_parse.pl
401: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
402: perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
403: "$(TARGET)" > Makefile.configinstall
404:
405: Makefile.build: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
406: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
407: perl lpml_parse.pl build $(CATEGORY) $(DIST) "$(SOURCE)" "$(TARGET)" \
408: > Makefile.build
409:
410: Makefile.install: alwaysrun
411: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
412: perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
413: "$(TARGET)" > Makefile.install
414:
415: # ============= *** TARGETS FOR OPERATING ON FILESYSTEMS ACROSS THE NETWORK ***
416:
1.66 harris41 417: lpmladm:
418: @if (test $(METAMTARGET) = "TRANSPORT"); then \
419: echo "Transporting to $(HOSTNAME)"; \
420: sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
421: SOURCE="$(SOURCE)" \
422: TARGET="lpmladm.$(TIMESTAMP)" \
423: NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
424: cd lpmladm.$(TIMESTAMP); \
425: sudo tar czvf ../tarball$(TIMESTAMP).tar.gz .; \
426: cd ..; scp tarball$(TIMESTAMP).tar.gz \
427: lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
428: ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
429: ssh lpmladm@$(HOSTNAME) sudo tar -x -z -v -C / \
430: -p --same-owner -f \
431: /tarball$(TIMESTAMP).tar.gz; \
432: ssh lpmladm@$(HOSTNAME) sudo rm -f \
433: /tarball$(TIMESTAMP).tar.gz; \
434: elif (test $(METAMTARGET) = "LAUNCH"); then \
435: echo "Launching process on $(HOSTNAME)"; \
436: LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
437: make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
438: TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
439: LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
440: scp $(SAVE) lpmladm@$(HOSTNAME):~/$(SAVE); \
441: ssh lpmladm@$(HOSTNAME) sudo perl $(SAVE); \
442: ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
443: else \
444: echo "**** ERROR **** Incorrect METAMTARGET"; \
445: fi
446:
1.129 harris41 447: NET_hosts_tab:
448: make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
449: MTARGET="hosts_tab" HOSTNAME="$(HOSTNAME)" lpmladm
450:
451: NET_webserverconf:
452: make TIMESTAMP=`date +"%s"` METAMTARGET="LAUNCH" \
453: MTARGET="webserverconf" HOSTNAME="$(HOSTNAME)" lpmladm
454:
455: NET_rawinstall:
456: make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
457: MTARGET="rawinstall" HOSTNAME="$(HOSTNAME)" lpmladm
458:
459: # ============== *** TARGETS FOR MAKING LISTS (MANIFESTS) OF LON-CAPA FILES ***
460:
461: MANIFEST_all:
462: # --------------------------------------------------------- start clean
463: rm -f $(SOURCE)/MANIFEST
464: make MANIFEST_lpml
465: make MANIFEST_vanillatar
466: make MANIFEST_cvs
467: # ---------------------------------- might as well include the MANIFEST
468: echo 'MANIFEST' >> $(SOURCE)/MANIFEST
469: # ------------------------------------------ hosts.tab are belong to us
470: echo 'loncom/rawhide_hosts.tab' >> $(SOURCE)/MANIFEST
471: echo 'loncom/production_hosts.tab' >> $(SOURCE)/MANIFEST
472: echo 'loncom/development_hosts.tab' >> $(SOURCE)/MANIFEST
473: # ------------------ Files needed for dynamically generated directories
474: echo 'doc/man' >> $(SOURCE)/MANIFEST
475: echo 'doc/lib' >> $(SOURCE)/MANIFEST
476: echo 'doc/lib/perl' >> $(SOURCE)/MANIFEST
477: echo 'doc/lib/perl/Apache' >> $(SOURCE)/MANIFEST
478: echo 'doc/scripts' >> $(SOURCE)/MANIFEST
479: # --------------------------------------------------- Clean up MANIFEST
480: cd $(SOURCE); \
481: sort MANIFEST | perl -nle 'print "$(DIRTARGET)/$$_"' | \
482: perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
483: perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
484: perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
485: perl -nle 's/\/\.\//\//g;print' | sort | uniq > \
486: MANIFEST_loncapa
487: cd $(SOURCE); mv -v MANIFEST_loncapa MANIFEST
488:
489: # --------------- MANIFEST files with important CVS versioning/date information
490: MANIFEST_cvs:
491: # ------ CVS/Entries directories to retain 'time-checking' intelligence
492: cd $(SOURCE); find . -type f -name 'Entries' | grep 'CVS/Entries' >> \
493: MANIFEST
494:
495: # ------------------- MANIFEST the building, testing and standard loncapa files
496: MANIFEST_lpml:
497: cat $(SOURCE)/doc/loncapafiles/buildfiles.lpml | \
498: perl lpml_parse.pl MANIFEST development default \
499: '$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
500: cat $(SOURCE)/doc/loncapafiles/testfiles.lpml | \
501: perl lpml_parse.pl MANIFEST development default \
502: '$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
503: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
504: perl lpml_parse.pl MANIFEST development default \
505: '$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
506:
507: # ------------ Files for top-level (the vanilla layer that the user first sees)
508: MANIFEST_vanillatar:
509: echo 'README' >> $(SOURCE)/MANIFEST
510: echo 'UPDATE' >> $(SOURCE)/MANIFEST
511: echo 'TEST' >> $(SOURCE)/MANIFEST
512: echo 'CHECKRPMS' >> $(SOURCE)/MANIFEST
513:
514: # =============================================== *** STATUS REPORT TARGETS ***
515:
516: warningnote:
517: @if (test -s WARNINGS); then \
518: W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
519: E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
520: N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
521: echo "---> $$W WARNINGS ENCOUNTERED! "; \
522: echo "---> $$E ERRORS ENCOUNTERED! "; \
523: echo "---> $$N NOTES ENCOUNTERED! "; \
524: echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
525: echo "!!!! Please read the WARNINGS file !!!!"; \
526: echo "!!!! to make sure everything is !!!!"; \
527: echo "!!!! correct and taken care of !!!!"; \
528: echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
529: fi
530:
1.3 harris41 531: HTML:
532: install -d HTML
1.80 harris41 533: cp $(SOURCE)/doc/loncapafiles/*.gif HTML
534: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
535: perl lpml_parse.pl html development default "$(SOURCE)" '$(TARGET)' \
536: > HTML/index.html
1.3 harris41 537:
1.8 harris41 538: status:
1.7 harris41 539: install -d HTML
1.80 harris41 540: cp $(SOURCE)/doc/loncapafiles/*.gif HTML
541: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
542: perl lpml_parse.pl html $(CATEGORY) $(DIST) "$(SOURCE)" "($TARGET)" | \
1.49 harris41 543: perl lpml_html_posteval.pl > \
1.39 harris41 544: HTML/filestatus.html
1.48 harris41 545:
1.22 harris41 546: statuspost: status
1.80 harris41 547: cp $(SOURCE)/doc/loncapafiles/*.gif \
548: $(TARGET)/home/httpd/html/lon-status
1.52 harris41 549: cp HTML/filestatus.html \
550: $(TARGET)/home/httpd/html/lon-status/filestatus.html
1.22 harris41 551:
1.33 harris41 552: rpmstatus:
553: install -d RPMSTATUS
1.52 harris41 554: rpm -qa --queryformat \
555: '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
556: RPMSTATUS/current.tmp
1.80 harris41 557: cat $(SOURCE)/doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
558: cat $(SOURCE)/doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
1.52 harris41 559: perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
560: RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
1.33 harris41 561:
562: rpmstatuspost: rpmstatus
563: cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
564:
1.129 harris41 565: # ======================================= *** ALTERNATIVE PACKAGING TARGETS ***
1.8 harris41 566:
1.55 harris41 567: RPM: BinaryRoot base_rpm_file_list
1.80 harris41 568: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
1.63 harris41 569: perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) \
570: > base_customizerpm.xml
1.55 harris41 571: cat base_rpm_file_list.txt | perl make_rpm.pl base 3.2 '' '' \
572: BinaryRoot base_customizerpm.xml
573:
1.60 harris41 574: DPKG:
1.82 harris41 575: make TARGET='lon-capa-$(VERSION)' NORESTORECONF='1' install
1.60 harris41 576: @echo "You will next need to follow instructions at:"
577: @echo "http://people.debian.org/~jaldhar/make_package1.html"
578: @echo "A directory with a snapshot of the debian package files"
579: @echo "is LON-CAPA-base."
1.82 harris41 580: # What DPKG steps need to happen (for future implementation):
581: # export EMAIL="" ... probably sharrison@mail.lon-capa.org
582: # deb-make
583: # edit debian/control
584: # make debian/dirs file
585: # make debian/copyright file
586: # debian/README.debian... point them to LON-CAPA URLS
587: # debian/changelog
588: # debian/conffiles
589: # debuild
590: # and maybe do some GPG-related steps around here
1.55 harris41 591:
592: base_rpm_file_list:
1.80 harris41 593: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
1.55 harris41 594: perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
595: 'BinaryRoot' | sort > base_rpm_file_list.txt
1.6 harris41 596:
1.55 harris41 597: BinaryRoot: base_rpm_file_list
598: make TARGET='BinaryRoot' NORESTORECONF='1' install
1.23 harris41 599:
1.129 harris41 600: # ======================================== *** MASTER DOCUMENTATION TARGETS ***
601:
1.62 harris41 602: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
603: doc:
604: install -d docs
1.99 harris41 605: @if (test -e installation_manual.pdf); then \
606: cp -vf installation_manual.pdf docs/.; \
607: else \
608: touch docs/installation_manual.pdf; \
609: fi
1.62 harris41 610: install -m 0755 -d docs/icons
1.80 harris41 611: install -m 0644 $(SOURCE)/doc/icons/[^C][^V]* docs/icons
1.62 harris41 612: install -m 0755 -d docs/reconfig
1.99 harris41 613: cd docs; ln -fs installation_manual.pdf index.pdf
614: cd docs/reconfig; ln -fs ../installation_manual.pdf index.pdf
1.80 harris41 615: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
616: $(SOURCE)/doc/build/reconfig.html > docs/reconfig/index.html
1.62 harris41 617: install -m 0755 -d docs/reconfig/confexamples
1.80 harris41 618: install -m 0644 $(SOURCE)/doc/build/confexamples/[^C][^V]* \
1.62 harris41 619: docs/reconfig/confexamples
1.80 harris41 620: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
621: $(SOURCE)/doc/build/installindex.html > docs/index.html
1.67 harris41 622: install -m 0755 -d docs/license
1.99 harris41 623: cd docs/license; ln -fs ../installation_manual.pdf index.pdf
1.80 harris41 624: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
625: $(SOURCE)/doc/build/license.html > docs/license/index.html
1.67 harris41 626: install -m 0755 -d docs/contact
1.99 harris41 627: cd docs/contact; ln -fs ../installation_manual.pdf index.pdf
1.80 harris41 628: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
629: $(SOURCE)/doc/build/contact.html > docs/contact/index.html
1.68 harris41 630: install -m 0755 -d docs/faq
1.99 harris41 631: cd docs/faq; ln -fs ../installation_manual.pdf index.pdf
1.80 harris41 632: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
633: $(SOURCE)/doc/build/faq.html > docs/faq/index.html
1.69 harris41 634: install -m 0755 -d docs/downloads
1.99 harris41 635: cd docs/downloads; ln -fs ../installation_manual.pdf download.pdf
1.80 harris41 636: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
637: $(SOURCE)/doc/build/download.html > docs/downloads/index.html
1.69 harris41 638: install -m 0755 -d docs/install
1.99 harris41 639: cd docs/install; ln -fs ../installation_manual.pdf install.pdf
1.80 harris41 640: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
641: $(SOURCE)/doc/build/install.html > docs/install/index.html
1.125 harris41 642: cp -v $(SOURCE)/doc/install/redhat7.3/new_install_rh73.html \
643: docs/install/rh73.html
1.127 harris41 644: cp -v $(SOURCE)/doc/install/redhat7.3/new_install_rh73.html \
1.128 harris41 645: docs/downloads/rh73.html
1.69 harris41 646: install -m 0755 -d docs/upgrade
1.99 harris41 647: cd docs/upgrade; ln -fs ../installation_manual.pdf upgrade.pdf
1.80 harris41 648: perl doc_template.pl $(SOURCE)/doc/templates/template.html \
649: $(SOURCE)/doc/build/upgrade.html > docs/upgrade/index.html
1.62 harris41 650: cd docs; tar czvpf ../docs.tar.gz .
651:
1.99 harris41 652: pdfdoc: TEST_html2ps
653: install -d pdfdoc
654: /usr/local/html2ps/bin/html2ps -D \
655: $(SOURCE)/doc/build/installindex_noform.html > pdfdoc/installindex.ps
656: /usr/local/html2ps/bin/html2ps -D \
657: $(SOURCE)/doc/build/reconfig.html | \
658: perl -nle 's/\[EXAMPLE\]/\[EXAMPLE \(at end of document\)\]/g;print' \
659: > pdfdoc/reconfig.ps
660: /usr/local/html2ps/bin/html2ps -D \
661: $(SOURCE)/doc/build/install.html > pdfdoc/install.ps
662: /usr/local/html2ps/bin/html2ps -D \
663: $(SOURCE)/doc/build/upgrade.html > pdfdoc/upgrade.ps
664: /usr/local/html2ps/bin/html2ps -D \
665: $(SOURCE)/doc/build/faq.html > pdfdoc/faq.ps
666: /usr/local/html2ps/bin/html2ps -D \
667: $(SOURCE)/doc/build/download.html > pdfdoc/download.ps
668: /usr/local/html2ps/bin/html2ps -D \
669: $(SOURCE)/doc/build/contact.html > pdfdoc/contact.ps
670: /usr/local/html2ps/bin/html2ps -D \
671: $(SOURCE)/doc/build/license.html > pdfdoc/license.ps
672: # This creates a bad confexamples.ps... so take the long way around
673: # cd $(SOURCE)/doc/build/confexamples; \
674: # mpage -P- -1 -H [^C]* > ../../../loncom/build/pdfdoc/confexamples.ps
675: install -d pdfdoc/confexamples
676: cd $(SOURCE)/doc/build/confexamples; \
1.129 harris41 677: find . -type f | cut -b3- | grep -v '^C' | grep -v 'keyword' | \
678: perl -nle \
1.99 harris41 679: '`mpage -P- -1 -H $$_ > ../../../loncom/build/pdfdoc/confexamples/$$_.ps`;'
680: echo '' > pdfdoc/contents.txt
681: echo '' >> pdfdoc/contents.txt
682: echo ' The Learning Online Network' >> pdfdoc/contents.txt
683: echo ' with the' >> pdfdoc/contents.txt
684: echo ' Computer-Assisted Personalized Approach' >> \
685: pdfdoc/contents.txt
686: echo '' >> pdfdoc/contents.txt
687: echo '' >> pdfdoc/contents.txt
688: echo 'CONTENTS' >> pdfdoc/contents.txt
689: echo '--------' >> pdfdoc/contents.txt
690: echo 'Opening' >> pdfdoc/contents.txt
691: echo 'Configuration' >> pdfdoc/contents.txt
692: echo 'Installation' >> pdfdoc/contents.txt
693: echo 'Upgrading a LON-CAPA Server' >> pdfdoc/contents.txt
694: echo 'FAQ' >> pdfdoc/contents.txt
695: echo 'Download' >> pdfdoc/contents.txt
696: echo 'Contact Information' >> pdfdoc/contents.txt
697: echo 'License Information' >> pdfdoc/contents.txt
698: echo 'Configuration Examples' >> pdfdoc/contents.txt
699: mpage -P- -1 \
700: pdfdoc/contents.txt \
701: pdfdoc/installindex.ps \
702: pdfdoc/reconfig.ps \
703: pdfdoc/install.ps \
704: pdfdoc/upgrade.ps \
705: pdfdoc/faq.ps \
706: pdfdoc/download.ps \
707: pdfdoc/contact.ps \
708: pdfdoc/license.ps \
709: pdfdoc/confexamples/*.ps \
710: > pdfdoc/installation_manual.ps
711: ps2pdf pdfdoc/installation_manual.ps pdfdoc/installation_manual.pdf
712: mv -vf pdfdoc/installation_manual.pdf .
713:
1.129 harris41 714: # ================================================ *** KEEPING THINGS CLEAN ***
1.52 harris41 715:
1.1 harris41 716: clean:
1.129 harris41 717: rm -f buildflag
1.112 harris41 718: rm -Rf HTML
719: rm -f installation_manual.pdf
720: rm -f Makefile.build
721: rm -f Makefile.install
722: rm -f Makefile.configinstall
723: rm -Rf BinaryRoot
724: rm -Rf SetupBinaryRoot
725: rm -Rf LON-CAPA-base
726: rm -f base_rpm_file_list.txt
727: rm -f base_customizerpm.xml
728: rm -f setup_rpm_file_list.txt
729: rm -f docs.tar.gz
730: rm -Rf docs
731: rm -Rf pdfdoc
732: rm -f program.pl*
733: rm -Rf lpmladm.*
734: rm -f WARNINGS
1.131 harris41 735: rm -f CPAN_STATUS_REPORT
1.114 harris41 736: rm -f $(SOURCE)/loncom/build/hosts.tab
1.112 harris41 737:
738: reallyclean:
1.129 harris41 739: rm -f buildflag
1.80 harris41 740: rm -f $(SOURCE)/README
741: rm -f $(SOURCE)/UPDATE
742: rm -f $(SOURCE)/TEST
1.105 harris41 743: rm -f $(SOURCE)/MANIFEST
1.129 harris41 744: rm -f $(SOURCE)/MANIFEST_loncapa
1.105 harris41 745: rm -f $(SOURCE)/loncapa
1.114 harris41 746: rm -f $(SOURCE)/loncom/build/hosts.tab
1.80 harris41 747: rm -f $(SOURCE)/loncapa.tar.gz
1.3 harris41 748: rm -Rf HTML
1.99 harris41 749: rm -f installation_manual.pdf
1.8 harris41 750: rm -f Makefile.build
751: rm -f Makefile.install
1.57 harris41 752: rm -f Makefile.configinstall
1.55 harris41 753: rm -Rf BinaryRoot
754: rm -Rf SetupBinaryRoot
1.62 harris41 755: rm -Rf LON-CAPA-base
1.56 harris41 756: rm -f base_rpm_file_list.txt
1.58 harris41 757: rm -f base_customizerpm.xml
1.56 harris41 758: rm -f setup_rpm_file_list.txt
1.62 harris41 759: rm -f docs.tar.gz
760: rm -Rf docs
1.99 harris41 761: rm -Rf pdfdoc
1.66 harris41 762: rm -f program.pl*
763: rm -Rf lpmladm.*
1.67 harris41 764: make -f Makefile.cvs clean
1.80 harris41 765: rm -f WARNINGS
1.136 harris41 766:
767: uninstall:
768: rm -f UNINSTALL_SHELL_COMMANDS
769: cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
770: perl lpml_parse.pl uninstall_shell_commands $(CATEGORY) $(DIST) \
771: "$(SOURCE)" "$(TARGET)" > UNINSTALL_SHELL_COMMANDS
772: @echo -n "**** NOTE **** A file \"UNINSTALL_SHELL_COMMANDS\" has been "
773: @echo "generated."
774: @echo "First, you should view the contents of this file."
775: @echo "If you are happy with the 'rm -Rf'! commands (or at least"
776: @echo "have another job lined up in case of catastrophe), then you "
777: @echo "can execute the following: sh ./UNINSTALL_SHELL_COMMANDS"
778:
779: backup:
780: @echo "Not yet implemented"
781:
782: restore:
783: @echo "Not yet implemented"
1.115 harris41 784:
1.129 harris41 785: # ================================================ *** A HELPFUL DEPENDENCY ***
1.115 harris41 786: alwaysrun:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>