Annotation of loncom/build/Makefile, revision 1.205

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

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