File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.200: download - view: text, annotated - select for diffs
Fri Jan 27 23:50:57 2012 UTC (12 years, 4 months ago) by raeburn
Branches: MAIN
CVS tags: HEAD
- Bug 6535
 Eliminate creation of unnecessary .lpmlsave files during install.
  - PDF manuals are not included in CVS, but instead are built dynamically
    when running make build (e.g., when creating a tarball for release).
    - Assign new categoryname: pdf manual and include check for this in
      lpml_parse.pl so filecompare.pl is called with -b3 flag.
  - license/about.html and loncapa_apache.conf in release tree are modified
    by make aboutVERSION, so developer installations can include version
    and datestamp of build in version info.
    - make aboutVERSION now includes code to set the last modified time to
      the CVS commit date, so unanted .lpmlsave files will no longer be created.
  - new file: getcvsdate.pl now included in loncom/build -- used to extract
    commit date/time from CVS/Entries for about.html and loncapa_apache.conf

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

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