File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.182.2.5: download - view: text, annotated - select for diffs
Fri Aug 18 21:34:27 2006 UTC (17 years, 9 months ago) by albertel
Branches: version_2_2_X
CVS tags: version_2_2_0
Diff to branchpoint 1.182: preferred, unified
- bump version

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

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