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