File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.135: download - view: text, annotated - select for diffs
Wed Aug 21 20:40:08 2002 UTC (21 years, 9 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
- bumped version number

    1: # The LearningOnline Network with CAPA
    2: 
    3: # Scott Harrison, your friendly neighborhood volunteer
    4: # $Id: Makefile,v 1.135 2002/08/21 20:40:08 albertel Exp $
    5: 
    6: # TYPICAL USAGE of this Makefile is primarily for two targets:
    7: # "make build" and "make install".
    8: # Many other targets and features are supported (see the initial
    9: # help targets).
   10: 
   11: # ======================================= Default settings for Makefile options
   12: DISTPROBE=`perl ./distprobe`
   13: DIST=$(DISTPROBE)
   14: CATEGORY="development"
   15: SOURCE=../..
   16: TARGET=""
   17: NORESTORECONF="0"
   18: HOSTNAME=""
   19: LAUNCH=| perl
   20: QUERYLAUNCH=> /tmp/loncapa_query.pl; perl /tmp/loncapa_query.pl
   21: OUTSTREAM=>
   22: SAVE=program.pl.$(TIMESTAMP)
   23: LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
   24: METAMTARGET=""
   25: MTARGET=""
   26: VERSION=0.5
   27: DIRTARGET=loncapa-$(VERSION)
   28: 
   29: # =============================================== Help targets for the Makefile
   30: # If 'make' is run without any arguments, the 'help' target is called since
   31: # it is the first target.
   32: help:
   33: 	@echo "*** You need to specify a valid target ***"
   34: 	@echo "To get a list of valid targets: \"make help_TARGETS\""
   35: 	@echo "To get a list of valid options: \"make help_OPTIONS\""
   36: 	@echo " "
   37: 	@echo "Typically invoked targets are:"
   38: 	@echo "    make build"
   39: 	@echo "    make install"
   40: 	@echo "    make test"
   41: 	@echo "    make clean"
   42: 
   43: help_OPTIONS:
   44: 	@echo "* ADJUSTABLE OPTIONS *"
   45: 	@echo "(option) DIST can be redhat7, debian, redhat6.2, or default"
   46: 	@echo "         You probably do not need to specify this; it is"
   47: 	@echo "         automatically probed for."
   48: 	@echo "(option) CATEGORY can be 'runtime' or 'development'; currently"
   49: 	@echo "         the 'development' setting is the most reliable;"
   50: 	@echo "         eventually, production machines should be using the"
   51: 	@echo "         'runtime' settings"
   52: 	@echo "(option) SOURCE is an absolute or relative directory path."
   53: 	@echo "         SOURCE corresponds to the root directory of the"
   54: 	@echo "         loncapa source release"
   55: 	@echo "(option) TARGET is an absolute or relative directory path."
   56: 	@echo "         This is where files will be installed on your system."
   57: 	@echo "         Typically, this should be set to nothing (which"
   58: 	@echo "         corresponds to the '/' root of the entire filesystem)."
   59: 	@echo "(option) NORESTORECONF, when set to a non-zero value, stops"
   60: 	@echo "         filesystem upgrades from overwriting existing "
   61: 	@echo "         configuration files.  Ordinarily, NORESTORECONF=0, "
   62: 	@echo "         because the existing configuration files are safely"
   63: 	@echo "         dealt with (or so one hopes... :) )."
   64: 	@echo "(option) HOSTNAME specifies the name of a remote server for"
   65: 	@echo "         which a NET_* Makefile target should be launched"
   66: 	@echo "(option) VERSION; especially useful for the 'tardist' target"
   67: 	@echo "         this tags the tarball file and internal directories"
   68: 	@echo "         with a specific version string (conventionally "
   69: 	@echo "         numeric)"
   70: 
   71: help_TARGETS:
   72: 	@echo "*** RUNNING TESTS TO ENSURE SOLID PERFORMANCE ***"
   73: 	@echo "test: test different parts of the LON-CAPA system (TEST_*)."
   74: 	@echo "      Makefile-dependent processes as well as horizontal and"
   75: 	@echo "      vertical aspects of the LON-CAPA system architecture"
   76: 	@echo "      are all tested."
   77: 	@echo "TEST_lpml_scripts: make sure that the system can process"
   78: 	@echo "                   the Linux Packaging Markup Language."
   79: 	@echo "                   This is neither horizontal or vertical"
   80: 	@echo "                   testing.  The idea is to make sure that"
   81: 	@echo "                   the installation software itself works"
   82: 	@echo "                   as expected."
   83: 	@echo "TEST_system_dependencies: make sure that all needed system "
   84: 	@echo "                          components are active and present "
   85: 	@echo "                          on the server such as perl modules"
   86: 	@echo "                          and the MySQL database"
   87: 	@echo "                          (horizontal testing)"
   88: 	@echo "TEST_web_layer: mimic a login and various vertical actions on "
   89: 	@echo "                a LON-CAPA system"
   90: 	@echo "TEST_hosts_tab: make sure that a loncapa/loncom/hosts.tab"
   91: 	@echo "                file is specified for installation"
   92: 	@echo "TEST_html2ps: test for the presence of html2ps which is needed"
   93: 	@echo "              for making a PDF compilation for pdfdoc"
   94: 	@echo "*** GENERAL TARGETS SUCH AS 'build' AND 'install' ***"
   95: 	@echo "build: compile the source tree"
   96: 	@echo "buildflag: a semaphore that helps educate the user to run"
   97: 	@echo "           'make build' first before running 'make install'"
   98: 	@echo "configinstall: install configuration files and restore with"
   99: 	@echo "               prior information"
  100: 	@echo "install: install from a ***compiled*** source tree"
  101: 	@echo "         (see make build) to a specified TARGET destination"
  102: 	@echo "         on the filesystem (default setting is TARGET=/)."
  103: 	@echo "rawinstall: just install files, links and directories without"
  104: 	@echo "            any bells or whistles (e.g. double-checking"
  105: 	@echo "            configurations, fine-tuning webserver, etc.)"
  106: 	@echo "hosts_tab: install the hosts.tab to the filesystem"
  107: 	@echo "webserverconf: fine-tune the web server configuration;"
  108: 	@echo "               make sure the proper 'Include' statements"
  109: 	@echo "               are appended to httpd.conf"
  110: 	@echo "vanillatar: generate top-level files such as README, UPDATE,"
  111: 	@echo "            CHECKRPMS, and TEST (needed by tardist)"
  112: 	@echo "tardist: build a tarball that will upgrade the software on a "
  113: 	@echo "         system"
  114: 	@echo "sanitycheck: probe for common errors and recommend fixes to"
  115: 	@echo "             the user"
  116: 	@echo "updatequery: solicit the user for machine configuration"
  117: 	@echo "             information; to be incorporated during an update"
  118: 	@echo "             procedure (via the UPDATE command)"
  119: 	@echo "postinstall: double-check things after installation"
  120: 	@echo "VERSION: tag the filesystem with version information inside"
  121: 	@echo "         /etc/loncapa-release"
  122: 	@echo "aboutVERSION: place version information inside about.html"
  123: 	@echo "*** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***"
  124: 	@echo "Makefile.configinstall: generate a Makefile for configuration"
  125: 	@echo "                        files; built dynamically from"
  126: 	@echo "                        loncapafiles.lpml"
  127: 	@echo "Makefile.build: generate a Makefile for compiling"
  128: 	@echo "                files inside the source directory; "
  129: 	@echo "                Makefile.build is generated from"
  130: 	@echo "                loncapafiles.lpml"
  131: 	@echo "Makefile.install: generate a Makefile for installing"
  132: 	@echo "                  files; built dynamically from"
  133: 	@echo "                  loncapafiles.lpml"
  134: 	@echo "*** TARGETS FOR OPERATING ON FILESYSTEMS ACROSS THE NETWORK ***"
  135: 	@echo "lpmladm: coordinates username=lpmladm mediated secure shell"
  136: 	@echo "         processes; needed for the NET_* targets"
  137: 	@echo "NET_hosts_tab: install the hosts.tab to a filesystem elsewhere"
  138: 	@echo "               on the network"
  139: 	@echo "NET_webserverconf: fine-tune the web server configuration on a"
  140: 	@echo "                   filesystem elsewhere on the network"
  141: 	@echo "NET_rawinstall: launch the rawinstall target on a filesystem"
  142: 	@echo "                elsewhere on the network"
  143: 	@echo "*** TARGETS FOR MAKING LISTS (MANIFESTS) OF LON-CAPA FILES ***"
  144: 	@echo "MANIFEST_all: generate a list of all files to be included in"
  145: 	@echo "              the distributed tarball"
  146: 	@echo "MANIFEST_cvs: essentially a list of all CVS/Entries files used"
  147: 	@echo "              for 'time-checking' intelligence"
  148: 	@echo "MANIFEST_lpml: a list of all LON-CAPA files to be installed,"
  149: 	@echo "               compile from, used as building software, and"
  150: 	@echo "               testing"
  151: 	@echo "MANIFEST_vanillatar: 'README'-type top-level files that a user"
  152: 	@echo "                     of the distributed tarball would first"
  153: 	@echo "                     look at and work with"
  154: 	@echo "*** STATUS REPORT TARGETS ***"
  155: 	@echo "warningnote: analyze the WARNINGS file and produce a synopsis"
  156: 	@echo "             and recommended action to the user"
  157: 	@echo "HTML: generate an HTML-formatted description of the LON-CAPA"
  158: 	@echo "      source files"
  159: 	@echo "status: compare the TARGET filesystem with a compiled loncapa "
  160: 	@echo "        source directory"
  161: 	@echo "statuspost: post the results of "make status" to "
  162: 	@echo "            TARGET/home/httpd/html/lon-status/filestatus.html"
  163: 	@echo "rpmstatus: compare the rpms on a system to defined lists "
  164: 	@echo "           loncapa/doc/otherfiles/cd_rpms and "
  165: 	@echo "           loncapa/doc/otherfiles/rpm_list.txt"
  166: 	@echo "rpmstatuspost: post the results of 'make rpmstatus' to "
  167: 	@echo "            TARGET/home/httpd/html/lon-status/rpmstatus.html"
  168: 	@echo "*** ALTERNATIVE PACKAGING TARGETS ***"
  169: 	@echo "RPM: build LON-CAPA-base RPM from loncapa source repository"
  170: 	@echo "     (still under development)"
  171: 	@echo "DPKG: build a loncapa Debian package from loncapa source"
  172: 	@echo "      repository (still under development)"
  173: 	@echo "base_rpm_file_list: create a file listing to be used for"
  174: 	@echo "                    generating an RPM software package"
  175: 	@echo "BinaryRoot: create a BinaryRoot directory to be used for"
  176: 	@echo "            generating an RPM software package"
  177: 	@echo "*** MASTER DOCUMENTATION TARGETS ***"	
  178: 	@echo "doc: generate web-page documentation for install.lon-capa.org"
  179: 	@echo "     (and eventually for documentation on installed machines)"
  180: 	@echo "pdfdoc: make a PDF-formatted compilation of all installation"
  181: 	@echo "        documentation"
  182: 	@echo "*** KEEPING THINGS CLEAN ***"
  183: 	@echo "clean: remove any files that might (even by remote chance)"
  184: 	@echo "       interfere with rebuilding/recompiling software"
  185: 	@echo "reallyclean: remove all files that were generated during"
  186: 	@echo "             building or compilation of the software"
  187: 	@echo "*** A HELPFUL DEPENDENCY ***"
  188: 	@echo "alwaysrun: blank target that is a dependency for targets"
  189: 	@echo "           that should \"always run\""
  190: 
  191: # =========================== *** RUNNING TESTS TO ENSURE SOLID PERFORMANCE ***
  192: 
  193: test: TEST_lpml_scripts TEST_system_dependencies TEST_web_layer
  194: 	@echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
  195: 
  196: TEST_system_dependencies:
  197: 	@echo "TESTING SYSTEM DEPENDENCIES"
  198: 	cd system_dependencies; make
  199: 
  200: TEST_lpml_scripts:
  201: 	@echo "TESTING LPML INSTALLATION CODE"
  202: 	cd ../test; perl filecomparetest.pl
  203: 
  204: TEST_web_layer:
  205: 	@echo "TESTING WEB LAYER"
  206: 	cd weblayer_test; make
  207: 
  208: TEST_hosts_tab:
  209: 	@echo "Testing hosts.tab"
  210: 	@if (test -e ../hosts.tab); then \
  211: 		echo "there is a defined link or file; assume okay"; \
  212: 	else echo "**** ERROR **** hosts.tab not defined!" && \
  213: 	     echo -n "You need to do one of the following within your " && \
  214: 	     echo "CVS repository (cd loncapa/loncom)" && \
  215: 	     echo "   1) ln -s production_hosts.tab hosts.tab" && \
  216: 	     echo "   2) ln -s development_hosts.tab hosts.tab" && \
  217: 	     echo "or 3) ln -s rawhide_hosts.tab hosts.tab" && \
  218: 	     echo "(you most likely want option #1, production_hosts.tab)" && \
  219: 	     exit 1; \
  220: 	fi
  221: 
  222: TEST_html2ps:
  223: 	@if (test -e /usr/local/html2ps/bin/html2ps); then \
  224: 		echo "I can find html2ps; assume okay"; \
  225: 	else \
  226: 	echo "**** ERROR **** cannot find /usr/local/html2ps/bin/html2ps!" && \
  227:         echo "Please visit http://www.tdb.uu.se/~jan/html2ps.html" && \
  228: 	exit 1; \
  229: 	fi
  230: 
  231: # ======================= *** GENERAL TARGETS SUCH AS 'build' AND 'install' ***
  232: 
  233: build: Makefile.build pod2html.sh pod2man.sh
  234: 	install -d $(SOURCE)/doc/man
  235: 	install -d $(SOURCE)/doc/scripts
  236: 	install -d $(SOURCE)/doc/lib/perl/Apache
  237: 	echo -n "" > WARNINGS
  238: 	make -f Makefile.build all
  239: 	echo '1' > buildflag
  240: 	make warningnote
  241: 
  242: buildflag:
  243: 	@echo "**** ERROR **** You need to run 'make build' first" > WARNINGS
  244: 	make warningnote
  245: 	@need_to_run_make_build_first 2>/dev/null
  246: 
  247: configinstall: Makefile.configinstall
  248: 	make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  249: 	configfiles
  250: 	if (test "0" = $(NORESTORECONF)); then \
  251: 	perl loncaparestoreconfigurations suffix .lpmlnew; fi
  252: 
  253: install: buildflag VERSION TEST_hosts_tab Makefile.install Makefile
  254: 	echo -n "" > WARNINGS
  255: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  256: 	directories
  257: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  258: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  259: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  260: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  261: 	make postinstall
  262: 	make warningnote
  263: 	echo "You can run 'make test' to see if your system is ready to go!"
  264: 	echo "NOTE THAT YOUR SYSTEM MUST HAVE MYSQL WITH A USER=\"www\" AND"
  265: 	echo -n "PASSWORD=\"localhostkey\" FOR www\@localhost"
  266: 	echo -n "(YOU MAY NEED TO REINITIALIZE YOUR MYSQL www\@localhost USER)"
  267: 	echo -n "Please see http://install.lon-capa.org/ for more information"
  268: 
  269: rawinstall: VERSION Makefile.install Makefile
  270: 	echo -n "" > WARNINGS
  271: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  272: 	directories
  273: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  274: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  275: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  276: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  277: 
  278: hosts_tab: TEST_hosts_tab
  279: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  280: 	perl xfml_parse.pl $(SOURCE)/doc/loncapafiles/valid_hosts.xfml | \
  281: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
  282: 	"$(TARGET)" > Makefile.install
  283: 	make -f Makefile.install directories
  284: 	make -f Makefile.install files
  285: 	@echo "If hosts.tab has changed, restart httpd and loncontrol:"
  286: 	@echo "   /etc/rc.d/init.d/httpd restart"
  287: 	@echo "   /etc/rc.d/init.d/loncontrol restart"
  288: 
  289: webserverconf:
  290: 	cat $(SOURCE)/doc/loncapafiles/webserver.piml | \
  291: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH)
  292: 
  293: # ---------------- Top-level files such as README, UPDATE, CHECKRPMS, and TEST
  294: vanillatar:
  295: 	# --------------------------- Point UPDATE to the internal make process
  296: 	echo '#!/bin/sh' > $(SOURCE)/UPDATE
  297: 	echo 'touch loncom/build/WARNINGS' >> $(SOURCE)/UPDATE;
  298: 	echo 'ln -s loncom/build/WARNINGS WARNINGS' >> $(SOURCE)/UPDATE;
  299: 	echo 'cd loncom/build; make build' >> $(SOURCE)/UPDATE
  300: 	echo 'make rawinstall' >> $(SOURCE)/UPDATE
  301: 	echo 'make configinstall' >> $(SOURCE)/UPDATE
  302: 	echo 'make updatequery' >> $(SOURCE)/UPDATE
  303: 	echo 'make hosts_tab' >> $(SOURCE)/UPDATE
  304: 	echo 'make postinstall' >> $(SOURCE)/UPDATE
  305: 	echo 'make aboutVERSION' >> $(SOURCE)/UPDATE
  306: 	echo 'make warningnote' >> $(SOURCE)/UPDATE
  307: 	# ----------------------------- Point TEST to the internal make process
  308: 	echo '#!/bin/sh' > $(SOURCE)/TEST
  309: 	echo 'cd loncom/build; make test' >> $(SOURCE)/TEST
  310: 	echo 'cd system_dependencies || cd loncom/build/system_dependencies; cp -v CPAN_STATUS_REPORT ../../../CPAN_STATUS_REPORT' >> $(SOURCE)/TEST
  311: 	# ----------------------------- Copy CHECKRPMS to the vanilla top-level
  312: 	cp -v $(SOURCE)/loncom/build/CHECKRPMS $(SOURCE)/CHECKRPMS
  313: 	# ----------------------- vanilla executables must indeed be executable
  314: 	chmod a+rx $(SOURCE)/UPDATE
  315: 	chmod a+rx $(SOURCE)/TEST
  316: 	chmod a+rx $(SOURCE)/CHECKRPMS
  317: 	# -------------------------------- Copy README to the vanilla top-level
  318: 	cp -v $(SOURCE)/doc/shortest_path_redhat7.2.txt $(SOURCE)/README
  319: 
  320: tardist:
  321: 	make MANIFEST_all
  322: 	make vanillatar
  323: 	# -------------------------------------------------------- Make tardist
  324: 	@cd $(SOURCE); \
  325: 	if (test -h $(DIRTARGET)); then \
  326: 		echo "$(DIRTARGET) link already defined; assume okay"; \
  327: 	else \
  328: 		ln -s . $(DIRTARGET); \
  329: 	fi
  330: 	cp -v $(SOURCE)/loncom/license/about.html \
  331: 	$(SOURCE)/loncom/license/about.html.orig
  332: 	make aboutVERSION
  333: 	cd $(SOURCE); \
  334: 	tar --no-recursion --numeric-owner --files-from MANIFEST \
  335: 	-h -czf $(DIRTARGET).tar.gz 2>tar_WARNINGS || [ "0" == "0" ]
  336: 	mv -v $(SOURCE)/loncom/license/about.html.orig \
  337: 	$(SOURCE)/loncom/license/about.html
  338: 	cat $(SOURCE)/tar_WARNINGS | \
  339: 	xargs --replace=XXX echo '**** WARNING **** XXX' > WARNINGS
  340: 	rm -f $(SOURCE)/tar_WARNINGS
  341: 	make warningnote
  342: 
  343: sanitycheck:
  344: 	cat $(SOURCE)/doc/loncapafiles/sanitycheck.piml | \
  345: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  346: 	tee -a WARNINGS
  347: 
  348: updatequery:
  349: 	cat $(SOURCE)/doc/loncapafiles/updatequery.piml | \
  350: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
  351: 
  352: reseval_fixup:
  353: 	cat $(SOURCE)/doc/loncapafiles/reseval_fixup.piml | \
  354: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  355: 	tee -a WARNINGS
  356: 
  357: sendmail_fix:
  358: 	cat $(SOURCE)/doc/loncapafiles/sendmail_fix.piml | \
  359: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  360: 	tee -a WARNINGS
  361: 
  362: postinstall:
  363: 	make webserverconf
  364: 	make reseval_fixup
  365: 	make sanitycheck
  366: 	make sendmail_fix
  367: 
  368: VERSION:
  369: 	install -d $(TARGET)/etc
  370: 	echo -n "LON-CAPA release $(VERSION)-" > $(TARGET)/etc/loncapa-release
  371: 	date +"%Y%m%d" >> $(TARGET)/etc/loncapa-release
  372: 
  373: aboutVERSION:
  374: 	cat $(SOURCE)/loncom/license/about.html | \
  375: 	perl -e '$$d=`date +"%Y%m%d"`;chomp($$d);while(<>){s/\<\!\-\- VERSION \-\-\>/$(VERSION)-$$d/; print;}' > \
  376: 	$(SOURCE)/loncom/license/about.html.new
  377: 	mv -v $(SOURCE)/loncom/license/about.html.new \
  378: 	$(SOURCE)/loncom/license/about.html
  379: 
  380: # ========= *** Makefile.* TARGETS BUILT DYNAMICALLY FROM loncapafiles.lpml ***
  381: 
  382: Makefile.configinstall: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml \
  383:                         lpml_parse.pl
  384: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  385: 	perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
  386: 	"$(TARGET)" > Makefile.configinstall
  387: 
  388: Makefile.build: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  389: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  390: 	perl lpml_parse.pl build $(CATEGORY) $(DIST) "$(SOURCE)" "$(TARGET)" \
  391: 	> Makefile.build
  392: 
  393: Makefile.install: alwaysrun
  394: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  395: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
  396: 	"$(TARGET)" > Makefile.install
  397: 
  398: # ============= *** TARGETS FOR OPERATING ON FILESYSTEMS ACROSS THE NETWORK ***
  399: 
  400: lpmladm:
  401: 	@if (test $(METAMTARGET) = "TRANSPORT"); then \
  402: 		echo "Transporting to $(HOSTNAME)"; \
  403: 		sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
  404: 		SOURCE="$(SOURCE)" \
  405: 		TARGET="lpmladm.$(TIMESTAMP)" \
  406: 		NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
  407: 		cd lpmladm.$(TIMESTAMP); \
  408: 		sudo tar czvf ../tarball$(TIMESTAMP).tar.gz .; \
  409: 		cd ..; scp tarball$(TIMESTAMP).tar.gz \
  410: 		lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
  411: 		ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
  412: 		ssh lpmladm@$(HOSTNAME) sudo tar -x -z -v -C / \
  413: 		-p --same-owner -f \
  414: 		/tarball$(TIMESTAMP).tar.gz; \
  415: 		ssh lpmladm@$(HOSTNAME) sudo rm -f \
  416: 		/tarball$(TIMESTAMP).tar.gz; \
  417: 	elif (test $(METAMTARGET) = "LAUNCH"); then \
  418: 		echo "Launching process on $(HOSTNAME)"; \
  419: 		LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
  420: 		make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
  421: 		TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
  422: 		LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
  423: 		scp $(SAVE) lpmladm@$(HOSTNAME):~/$(SAVE); \
  424: 		ssh lpmladm@$(HOSTNAME) sudo perl $(SAVE); \
  425: 		ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
  426: 	else \
  427: 		echo "**** ERROR **** Incorrect METAMTARGET"; \
  428: 	fi
  429: 
  430: NET_hosts_tab:
  431: 	make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
  432: 	MTARGET="hosts_tab" HOSTNAME="$(HOSTNAME)" lpmladm
  433: 
  434: NET_webserverconf:
  435: 	make TIMESTAMP=`date +"%s"` METAMTARGET="LAUNCH" \
  436: 	MTARGET="webserverconf" HOSTNAME="$(HOSTNAME)" lpmladm
  437: 
  438: NET_rawinstall:
  439: 	make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
  440: 	MTARGET="rawinstall" HOSTNAME="$(HOSTNAME)" lpmladm
  441: 
  442: # ============== *** TARGETS FOR MAKING LISTS (MANIFESTS) OF LON-CAPA FILES ***
  443: 
  444: MANIFEST_all:
  445: 	# --------------------------------------------------------- start clean
  446: 	rm -f $(SOURCE)/MANIFEST
  447: 	make MANIFEST_lpml
  448: 	make MANIFEST_vanillatar
  449: 	make MANIFEST_cvs
  450: 	# ---------------------------------- might as well include the MANIFEST
  451: 	echo 'MANIFEST' >> $(SOURCE)/MANIFEST
  452: 	# ------------------------------------------ hosts.tab are belong to us
  453: 	echo 'loncom/rawhide_hosts.tab' >> $(SOURCE)/MANIFEST
  454: 	echo 'loncom/production_hosts.tab' >> $(SOURCE)/MANIFEST
  455: 	echo 'loncom/development_hosts.tab' >> $(SOURCE)/MANIFEST
  456: 	# ------------------ Files needed for dynamically generated directories
  457: 	echo 'doc/man' >> $(SOURCE)/MANIFEST
  458: 	echo 'doc/lib' >> $(SOURCE)/MANIFEST
  459: 	echo 'doc/lib/perl' >> $(SOURCE)/MANIFEST
  460: 	echo 'doc/lib/perl/Apache' >> $(SOURCE)/MANIFEST
  461: 	echo 'doc/scripts' >> $(SOURCE)/MANIFEST
  462: 	# --------------------------------------------------- Clean up MANIFEST
  463: 	cd $(SOURCE); \
  464: 	sort MANIFEST | perl -nle 'print "$(DIRTARGET)/$$_"' | \
  465: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  466: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  467: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  468: 	perl -nle 's/\/\.\//\//g;print' | sort | uniq > \
  469: 	MANIFEST_loncapa
  470: 	cd $(SOURCE); mv -v MANIFEST_loncapa MANIFEST
  471: 
  472: # --------------- MANIFEST files with important CVS versioning/date information
  473: MANIFEST_cvs:
  474: 	# ------ CVS/Entries directories to retain 'time-checking' intelligence
  475: 	cd $(SOURCE); find . -type f -name 'Entries' | grep 'CVS/Entries' >> \
  476: 	MANIFEST
  477: 
  478: # ------------------- MANIFEST the building, testing and standard loncapa files
  479: MANIFEST_lpml:
  480: 	cat $(SOURCE)/doc/loncapafiles/buildfiles.lpml | \
  481: 	perl lpml_parse.pl MANIFEST development default \
  482: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  483: 	cat $(SOURCE)/doc/loncapafiles/testfiles.lpml | \
  484: 	perl lpml_parse.pl MANIFEST development default \
  485: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  486: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  487: 	perl lpml_parse.pl MANIFEST development default \
  488: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  489: 
  490: # ------------ Files for top-level (the vanilla layer that the user first sees)
  491: MANIFEST_vanillatar:
  492: 	echo 'README' >> $(SOURCE)/MANIFEST
  493: 	echo 'UPDATE' >> $(SOURCE)/MANIFEST
  494: 	echo 'TEST' >> $(SOURCE)/MANIFEST
  495: 	echo 'CHECKRPMS' >> $(SOURCE)/MANIFEST
  496: 
  497: # =============================================== *** STATUS REPORT TARGETS ***
  498: 
  499: warningnote:
  500: 	@if (test -s WARNINGS); then \
  501: 		W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
  502: 		E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
  503: 		N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
  504: 		echo "--->  $$W WARNINGS ENCOUNTERED!       "; \
  505: 		echo "--->  $$E ERRORS ENCOUNTERED!         "; \
  506: 		echo "--->  $$N NOTES ENCOUNTERED!          "; \
  507: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  508: 		echo "!!!!  Please read the WARNINGS file !!!!"; \
  509: 		echo "!!!!   to make sure everything is   !!!!"; \
  510: 		echo "!!!!    correct and taken care of   !!!!"; \
  511: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  512: 	fi
  513: 
  514: HTML:
  515: 	install -d HTML
  516: 	cp $(SOURCE)/doc/loncapafiles/*.gif HTML
  517: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  518: 	perl lpml_parse.pl html development default "$(SOURCE)" '$(TARGET)' \
  519: 	> HTML/index.html
  520: 
  521: status:
  522: 	install -d HTML
  523: 	cp $(SOURCE)/doc/loncapafiles/*.gif HTML
  524: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  525: 	perl lpml_parse.pl html $(CATEGORY) $(DIST) "$(SOURCE)" "($TARGET)" | \
  526: 	perl lpml_html_posteval.pl > \
  527: 	HTML/filestatus.html
  528: 
  529: statuspost: status
  530: 	cp $(SOURCE)/doc/loncapafiles/*.gif \
  531: 	$(TARGET)/home/httpd/html/lon-status
  532: 	cp HTML/filestatus.html \
  533: 	$(TARGET)/home/httpd/html/lon-status/filestatus.html
  534: 
  535: rpmstatus:
  536: 	install -d RPMSTATUS
  537: 	rpm -qa --queryformat \
  538: 	'%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
  539: 	RPMSTATUS/current.tmp
  540: 	cat $(SOURCE)/doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
  541: 	cat $(SOURCE)/doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
  542: 	perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
  543: 	RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
  544: 
  545: rpmstatuspost: rpmstatus
  546: 	cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
  547: 
  548: # ======================================= *** ALTERNATIVE PACKAGING TARGETS ***
  549: 
  550: RPM: BinaryRoot base_rpm_file_list
  551: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  552: 	perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) \
  553: 	> base_customizerpm.xml
  554: 	cat base_rpm_file_list.txt | perl make_rpm.pl base 3.2 '' '' \
  555: 	BinaryRoot base_customizerpm.xml
  556: 
  557: DPKG:
  558: 	make TARGET='lon-capa-$(VERSION)' NORESTORECONF='1' install
  559: 	@echo "You will next need to follow instructions at:"
  560: 	@echo "http://people.debian.org/~jaldhar/make_package1.html"
  561: 	@echo "A directory with a snapshot of the debian package files"
  562: 	@echo "is LON-CAPA-base."
  563: # What DPKG steps need to happen (for future implementation):
  564: # export EMAIL="" ... probably sharrison@mail.lon-capa.org
  565: # deb-make
  566: # edit debian/control
  567: # make debian/dirs file
  568: # make debian/copyright file
  569: # debian/README.debian... point them to LON-CAPA URLS
  570: # debian/changelog
  571: # debian/conffiles
  572: # debuild
  573: # and maybe do some GPG-related steps around here
  574: 
  575: base_rpm_file_list:
  576: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  577: 	perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
  578: 	'BinaryRoot' | sort > base_rpm_file_list.txt
  579: 
  580: BinaryRoot: base_rpm_file_list
  581: 	make TARGET='BinaryRoot' NORESTORECONF='1' install
  582: 
  583: # ======================================== *** MASTER DOCUMENTATION TARGETS ***
  584: 
  585: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
  586: doc:
  587: 	install -d docs
  588: 	@if (test -e installation_manual.pdf); then \
  589: 		cp -vf installation_manual.pdf docs/.; \
  590: 	else \
  591: 		touch docs/installation_manual.pdf; \
  592: 	fi
  593: 	install -m 0755 -d docs/icons
  594: 	install -m 0644 $(SOURCE)/doc/icons/[^C][^V]* docs/icons
  595: 	install -m 0755 -d docs/reconfig
  596: 	cd docs; ln -fs installation_manual.pdf index.pdf
  597: 	cd docs/reconfig; ln -fs ../installation_manual.pdf index.pdf
  598: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  599: 		$(SOURCE)/doc/build/reconfig.html > docs/reconfig/index.html
  600: 	install -m 0755 -d docs/reconfig/confexamples
  601: 	install -m 0644 $(SOURCE)/doc/build/confexamples/[^C][^V]* \
  602: 		docs/reconfig/confexamples
  603: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  604: 		$(SOURCE)/doc/build/installindex.html > docs/index.html
  605: 	install -m 0755 -d docs/license
  606: 	cd docs/license; ln -fs ../installation_manual.pdf index.pdf
  607: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  608: 		$(SOURCE)/doc/build/license.html > docs/license/index.html
  609: 	install -m 0755 -d docs/contact
  610: 	cd docs/contact; ln -fs ../installation_manual.pdf index.pdf
  611: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  612: 		$(SOURCE)/doc/build/contact.html > docs/contact/index.html
  613: 	install -m 0755 -d docs/faq
  614: 	cd docs/faq; ln -fs ../installation_manual.pdf index.pdf
  615: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  616: 		$(SOURCE)/doc/build/faq.html > docs/faq/index.html
  617: 	install -m 0755 -d docs/downloads
  618: 	cd docs/downloads; ln -fs ../installation_manual.pdf download.pdf
  619: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  620: 		$(SOURCE)/doc/build/download.html > docs/downloads/index.html
  621: 	install -m 0755 -d docs/install
  622: 	cd docs/install; ln -fs ../installation_manual.pdf install.pdf
  623: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  624: 		$(SOURCE)/doc/build/install.html > docs/install/index.html
  625: 	cp -v $(SOURCE)/doc/install/redhat7.3/new_install_rh73.html \
  626: 		docs/install/rh73.html
  627: 	cp -v $(SOURCE)/doc/install/redhat7.3/new_install_rh73.html \
  628: 		docs/downloads/rh73.html
  629: 	install -m 0755 -d docs/upgrade
  630: 	cd docs/upgrade; ln -fs ../installation_manual.pdf upgrade.pdf
  631: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  632: 		$(SOURCE)/doc/build/upgrade.html > docs/upgrade/index.html
  633: 	cd docs; tar czvpf ../docs.tar.gz .
  634: 
  635: pdfdoc: TEST_html2ps
  636: 	install -d pdfdoc
  637: 	/usr/local/html2ps/bin/html2ps -D \
  638: 	$(SOURCE)/doc/build/installindex_noform.html > pdfdoc/installindex.ps
  639: 	/usr/local/html2ps/bin/html2ps -D \
  640: 	$(SOURCE)/doc/build/reconfig.html | \
  641: 	perl -nle 's/\[EXAMPLE\]/\[EXAMPLE \(at end of document\)\]/g;print' \
  642: 	> pdfdoc/reconfig.ps
  643: 	/usr/local/html2ps/bin/html2ps -D \
  644: 	$(SOURCE)/doc/build/install.html > pdfdoc/install.ps
  645: 	/usr/local/html2ps/bin/html2ps -D \
  646: 	$(SOURCE)/doc/build/upgrade.html > pdfdoc/upgrade.ps
  647: 	/usr/local/html2ps/bin/html2ps -D \
  648: 	$(SOURCE)/doc/build/faq.html > pdfdoc/faq.ps
  649: 	/usr/local/html2ps/bin/html2ps -D \
  650: 	$(SOURCE)/doc/build/download.html > pdfdoc/download.ps
  651: 	/usr/local/html2ps/bin/html2ps -D \
  652: 	$(SOURCE)/doc/build/contact.html > pdfdoc/contact.ps
  653: 	/usr/local/html2ps/bin/html2ps -D \
  654: 	$(SOURCE)/doc/build/license.html > pdfdoc/license.ps
  655: #       This creates a bad confexamples.ps... so take the long way around
  656: #	cd $(SOURCE)/doc/build/confexamples; \
  657: #	mpage -P- -1 -H [^C]* > ../../../loncom/build/pdfdoc/confexamples.ps
  658: 	install -d pdfdoc/confexamples
  659: 	cd $(SOURCE)/doc/build/confexamples; \
  660: 	find . -type f | cut -b3- | grep -v '^C' | grep -v 'keyword' | \
  661: 	perl -nle \
  662: 	'`mpage -P- -1 -H $$_ > ../../../loncom/build/pdfdoc/confexamples/$$_.ps`;'
  663: 	echo '' > pdfdoc/contents.txt
  664: 	echo '' >> pdfdoc/contents.txt
  665: 	echo '          The Learning Online Network' >> pdfdoc/contents.txt
  666: 	echo '                    with the' >> pdfdoc/contents.txt
  667: 	echo '     Computer-Assisted Personalized Approach' >> \
  668: 	pdfdoc/contents.txt
  669: 	echo '' >> pdfdoc/contents.txt
  670: 	echo '' >> pdfdoc/contents.txt
  671: 	echo 'CONTENTS' >> pdfdoc/contents.txt
  672: 	echo '--------' >> pdfdoc/contents.txt
  673: 	echo 'Opening' >> pdfdoc/contents.txt
  674: 	echo 'Configuration' >> pdfdoc/contents.txt
  675: 	echo 'Installation' >> pdfdoc/contents.txt
  676: 	echo 'Upgrading a LON-CAPA Server' >> pdfdoc/contents.txt
  677: 	echo 'FAQ' >> pdfdoc/contents.txt
  678: 	echo 'Download' >> pdfdoc/contents.txt
  679: 	echo 'Contact Information' >> pdfdoc/contents.txt
  680: 	echo 'License Information' >> pdfdoc/contents.txt
  681: 	echo 'Configuration Examples' >> pdfdoc/contents.txt
  682: 	mpage -P- -1 \
  683: 	pdfdoc/contents.txt \
  684: 	pdfdoc/installindex.ps \
  685: 	pdfdoc/reconfig.ps \
  686: 	pdfdoc/install.ps \
  687: 	pdfdoc/upgrade.ps \
  688: 	pdfdoc/faq.ps \
  689: 	pdfdoc/download.ps \
  690: 	pdfdoc/contact.ps \
  691: 	pdfdoc/license.ps \
  692: 	pdfdoc/confexamples/*.ps \
  693: 	> pdfdoc/installation_manual.ps
  694: 	ps2pdf pdfdoc/installation_manual.ps pdfdoc/installation_manual.pdf
  695: 	mv -vf pdfdoc/installation_manual.pdf .
  696: 
  697: # ================================================ *** KEEPING THINGS CLEAN ***
  698: 
  699: clean:
  700: 	rm -f buildflag
  701: 	rm -Rf HTML
  702: 	rm -f installation_manual.pdf
  703: 	rm -f Makefile.build
  704: 	rm -f Makefile.install
  705: 	rm -f Makefile.configinstall
  706: 	rm -Rf BinaryRoot
  707: 	rm -Rf SetupBinaryRoot
  708: 	rm -Rf LON-CAPA-base
  709: 	rm -f base_rpm_file_list.txt
  710: 	rm -f base_customizerpm.xml
  711: 	rm -f setup_rpm_file_list.txt
  712: 	rm -f docs.tar.gz
  713: 	rm -Rf docs
  714: 	rm -Rf pdfdoc
  715: 	rm -f program.pl*
  716: 	rm -Rf lpmladm.*
  717: 	rm -f WARNINGS
  718: 	rm -f CPAN_STATUS_REPORT
  719: 	rm -f $(SOURCE)/loncom/build/hosts.tab
  720: 
  721: reallyclean:
  722: 	rm -f buildflag
  723: 	rm -f $(SOURCE)/README
  724: 	rm -f $(SOURCE)/UPDATE
  725: 	rm -f $(SOURCE)/TEST
  726: 	rm -f $(SOURCE)/MANIFEST
  727: 	rm -f $(SOURCE)/MANIFEST_loncapa
  728: 	rm -f $(SOURCE)/loncapa
  729: 	rm -f $(SOURCE)/loncom/build/hosts.tab
  730: 	rm -f $(SOURCE)/loncapa.tar.gz
  731: 	rm -Rf HTML
  732: 	rm -f installation_manual.pdf
  733: 	rm -f Makefile.build
  734: 	rm -f Makefile.install
  735: 	rm -f Makefile.configinstall
  736: 	rm -Rf BinaryRoot
  737: 	rm -Rf SetupBinaryRoot
  738: 	rm -Rf LON-CAPA-base
  739: 	rm -f base_rpm_file_list.txt
  740: 	rm -f base_customizerpm.xml
  741: 	rm -f setup_rpm_file_list.txt
  742: 	rm -f docs.tar.gz
  743: 	rm -Rf docs
  744: 	rm -Rf pdfdoc
  745: 	rm -f program.pl*
  746: 	rm -Rf lpmladm.*
  747: 	make -f Makefile.cvs clean
  748: 	rm -f WARNINGS
  749: 
  750: # ================================================ *** A HELPFUL DEPENDENCY ***
  751: alwaysrun:

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