Annotation of loncom/build/Makefile, revision 1.171

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

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