File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.223: download - view: text, annotated - select for diffs
Tue Dec 21 13:57:47 2021 UTC (2 years, 4 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_12_X, HEAD
- Support CentOS Stream 8 and 9.

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

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