File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.188.4.1: download - view: text, annotated - select for diffs
Sat Sep 19 02:22:46 2009 UTC (14 years, 8 months ago) by raeburn
Branches: GCI_1
Diff to branchpoint 1.188: preferred, unified
- Custom GCI_1 version.

    1: # The LearningOnline Network with CAPA
    2: 
    3: # $Id: Makefile,v 1.188.4.1 2009/09/19 02:22:46 raeburn Exp $
    4: 
    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
   11: DISTPROBE=`perl ./distprobe`
   12: DIST=$(DISTPROBE)
   13: CATEGORY="development"
   14: SOURCE=../..
   15: TARGET=""
   16: NORESTORECONF="0"
   17: HOSTNAME=""
   18: LAUNCH=| perl
   19: QUERYLAUNCH=> /tmp/loncapa_query.pl; perl /tmp/loncapa_query.pl
   20: OUTSTREAM=>
   21: SAVE=program.pl.$(TIMESTAMP)
   22: LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
   23: METAMTARGET=""
   24: MTARGET=""
   25: VERSION=GCI_1
   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".
   30: DIRTARGET=loncapa-$(VERSION)
   31: LOCALAUTHPATH=/home/httpd/lib/perl
   32: 
   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.
   36: help:
   37: 	@echo "*** You need to specify a valid target ***"
   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 *"
   49: 	@echo "(option) DIST can be redhat7, debian, redhat6.2, or default"
   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."
   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"
   91: 	@echo "                          (horizontal testing)"
   92: 	@echo "TEST_web_layer: mimic a login and various vertical actions on "
   93: 	@echo "                a LON-CAPA system"
   94: 	@echo "TEST_hosts_and_domain_tab: make sure that a "
   95: 	@echo "        loncapa/loncom/hosts.tab and loncapa/loncom/domain.tab"
   96: 	@echo "        file is specified for installation"
   97: 	@echo "TEST_html2ps: test for the presence of html2ps which is needed"
   98: 	@echo "              for making a PDF compilation for pdfdoc"
   99: 	@echo "*** GENERAL TARGETS SUCH AS 'build' AND 'install' ***"
  100: 	@echo "build: compile the source tree"
  101: 	@echo "buildflag: a semaphore that helps educate the user to run"
  102: 	@echo "           'make build' first before running 'make install'"
  103: 	@echo "configinstall: install configuration files and restore with"
  104: 	@echo "               prior information"
  105: 	@echo "install: install from a ***compiled*** source tree"
  106: 	@echo "         (see make build) to a specified TARGET destination"
  107: 	@echo "         on the filesystem (default setting is TARGET=/)."
  108: 	@echo "rawinstall: just install files, links and directories without"
  109: 	@echo "            any bells or whistles (e.g. double-checking"
  110: 	@echo "            configurations, fine-tuning webserver, etc.)"
  111: 	@echo "hosts_and_domain_tab: install the hosts.tab and domain.tab" 
  112: 	@echo "                      to the filesystem"
  113: 	@echo "webserverconf: fine-tune the web server configuration;"
  114: 	@echo "               make sure the proper 'Include' statements"
  115: 	@echo "               are appended to httpd.conf"
  116: 	@echo "vanillatar: generate top-level files such as README, UPDATE,"
  117: 	@echo "            CHECKRPMS, and TEST (needed by tardist)"
  118: 	@echo "tardist: build a tarball that will upgrade the software on a "
  119: 	@echo "         system"
  120: 	@echo "sanitycheck: probe for common errors and recommend fixes to"
  121: 	@echo "             the user"
  122: 	@echo "logcleanup: clean spurious logfile entries"
  123: 	@echo "clean_file_permissions: Remove erroneous keys from the  "
  124: 	@echo "    file_permissions.db"
  125: 	@echo "accesscount_seed: Migrate the access counting mechanism from "
  126: 	@echo "    nohist_reseval.db to nohist_accesscount.db."
  127: 	@echo "modify_config_files: Perform automatic update of the "
  128: 	@echo "    configuration files for yum and MySQL."
  129: 	@echo "ntpcheck: test to see if ntp is installed and running."
  130: 	@echo "html_parser_check: test functionality of HTML::Parser."
  131: 	@echo "math_random_check: test functionality of Math::Random."
  132: 	@echo "cron_lpmlcheck: remove cron file /etc/cron.d/loncapa.lpml."
  133: 	@echo "chkconfig: test runlevels of httpd and loncontrol."
  134: 	@echo "rpmcheck: test to see if rpms known to confict are installed."
  135: 	@echo "wrap_setuid: put a C wrapper around setuid scripts."
  136:         @echo "latex_fixup: regenerate ls-R database for the latex base."
  137: 	@echo "picins_check: check for picins.sty, retrieve and rebuild"
  138: 	@echo "             filename databases used by LaTeX"
  139: 	@echo "updatequery: solicit the user for machine configuration"
  140: 	@echo "             information; to be incorporated during an update"
  141: 	@echo "             procedure (via the UPDATE command)"
  142: 	@echo "postinstall: double-check things after installation"
  143: 	@echo "VERSION: tag the filesystem with version information inside"
  144: 	@echo "         /etc/loncapa-release and"
  145: 	@echo "         /home/httpd/html/lon-status/version.txt"
  146: 	@echo "aboutVERSION: place version information inside about.html"
  147: 	@echo "              and loncapa_apache.conf"
  148: 	@echo "*** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***"
  149: 	@echo "Makefile.configinstall: generate a Makefile for configuration"
  150: 	@echo "                        files; built dynamically from"
  151: 	@echo "                        loncapafiles.lpml"
  152: 	@echo "Makefile.build: generate a Makefile for compiling"
  153: 	@echo "                files inside the source directory; "
  154: 	@echo "                Makefile.build is generated from"
  155: 	@echo "                loncapafiles.lpml"
  156: 	@echo "Makefile.install: generate a Makefile for installing"
  157: 	@echo "                  files; built dynamically from"
  158: 	@echo "                  loncapafiles.lpml"
  159: 	@echo "*** TARGETS FOR OPERATING ON FILESYSTEMS ACROSS THE NETWORK ***"
  160: 	@echo "lpmladm: coordinates username=lpmladm mediated secure shell"
  161: 	@echo "         processes; needed for the NET_* targets"
  162: 	@echo "NET_hosts_and_domain_tab: install the hosts.tab and domain.tab"
  163: 	@echo "                          to a filesystem elsewhere"
  164: 	@echo "                          on the network"
  165: 	@echo "NET_webserverconf: fine-tune the web server configuration on a"
  166: 	@echo "                   filesystem elsewhere on the network"
  167: 	@echo "NET_rawinstall: launch the rawinstall target on a filesystem"
  168: 	@echo "                elsewhere on the network"
  169: 	@echo "*** TARGETS FOR MAKING LISTS (MANIFESTS) OF LON-CAPA FILES ***"
  170: 	@echo "MANIFEST_all: generate a list of all files to be included in"
  171: 	@echo "              the distributed tarball"
  172: 	@echo "MANIFEST_cvs: essentially a list of all CVS/Entries files used"
  173: 	@echo "              for 'time-checking' intelligence"
  174: 	@echo "MANIFEST_lpml: a list of all LON-CAPA files to be installed,"
  175: 	@echo "               compile from, used as building software, and"
  176: 	@echo "               testing"
  177: 	@echo "MANIFEST_vanillatar: 'README'-type top-level files that a user"
  178: 	@echo "                     of the distributed tarball would first"
  179: 	@echo "                     look at and work with"
  180: 	@echo "*** STATUS REPORT TARGETS ***"
  181: 	@echo "warningnote: analyze the WARNINGS file and produce a synopsis"
  182: 	@echo "             and recommended action to the user"
  183: 	@echo "HTML: generate an HTML-formatted description of the LON-CAPA"
  184: 	@echo "      source files"
  185: 	@echo "status: compare the TARGET filesystem with a compiled loncapa "
  186: 	@echo "        source directory"
  187: 	@echo "statuspost: post the results of "make status" to "
  188: 	@echo "            TARGET/home/httpd/html/lon-status/filestatus.html"
  189: 	@echo "rpmstatus: compare the rpms on a system to defined lists "
  190: 	@echo "           loncapa/doc/otherfiles/cd_rpms and "
  191: 	@echo "           loncapa/doc/otherfiles/rpm_list.txt"
  192: 	@echo "rpmstatuspost: post the results of 'make rpmstatus' to "
  193: 	@echo "            TARGET/home/httpd/html/lon-status/rpmstatus.html"
  194: 	@echo "*** ALTERNATIVE PACKAGING TARGETS ***"
  195: 	@echo "RPM: build LON-CAPA-base RPM from loncapa source repository"
  196: 	@echo "     (still under development)"
  197: 	@echo "DPKG: build a loncapa Debian package from loncapa source"
  198: 	@echo "      repository (still under development)"
  199: 	@echo "base_rpm_file_list: create a file listing to be used for"
  200: 	@echo "                    generating an RPM software package"
  201: 	@echo "BinaryRoot: create a BinaryRoot directory to be used for"
  202: 	@echo "            generating an RPM software package"
  203: 	@echo "*** MASTER DOCUMENTATION TARGETS ***"	
  204: 	@echo "doc: generate web-page documentation for install.lon-capa.org"
  205: 	@echo "     (and eventually for documentation on installed machines)"
  206: 	@echo "pdfdoc: make a PDF-formatted compilation of all installation"
  207: 	@echo "        documentation"
  208: 	@echo "*** KEEPING THINGS CLEAN ***"
  209: 	@echo "clean: remove any files that might (even by remote chance)"
  210: 	@echo "       interfere with rebuilding/recompiling software"
  211: 	@echo "reallyclean: remove all files that were generated during"
  212: 	@echo "             building or compilation of the software"
  213: 	@echo "uninstall: remove all directories that do not contain files"
  214: 	@echo "           from other software packages and that do not contain"
  215: 	@echo "           student and instructor data; NOTE THAT THIS IS"
  216: 	@echo "           INTERACTIVE--you will be given a final chance"
  217: 	@echo "           to look at what will and will not be deleted."
  218: 	@echo "           Still, be careful.  This is a very new target and is"
  219: 	@echo "           an alpha-level software feature for now."
  220: 	@echo "backup: rolls a tarball backup of all important student and "
  221: 	@echo "        instructor data (NOT YET IMPLEMENTED)"
  222: 	@echo "restore: reseeds a LON-CAPA server with tarball backups "
  223: 	@echo "         generated by \"make backup\" (NOT YET IMPLEMENTED)"
  224: 	@echo "*** AUXILIARY TESTS ***"
  225: 	@echo "localauth: tests to see if localauth exists or not and run"
  226: 	@echo "           appropriate tests"
  227: 	@echo "*** A HELPFUL DEPENDENCY ***"
  228: 	@echo "alwaysrun: blank target that is a dependency for targets"
  229: 	@echo "           that should \"always run\""
  230: 
  231: # =========================== *** RUNNING TESTS TO ENSURE SOLID PERFORMANCE ***
  232: 
  233: test: TEST_lpml_scripts TEST_system_dependencies TEST_web_layer
  234: 	@echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
  235: 
  236: TEST_system_dependencies:
  237: 	@echo "TESTING SYSTEM DEPENDENCIES"
  238: 	cd system_dependencies; make
  239: 
  240: TEST_lpml_scripts:
  241: 	@echo "TESTING LPML INSTALLATION CODE"
  242: 	cd ../test; perl filecomparetest.pl
  243: 
  244: TEST_web_layer:
  245: 	@echo "TESTING WEB LAYER"
  246: 	cd weblayer_test; make
  247: 
  248: TEST_hosts_tab:
  249: 	@echo "Testing hosts.tab"
  250: 	@if (test -e ../hosts.tab); then \
  251: 		echo "there is a defined link or file; assume okay"; \
  252: 	else echo "**** ERROR **** hosts.tab not defined!" && \
  253: 	     echo -n "You need to do one of the following within your " && \
  254: 	     echo "CVS repository (cd loncapa/loncom)" && \
  255: 	     echo "   1) ln -s production_dns_hosts.tab dns_hosts.tab" && \
  256: 	     echo "   2) ln -s development_dns_hosts.tab dns_hosts.tab" && \
  257: 	     echo "or 3) ln -s rawhide_hosts.tab hosts.tab" && \
  258: 	     echo "(you most likely want option #1, production_hosts.tab)" && \
  259: 	     exit 1; \
  260: 	fi
  261: 
  262: TEST_domain_tab:
  263: 	@echo "Testing domain.tab"
  264: 	@if (test -e ../domain.tab); then \
  265: 		echo "there is a defined link or file; assume okay"; \
  266: 	else echo "**** ERROR **** domain.tab not defined!" && \
  267: 	     echo -n "You need to do one of the following within your " && \
  268: 	     echo "CVS repository (cd loncapa/loncom)" && \
  269: 	     echo "   1) ln -s production_dns_domain.tab dns_domain.tab" && \
  270: 	     echo "   2) ln -s development_dns_domain.tab dns_domain.tab" && \
  271: 	     echo "or 3) ln -s rawhide_domain.tab domain.tab" && \
  272: 	     echo "(you most likely want option #1, production_domain.tab)" && \
  273: 	     exit 1; \
  274: 	fi
  275: 
  276: TEST_html2ps:
  277: 	@if (test -e /usr/local/html2ps/bin/html2ps); then \
  278: 		echo "I can find html2ps; assume okay"; \
  279: 	else \
  280: 	echo "**** ERROR **** cannot find /usr/local/html2ps/bin/html2ps!" && \
  281:         echo "Please visit http://www.tdb.uu.se/~jan/html2ps.html" && \
  282: 	exit 1; \
  283: 	fi
  284: 
  285: # ======================= *** GENERAL TARGETS SUCH AS 'build' AND 'install' ***
  286: 
  287: build: Makefile.build pod2html.sh pod2man.sh
  288: 	install -d $(SOURCE)/doc/man
  289: 	install -d $(SOURCE)/doc/scripts
  290: 	install -d $(SOURCE)/doc/lib/perl/Apache
  291: 	echo -n "" > WARNINGS
  292: 	make -f Makefile.build all
  293: 	echo '1' > buildflag
  294: 	make warningnote
  295: 
  296: buildflag:
  297: 	@echo "**** ERROR **** You need to run 'make build' first" > WARNINGS
  298: 	make warningnote
  299: 	@need_to_run_make_build_first 2>/dev/null
  300: 
  301: configinstall: Makefile.configinstall
  302: 	make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  303: 	configfiles
  304: 	if (test "0" = $(NORESTORECONF)); then \
  305: 	perl loncaparestoreconfigurations suffix .lpmlnew; fi
  306: 
  307: install: buildflag VERSION TEST_hosts_tab TEST_domain_tab Makefile.install Makefile
  308: 	echo -n "" > WARNINGS
  309: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  310: 	directories
  311: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  312: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  313: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  314: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  315: 	make postinstall
  316: 	make warningnote
  317: 	@echo "You can now run 'make test' to see if your system is ready to go!"
  318: #	@echo "NOTE THAT YOUR SYSTEM MUST HAVE MYSQL WITH A USER=\"www\" AND"
  319: #	@echo -n "PASSWORD=\"localhostkey\" FOR www\@localhost"
  320: #	@echo -n "(YOU MAY NEED TO REINITIALIZE YOUR MYSQL www\@localhost USER)"
  321: #	@echo -n "Please see http://install.lon-capa.org/ for more information"
  322: 
  323: rawinstall: VERSION Makefile.install Makefile
  324: 	echo -n "" > WARNINGS
  325: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  326: 	directories
  327: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  328: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  329: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  330: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  331: 
  332: hosts_and_domain_tab: TEST_hosts_tab TEST_domain_tab
  333: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  334: 	perl xfml_parse.pl $(SOURCE)/doc/loncapafiles/valid_hosts.xfml | \
  335: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
  336: 	"$(TARGET)" > Makefile.install
  337: 	make -f Makefile.install directories
  338: 	make -f Makefile.install files
  339: 	@echo "If hosts.tab or domain.tab has changed, restart httpd and loncontrol:"
  340: 	@echo "   /etc/rc.d/init.d/httpd restart"
  341: 	@echo "   /etc/rc.d/init.d/loncontrol restart"
  342: 
  343: webserverconf:
  344: 	cat $(SOURCE)/doc/loncapafiles/webserver.piml | \
  345: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  346: 	tee -a WARNINGS
  347: 
  348: # ---------------- Top-level files such as README, UPDATE, CHECKRPMS, and TEST
  349: vanillatar:
  350: 	# --------------------------- Point UPDATE to the internal make process
  351: 	cp  $(SOURCE)/loncom/UPDATE $(SOURCE)/UPDATE
  352: 	# ----------------------------- Point TEST to the internal make process
  353: 	echo '#!/bin/sh' > $(SOURCE)/TEST
  354: 	echo 'cd loncom/build; make test' >> $(SOURCE)/TEST
  355: 	echo 'cd system_dependencies || cd loncom/build/system_dependencies; cp -v CPAN_STATUS_REPORT ../../../CPAN_STATUS_REPORT' >> $(SOURCE)/TEST
  356: 	# ----------------------------- Copy CHECKRPMS to the vanilla top-level
  357: 	cp -v $(SOURCE)/loncom/build/CHECKRPMS $(SOURCE)/CHECKRPMS
  358: 	# ----------------------- vanilla executables must indeed be executable
  359: 	chmod a+rx $(SOURCE)/UPDATE
  360: 	chmod a+rx $(SOURCE)/TEST
  361: 	chmod a+rx $(SOURCE)/CHECKRPMS
  362: 	# -------------------------------- Copy README to the vanilla top-level
  363: 	#cp -v $(SOURCE)/doc/shortest_path_redhat7.2.txt $(SOURCE)/README
  364: 
  365: tardist:
  366: 	make MANIFEST_all
  367: 	make vanillatar
  368: 	# -------------------------------------------------------- Make tardist
  369: 	@cd $(SOURCE); \
  370: 	if (test -h $(DIRTARGET)); then \
  371: 		echo "$(DIRTARGET) link already defined; assume okay"; \
  372: 	else \
  373: 		ln -s . $(DIRTARGET); \
  374: 	fi
  375: 	cp -v $(SOURCE)/loncom/license/about.html \
  376: 	$(SOURCE)/loncom/license/about.html.orig
  377: 	cp -v $(SOURCE)/loncom/loncapa_apache.conf \
  378: 	$(SOURCE)/loncom/loncapa_apache.conf.orig
  379: 	make aboutVERSION
  380: 	cd $(SOURCE); \
  381: 	tar --no-recursion --numeric-owner --files-from MANIFEST \
  382: 	-h -czf $(DIRTARGET).tar.gz 2>tar_WARNINGS || [ "0" == "0" ]
  383: 	mv -v $(SOURCE)/loncom/license/about.html.orig \
  384: 	$(SOURCE)/loncom/license/about.html
  385: 	mv -v $(SOURCE)/loncom/loncapa_apache.conf.orig \
  386: 	$(SOURCE)/loncom/loncapa_apache.conf
  387: 	cat $(SOURCE)/tar_WARNINGS | \
  388: 	xargs --replace=XXX echo '**** WARNING **** XXX' > WARNINGS
  389: 	rm -f $(SOURCE)/tar_WARNINGS
  390: 	make warningnote
  391: 
  392: ntpcheck:
  393: 	cat $(SOURCE)/doc/loncapafiles/ntpcheck.piml | \
  394: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  395: 	tee -a WARNINGS
  396: 
  397: html_parser_check:
  398: 	cat $(SOURCE)/doc/loncapafiles/html_parser_check.piml | \
  399: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  400: 	tee -a WARNINGS
  401: 
  402: math_random_check:
  403: 	cat $(SOURCE)/doc/loncapafiles/math_random_check.piml | \
  404: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  405: 	tee -a WARNINGS
  406: 
  407: cron_lpmlcheck:
  408: 	cat $(SOURCE)/doc/loncapafiles/cron_lpmlcheck.piml | \
  409: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  410: 	tee -a WARNINGS
  411: 
  412: chkconfig:
  413: 	cat $(SOURCE)/doc/loncapafiles/chkconfig.piml | \
  414: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  415: 	tee -a WARNINGS
  416: 
  417: rpmcheck:
  418: 	cat $(SOURCE)/doc/loncapafiles/rpmcheck.piml | \
  419: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  420: 	tee -a WARNINGS
  421: 
  422: sanitycheck:
  423: 	cat $(SOURCE)/doc/loncapafiles/sanitycheck.piml | \
  424: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  425: 	tee -a WARNINGS
  426: 
  427: logcleanup:
  428: 	cat $(SOURCE)/doc/loncapafiles/logcleanup.piml | \
  429: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  430: 	tee -a WARNINGS
  431: 
  432: updatequery:
  433: 	cat $(SOURCE)/doc/loncapafiles/updatequery.piml | \
  434: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
  435: 
  436: run_searchcat:
  437: 	cat $(SOURCE)/doc/loncapafiles/run_searchcat.piml | \
  438: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
  439: 
  440: clean_file_permissions:
  441: 	cat $(SOURCE)/doc/loncapafiles/clean_file_permissions.piml | \
  442: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  443: 	tee -a WARNINGS
  444: 
  445: accesscount_seed:
  446: 	cat $(SOURCE)/doc/loncapafiles/accesscount_seed.piml | \
  447: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  448: 	tee -a WARNINGS
  449: 
  450: modify_config_files:
  451: 	cat $(SOURCE)/doc/loncapafiles/modify_config_files.piml | \
  452: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  453: 	tee -a WARNINGS
  454: 
  455: reseval_fixup:
  456: 	cat $(SOURCE)/doc/loncapafiles/reseval_fixup.piml | \
  457: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  458: 	tee -a WARNINGS
  459: 
  460: update_queue_slots:
  461: 	cat $(SOURCE)/doc/loncapafiles/update_queue_slots.piml | \
  462: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  463: 	tee -a WARNINGS
  464: 
  465: clearoutoldspreadsheetcache:
  466: 	cat $(SOURCE)/doc/loncapafiles/clearoutoldspreadsheetcache.piml | \
  467: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  468: 	tee -a WARNINGS
  469: 
  470: sendmail_fix:
  471: 	cat $(SOURCE)/doc/loncapafiles/sendmail_fix.piml | \
  472: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  473: 	tee -a WARNINGS
  474: 
  475: ownership_fix:
  476: 	cat $(SOURCE)/doc/loncapafiles/ownership_fix.piml | \
  477: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  478: 	tee -a WARNINGS
  479: 
  480: wrap_setuid:
  481: 	cat $(SOURCE)/doc/loncapafiles/wrap_setuid.piml | \
  482: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  483: 	tee -a WARNINGS
  484: 
  485: latex_fixup:
  486: 	cat $(SOURCE)/doc/loncapafiles/latex_fixup.piml | \
  487:         perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  488:         tee -a WARNINGS
  489: 
  490: picins_check:
  491: 	cat $(SOURCE)/doc/loncapafiles/picins_check.piml | \
  492: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  493: 	tee -a WARNINGS
  494: 
  495: postinstall:
  496: 	make webserverconf
  497: 	make reseval_fixup
  498: 	make clean_file_permissions
  499: 	make accesscount_seed
  500: 	make update_queue_slots
  501: 	make modify_config_files
  502: 	make clearoutoldspreadsheetcache
  503: 	make chkconfig
  504: 	make rpmcheck
  505: 	make ntpcheck
  506: 	make html_parser_check
  507: 	make cron_lpmlcheck
  508: 	make sanitycheck
  509: 	make logcleanup
  510: 	make sendmail_fix
  511: 	make ownership_fix
  512: 	make wrap_setuid
  513: 	make latex_fixup
  514: 	make picins_check
  515: VERSION:
  516: 	install -d $(TARGET)/etc
  517: 	echo -n "LON-CAPA release $(VERSION)-" > $(TARGET)/etc/loncapa-release
  518: 	date +"%Y%m%d" >> $(TARGET)/etc/loncapa-release
  519: 	install -d $(TARGET)/home/httpd/html/lon-status
  520: 	echo -n "$(VERSION)-" > $(TARGET)/home/httpd/html/lon-status/version.txt
  521: 	date +"%Y%m%d" >> $(TARGET)/home/httpd/html/lon-status/version.txt
  522: 
  523: aboutVERSION:
  524: 	cat $(SOURCE)/loncom/license/about.html | \
  525: 	perl -e '$$d=`date +"%Y%m%d%H"`;chomp($$d);while(<>){s/\<\!\-\- VERSION \-\-\>/$(VERSION)-$$d/; print;}' > \
  526: 	$(SOURCE)/loncom/license/about.html.new
  527: 	mv -v $(SOURCE)/loncom/license/about.html.new \
  528: 	$(SOURCE)/loncom/license/about.html
  529: 	cat $(SOURCE)/loncom/loncapa_apache.conf | \
  530: 	perl -e '$$d=`date +"%Y%m%d%H"`;chomp($$d);while(<>){s/\<\!\-\- VERSION \-\-\>/$(VERSION)-$$d/; print;}' > \
  531: 	$(SOURCE)/loncom/loncapa_apache.conf.new
  532: 	mv -v $(SOURCE)/loncom/loncapa_apache.conf.new \
  533: 	$(SOURCE)/loncom/loncapa_apache.conf
  534: 
  535: # ========= *** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***
  536: 
  537: Makefile.configinstall: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml \
  538:                         lpml_parse.pl
  539: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  540: 	perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
  541: 	"$(TARGET)" > Makefile.configinstall
  542: 
  543: Makefile.build: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  544: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  545: 	perl lpml_parse.pl build $(CATEGORY) $(DIST) "$(SOURCE)" "$(TARGET)" \
  546: 	> Makefile.build
  547: 
  548: Makefile.install: alwaysrun
  549: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  550: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
  551: 	"$(TARGET)" > Makefile.install
  552: 
  553: # ============= *** TARGETS FOR OPERATING ON FILESYSTEMS ACROSS THE NETWORK ***
  554: 
  555: lpmladm:
  556: 	@if (test $(METAMTARGET) = "TRANSPORT"); then \
  557: 		echo "Transporting to $(HOSTNAME)"; \
  558: 		sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
  559: 		SOURCE="$(SOURCE)" \
  560: 		TARGET="lpmladm.$(TIMESTAMP)" \
  561: 		NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
  562: 		cd lpmladm.$(TIMESTAMP); \
  563: 		sudo tar czvf ../tarball$(TIMESTAMP).tar.gz .; \
  564: 		cd ..; scp tarball$(TIMESTAMP).tar.gz \
  565: 		lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
  566: 		ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
  567: 		ssh lpmladm@$(HOSTNAME) sudo tar -x -z -v -C / \
  568: 		-p --same-owner -f \
  569: 		/tarball$(TIMESTAMP).tar.gz; \
  570: 		ssh lpmladm@$(HOSTNAME) sudo rm -f \
  571: 		/tarball$(TIMESTAMP).tar.gz; \
  572: 	elif (test $(METAMTARGET) = "LAUNCH"); then \
  573: 		echo "Launching process on $(HOSTNAME)"; \
  574: 		LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
  575: 		make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
  576: 		TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
  577: 		LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
  578: 		scp $(SAVE) lpmladm@$(HOSTNAME):~/$(SAVE); \
  579: 		ssh lpmladm@$(HOSTNAME) sudo perl $(SAVE); \
  580: 		ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
  581: 	else \
  582: 		echo "**** ERROR **** Incorrect METAMTARGET"; \
  583: 	fi
  584: 
  585: NET_hosts_and_domain_tab:
  586: 	make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
  587: 	MTARGET="hosts_and_domain_tab" HOSTNAME="$(HOSTNAME)" lpmladm
  588: 
  589: NET_webserverconf:
  590: 	make TIMESTAMP=`date +"%s"` METAMTARGET="LAUNCH" \
  591: 	MTARGET="webserverconf" HOSTNAME="$(HOSTNAME)" lpmladm
  592: 
  593: NET_rawinstall:
  594: 	make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
  595: 	MTARGET="rawinstall" HOSTNAME="$(HOSTNAME)" lpmladm
  596: 
  597: # ============== *** TARGETS FOR MAKING LISTS (MANIFESTS) OF LON-CAPA FILES ***
  598: 
  599: MANIFEST_all:
  600: 	# --------------------------------------------------------- start clean
  601: 	rm -f $(SOURCE)/MANIFEST
  602: 	make MANIFEST_lpml
  603: 	make MANIFEST_vanillatar
  604: 	make MANIFEST_cvs
  605: 	# ---------------------------------- might as well include the MANIFEST
  606: 	echo 'MANIFEST' >> $(SOURCE)/MANIFEST
  607: 	# ------------------------------------------ hosts.tab are belong to us
  608: 	echo 'loncom/rawhide_hosts.tab' >> $(SOURCE)/MANIFEST
  609: 	echo 'loncom/production_hosts.tab' >> $(SOURCE)/MANIFEST
  610: 	echo 'loncom/development_hosts.tab' >> $(SOURCE)/MANIFEST
  611: 	echo 'loncom/production_domain.tab' >> $(SOURCE)/MANIFEST
  612: 	echo 'loncom/development_domain.tab' >> $(SOURCE)/MANIFEST
  613: 	echo 'loncom/production_dns_hosts.tab' >> $(SOURCE)/MANIFEST
  614: 	echo 'loncom/development_dns_hosts.tab' >> $(SOURCE)/MANIFEST
  615: 	echo 'loncom/production_dns_domain.tab' >> $(SOURCE)/MANIFEST
  616: 	echo 'loncom/development_dns_domain.tab' >> $(SOURCE)/MANIFEST
  617: 	# ------------------ Files needed for dynamically generated directories
  618: 	echo 'doc/man' >> $(SOURCE)/MANIFEST
  619: 	echo 'doc/lib' >> $(SOURCE)/MANIFEST
  620: 	echo 'doc/lib/perl' >> $(SOURCE)/MANIFEST
  621: 	echo 'doc/lib/perl/Apache' >> $(SOURCE)/MANIFEST
  622: 	echo 'doc/scripts' >> $(SOURCE)/MANIFEST
  623: 	# --------------------------------------------------- Clean up MANIFEST
  624: 	cd $(SOURCE); \
  625: 	sort MANIFEST | perl -nle 'print "$(DIRTARGET)/$$_"' | \
  626: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  627: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  628: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  629: 	perl -nle 's/\/\.\//\//g;print' | sort | uniq > \
  630: 	MANIFEST_loncapa
  631: 	cd $(SOURCE); mv -v MANIFEST_loncapa MANIFEST
  632: 
  633: # --------------- MANIFEST files with important CVS versioning/date information
  634: MANIFEST_cvs:
  635: 	# ------ CVS/Entries directories to retain 'time-checking' intelligence
  636: 	cd $(SOURCE); find . -type f -name 'Entries' | grep 'CVS/Entries' >> \
  637: 	MANIFEST
  638: 
  639: # ------------------- MANIFEST the building, testing and standard loncapa files
  640: MANIFEST_lpml:
  641: 	cat $(SOURCE)/doc/loncapafiles/buildfiles.lpml | \
  642: 	perl lpml_parse.pl MANIFEST development $(DIST) \
  643: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  644: 	cat $(SOURCE)/doc/loncapafiles/testfiles.lpml | \
  645: 	perl lpml_parse.pl MANIFEST development $(DIST) \
  646: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  647: 	cat $(SOURCE)/doc/loncapafiles/installfiles.lpml | \
  648: 	perl lpml_parse.pl MANIFEST development $(DIST) \
  649: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  650: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  651: 	perl lpml_parse.pl MANIFEST development $(DIST) \
  652: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  653: 
  654: # ------------ Files for top-level (the vanilla layer that the user first sees)
  655: MANIFEST_vanillatar:
  656: 	echo 'README' >> $(SOURCE)/MANIFEST
  657: 	echo 'UPDATE' >> $(SOURCE)/MANIFEST
  658: 	echo 'TEST' >> $(SOURCE)/MANIFEST
  659: 	echo 'CHECKRPMS' >> $(SOURCE)/MANIFEST
  660: 
  661: # =============================================== *** STATUS REPORT TARGETS ***
  662: 
  663: warningnote:
  664: 	@if (test -s WARNINGS); then \
  665: 		W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
  666: 		E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
  667: 		N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
  668: 		echo "--->  $$W WARNINGS ENCOUNTERED!       "; \
  669: 		echo "--->  $$E ERRORS ENCOUNTERED!         "; \
  670: 		echo "--->  $$N NOTES ENCOUNTERED!          "; \
  671: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  672: 		echo "!!!!  Please read the WARNINGS file !!!!"; \
  673: 		echo "!!!!   to make sure everything is   !!!!"; \
  674: 		echo "!!!!    correct and taken care of   !!!!"; \
  675: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  676: 	fi
  677: 
  678: HTML:
  679: 	install -d HTML
  680: 	cp $(SOURCE)/doc/loncapafiles/*.gif HTML
  681: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  682: 	perl lpml_parse.pl html development default "$(SOURCE)" '$(TARGET)' \
  683: 	> HTML/index.html
  684: 
  685: status:
  686: 	install -d HTML
  687: 	cp $(SOURCE)/doc/loncapafiles/*.gif HTML
  688: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  689: 	perl lpml_parse.pl html $(CATEGORY) $(DIST) "$(SOURCE)" "($TARGET)" | \
  690: 	perl lpml_html_posteval.pl > \
  691: 	HTML/filestatus.html
  692: 
  693: statuspost: status
  694: 	cp $(SOURCE)/doc/loncapafiles/*.gif \
  695: 	$(TARGET)/home/httpd/html/lon-status
  696: 	cp HTML/filestatus.html \
  697: 	$(TARGET)/home/httpd/html/lon-status/filestatus.html
  698: 
  699: rpmstatus:
  700: 	install -d RPMSTATUS
  701: 	rpm -qa --queryformat \
  702: 	'%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
  703: 	RPMSTATUS/current.tmp
  704: 	cat $(SOURCE)/doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
  705: 	cat $(SOURCE)/doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
  706: 	perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
  707: 	RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
  708: 
  709: rpmstatuspost: rpmstatus
  710: 	cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
  711: 
  712: # ======================================= *** ALTERNATIVE PACKAGING TARGETS ***
  713: 
  714: RPM: BinaryRoot base_rpm_file_list
  715: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  716: 	perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) \
  717: 	> base_customizerpm.xml
  718: 	cat base_rpm_file_list.txt | perl make_rpm.pl base $(VERSION) \
  719: 	$(RELEASE) '' '' BinaryRoot base_customizerpm.xml
  720: 
  721: DPKG:
  722: 	make TARGET='lon-capa-$(VERSION)' NORESTORECONF='1' install
  723: 	@echo "You will next need to follow instructions at:"
  724: 	@echo "http://people.debian.org/~jaldhar/make_package1.html"
  725: 	@echo "A directory with a snapshot of the debian package files"
  726: 	@echo "is LON-CAPA-base."
  727: # What DPKG steps need to happen (for future implementation):
  728: # export EMAIL="" ... probably sharrison@mail.lon-capa.org
  729: # deb-make
  730: # edit debian/control
  731: # make debian/dirs file
  732: # make debian/copyright file
  733: # debian/README.debian... point them to LON-CAPA URLS
  734: # debian/changelog
  735: # debian/conffiles
  736: # debuild
  737: # and maybe do some GPG-related steps around here
  738: 
  739: base_rpm_file_list:
  740: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  741: 	perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
  742: 	'BinaryRoot' | sort > base_rpm_file_list.txt
  743: 
  744: BinaryRoot: base_rpm_file_list
  745: 	make TARGET='BinaryRoot' NORESTORECONF='1' install
  746: 
  747: # ======================================== *** MASTER DOCUMENTATION TARGETS ***
  748: 
  749: buildwebsite:
  750: 	cd ../../doc/build; perl ./generate_web_pages.pl
  751: 
  752: 
  753: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
  754: doc:
  755: 	install -d docs
  756: 	@if (test -e installation_manual.pdf); then \
  757: 		cp -vf installation_manual.pdf docs/.; \
  758: 	else \
  759: 		touch docs/installation_manual.pdf; \
  760: 	fi
  761: 	install -m 0755 -d docs/icons
  762: 	install -m 0644 $(SOURCE)/doc/icons/[^C][^V]* docs/icons
  763: 	install -m 0755 -d docs/reconfig
  764: 	cd docs; ln -fs installation_manual.pdf index.pdf
  765: 	cd docs/reconfig; ln -fs ../installation_manual.pdf index.pdf
  766: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  767: 		$(SOURCE)/doc/build/reconfig.html > docs/reconfig/index.html
  768: 	install -m 0755 -d docs/reconfig/confexamples
  769: 	install -m 0644 $(SOURCE)/doc/build/confexamples/[^C][^V]* \
  770: 		docs/reconfig/confexamples
  771: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  772: 		$(SOURCE)/doc/build/installindex.html > docs/index.html
  773: 	install -m 0755 -d docs/license
  774: 	cd docs/license; ln -fs ../installation_manual.pdf index.pdf
  775: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  776: 		$(SOURCE)/doc/build/license.html > docs/license/index.html
  777: 	install -m 0755 -d docs/contact
  778: 	cd docs/contact; ln -fs ../installation_manual.pdf index.pdf
  779: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  780: 		$(SOURCE)/doc/build/contact.html > docs/contact/index.html
  781: 	install -m 0755 -d docs/faq
  782: 	cd docs/faq; ln -fs ../installation_manual.pdf index.pdf
  783: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  784: 		$(SOURCE)/doc/build/faq.html > docs/faq/index.html
  785: 	install -m 0755 -d docs/downloads
  786: 	cd docs/downloads; ln -fs ../installation_manual.pdf download.pdf
  787: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  788: 		$(SOURCE)/doc/build/download.html > docs/downloads/index.html
  789: 	install -m 0755 -d docs/install
  790: 	cd docs/install; ln -fs ../installation_manual.pdf install.pdf
  791: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  792: 		$(SOURCE)/doc/build/install.html > docs/install/index.html
  793: 	cp -v $(SOURCE)/doc/install/redhat7.3/new_install_rh73.html \
  794: 		docs/install/rh73.html
  795: 	cp -v $(SOURCE)/doc/install/redhat7.3/new_install_rh73.html \
  796: 		docs/downloads/rh73.html
  797: 	install -m 0755 -d docs/upgrade
  798: 	cd docs/upgrade; ln -fs ../installation_manual.pdf upgrade.pdf
  799: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  800: 		$(SOURCE)/doc/build/upgrade.html > docs/upgrade/index.html
  801: 	cd docs; tar czvpf ../docs.tar.gz .
  802: 
  803: pdfdoc: TEST_html2ps
  804: 	install -d pdfdoc
  805: 	/usr/local/html2ps/bin/html2ps -D \
  806: 	$(SOURCE)/doc/build/installindex_noform.html > pdfdoc/installindex.ps
  807: 	/usr/local/html2ps/bin/html2ps -D \
  808: 	$(SOURCE)/doc/build/reconfig.html | \
  809: 	perl -nle 's/\[EXAMPLE\]/\[EXAMPLE \(at end of document\)\]/g;print' \
  810: 	> pdfdoc/reconfig.ps
  811: 	/usr/local/html2ps/bin/html2ps -D \
  812: 	$(SOURCE)/doc/build/install.html > pdfdoc/install.ps
  813: 	/usr/local/html2ps/bin/html2ps -D \
  814: 	$(SOURCE)/doc/build/upgrade.html > pdfdoc/upgrade.ps
  815: 	/usr/local/html2ps/bin/html2ps -D \
  816: 	$(SOURCE)/doc/build/faq.html > pdfdoc/faq.ps
  817: 	/usr/local/html2ps/bin/html2ps -D \
  818: 	$(SOURCE)/doc/build/download.html > pdfdoc/download.ps
  819: 	/usr/local/html2ps/bin/html2ps -D \
  820: 	$(SOURCE)/doc/build/contact.html > pdfdoc/contact.ps
  821: 	/usr/local/html2ps/bin/html2ps -D \
  822: 	$(SOURCE)/doc/build/license.html > pdfdoc/license.ps
  823: #       This creates a bad confexamples.ps... so take the long way around
  824: #	cd $(SOURCE)/doc/build/confexamples; \
  825: #	mpage -P- -1 -H [^C]* > ../../../loncom/build/pdfdoc/confexamples.ps
  826: 	install -d pdfdoc/confexamples
  827: 	cd $(SOURCE)/doc/build/confexamples; \
  828: 	find . -type f | cut -b3- | grep -v '^C' | grep -v 'keyword' | \
  829: 	perl -nle \
  830: 	'`mpage -P- -1 -H $$_ > ../../../loncom/build/pdfdoc/confexamples/$$_.ps`;'
  831: 	echo '' > pdfdoc/contents.txt
  832: 	echo '' >> pdfdoc/contents.txt
  833: 	echo '          The Learning Online Network' >> pdfdoc/contents.txt
  834: 	echo '                    with the' >> pdfdoc/contents.txt
  835: 	echo '     Computer-Assisted Personalized Approach' >> \
  836: 	pdfdoc/contents.txt
  837: 	echo '' >> pdfdoc/contents.txt
  838: 	echo '' >> pdfdoc/contents.txt
  839: 	echo 'CONTENTS' >> pdfdoc/contents.txt
  840: 	echo '--------' >> pdfdoc/contents.txt
  841: 	echo 'Opening' >> pdfdoc/contents.txt
  842: 	echo 'Configuration' >> pdfdoc/contents.txt
  843: 	echo 'Installation' >> pdfdoc/contents.txt
  844: 	echo 'Upgrading a LON-CAPA Server' >> pdfdoc/contents.txt
  845: 	echo 'FAQ' >> pdfdoc/contents.txt
  846: 	echo 'Download' >> pdfdoc/contents.txt
  847: 	echo 'Contact Information' >> pdfdoc/contents.txt
  848: 	echo 'License Information' >> pdfdoc/contents.txt
  849: 	echo 'Configuration Examples' >> pdfdoc/contents.txt
  850: 	mpage -P- -1 \
  851: 	pdfdoc/contents.txt \
  852: 	pdfdoc/installindex.ps \
  853: 	pdfdoc/reconfig.ps \
  854: 	pdfdoc/install.ps \
  855: 	pdfdoc/upgrade.ps \
  856: 	pdfdoc/faq.ps \
  857: 	pdfdoc/download.ps \
  858: 	pdfdoc/contact.ps \
  859: 	pdfdoc/license.ps \
  860: 	pdfdoc/confexamples/*.ps \
  861: 	> pdfdoc/installation_manual.ps
  862: 	ps2pdf pdfdoc/installation_manual.ps pdfdoc/installation_manual.pdf
  863: 	mv -vf pdfdoc/installation_manual.pdf .
  864: 
  865: # ================================================ *** KEEPING THINGS CLEAN ***
  866: 
  867: clean:
  868: 	rm -f buildflag
  869: 	rm -Rf HTML
  870: 	rm -f installation_manual.pdf
  871: 	rm -f Makefile.build
  872: 	rm -f Makefile.install
  873: 	rm -f Makefile.configinstall
  874: 	rm -Rf BinaryRoot
  875: 	rm -Rf SetupBinaryRoot
  876: 	rm -Rf LON-CAPA-base
  877: 	rm -f base_rpm_file_list.txt
  878: 	rm -f base_customizerpm.xml
  879: 	rm -f setup_rpm_file_list.txt
  880: 	rm -f docs.tar.gz
  881: 	rm -Rf docs
  882: 	rm -Rf pdfdoc
  883: 	rm -f program.pl*
  884: 	rm -Rf lpmladm.*
  885: 	rm -f WARNINGS
  886: 	rm -f CPAN_STATUS_REPORT
  887: 	rm -f $(SOURCE)/loncom/build/hosts.tab
  888: 
  889: reallyclean:
  890: 	rm -f buildflag
  891: 	rm -f $(SOURCE)/README
  892: 	rm -f $(SOURCE)/UPDATE
  893: 	rm -f $(SOURCE)/TEST
  894: 	rm -f $(SOURCE)/MANIFEST
  895: 	rm -f $(SOURCE)/MANIFEST_loncapa
  896: 	rm -f $(SOURCE)/loncapa
  897: 	rm -f $(SOURCE)/loncom/build/hosts.tab
  898: 	rm -f $(SOURCE)/loncapa.tar.gz
  899: 	rm -Rf HTML
  900: 	rm -f installation_manual.pdf
  901: 	rm -f Makefile.build
  902: 	rm -f Makefile.install
  903: 	rm -f Makefile.configinstall
  904: 	rm -Rf BinaryRoot
  905: 	rm -Rf SetupBinaryRoot
  906: 	rm -Rf LON-CAPA-base
  907: 	rm -f base_rpm_file_list.txt
  908: 	rm -f base_customizerpm.xml
  909: 	rm -f setup_rpm_file_list.txt
  910: 	rm -f docs.tar.gz
  911: 	rm -Rf docs
  912: 	rm -Rf pdfdoc
  913: 	rm -f program.pl*
  914: 	rm -Rf lpmladm.*
  915: 	make -f Makefile.cvs clean
  916: 	rm -f WARNINGS
  917: 
  918: uninstall:
  919: 	rm -f UNINSTALL_SHELL_COMMANDS
  920: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  921: 	perl lpml_parse.pl uninstall_shell_commands $(CATEGORY) $(DIST) \
  922: 	"$(SOURCE)" "$(TARGET)" > UNINSTALL_SHELL_COMMANDS
  923: 	@echo -n "**** NOTE **** A file \"UNINSTALL_SHELL_COMMANDS\" has been "
  924: 	@echo "generated."
  925: 	@echo "First, you should view the contents of this file."
  926: 	@echo "If you are happy with the 'rm -Rf'! commands (or at least"
  927: 	@echo "have another job lined up in case of catastrophe), then you "
  928: 	@echo "can execute the following: sh ./UNINSTALL_SHELL_COMMANDS"
  929: 
  930: backup:
  931: 	@echo "Not yet implemented"
  932: 
  933: restore:
  934: 	@echo "Not yet implemented"
  935: 
  936: # ===================================================== *** AUXILIARY TESTS ***
  937: localauth:
  938: 	@if (test -e $(LOCALAUTHPATH)/localauth.pm) && \
  939:              !(diff $(LOCALAUTHPATH)/localauth-std.pm \
  940:               $(LOCALAUTHPATH)/localauth.pm > /dev/null); then \
  941: 		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; \
  942: 	elif (test -e $(LOCALAUTHPATH)/localauth.pm) && \
  943:               (diff $(LOCALAUTHPATH)/localauth-std.pm \
  944:               $(LOCALAUTHPATH)/localauth.pm > /dev/null); then \
  945: 		echo "**** NOTE **** LOCAL AUTH IS IDENTICAL WITH STANDARD TEMPLATE"| tee -a WARNINGS; \
  946: 	elif !(test -e $(LOCALAUTHPATH)/localauth.pm) && \
  947: 	      (test -e $(LOCALAUTHPATH)/localauth-std.pm); then \
  948: 		ln -s $(LOCALAUTHPATH)/localauth-std.pm $(LOCALAUTHPATH)/localauth.pm; \
  949: 	fi
  950: 
  951: # ================================================ *** A HELPFUL DEPENDENCY ***
  952: alwaysrun:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>