Annotation of loncom/build/Makefile, revision 1.185.2.4

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

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