File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.116: download - view: text, annotated - select for diffs
Thu May 23 20:21:00 2002 UTC (22 years ago) by harris41
Branches: MAIN
CVS tags: HEAD
lonSqlAccess is now mandatorily set to 'localhostkey'; users are advised
to configure their www@localhost MySQL user accordingly at the end
of the install target

    1: # The LearningOnline Network with CAPA
    2: 
    3: # Scott Harrison
    4: # $Id: Makefile,v 1.116 2002/05/23 20:21:00 harris41 Exp $
    5: 
    6: DISTPROBE=`perl ./distprobe`
    7: DIST=$(DISTPROBE)
    8: CATEGORY="development"
    9: SOURCE=../..
   10: TARGET=""
   11: DIRTARGET=loncapa
   12: NORESTORECONF="0"
   13: HOSTNAME=""
   14: LAUNCH=| perl
   15: QUERYLAUNCH=> /tmp/loncapa_query.pl; perl /tmp/loncapa_query.pl
   16: OUTSTREAM=>
   17: SAVE=program.pl.$(TIMESTAMP)
   18: LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
   19: METAMTARGET=""
   20: MTARGET=""
   21: VERSION=0.1
   22: 
   23: help:
   24: 	@echo "*** You need to specify a valid target ***"
   25: 	@echo "NOTE: You can specify options to your Makefile target."
   26: 	@echo "(option) DIST can be redhat7, debian, redhat6.2, or default"
   27: 	@echo "(option) CATEGORY can be runtime or development"
   28: 	@echo "(option) SOURCE is an absolute or relative directory path"
   29: 	@echo "(option) TARGET is an absolute or relative directory path"
   30: 	@echo "build: compile the CVS source tree"
   31: 	@echo "install: install from a compiled CVS source tree to a "
   32: 	@echo "         specified TARGET destination on the filesystem"
   33: 	@echo "test: test different parts of the LON-CAPA system (TEST_*)"
   34: 	@echo "TEST_lpml_scripts: make sure that the system can process "
   35: 	@echo "                   the Linux Packaging Markup Language"
   36: 	@echo "TEST_system_dependencies: make sure that all needed system "
   37: 	@echo "                          components are active and present "
   38: 	@echo "                          on the server such as perl modules"
   39: 	@echo "                          and the MySQL database"
   40: 	@echo "TEST_web_layer: mimic a login and various system actions on "
   41: 	@echo "                a LON-CAPA system"
   42: 	@echo "HTML: generate an HTML-formatted description of the LON-CAPA"
   43: 	@echo "      CVS files"
   44: 	@echo "documentation_tree: compiles a documentation tree from the "
   45:         @echo "                    CVS:doc directory"
   46: 	@echo "status: compare the TARGET filesystem with a compiled CVS "
   47: 	@echo "        source directory"
   48: 	@echo "statuspost: post the results of "make status" to "
   49: 	@echo "            TARGET/home/httpd/html/lon-status/filestatus.html"
   50: 	@echo "rpmstatus: compare the rpms on a system to defined lists "
   51: 	@echo "           CVS:doc/otherfiles/cd_rpms and "
   52: 	@echo "           CVS:doc/otherfiles/rpm_list.txt"
   53: 	@echo "rpmstatuspost: post the results of "make rpmstatus" to "
   54: 	@echo "            TARGET/home/httpd/html/lon-status/rpmstatus.html"
   55: 	@echo "RPM: build LON-CAPA-base RPM from CVS repository"
   56: 	@echo "setup_RPM: build LON-CAPA-setup RPM from CVS repository"
   57: 	@echo "           handy for CD-ROM generation"
   58: 	@echo "tardist: build a tarball that will upgrade the software on a "
   59: 	@echo "         system"
   60: 
   61: test: TEST_lpml_scripts TEST_system_dependencies TEST_web_layer
   62: 	@echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
   63: 
   64: TEST_system_dependencies:
   65: 	@echo "TESTING SYSTEM DEPENDENCIES"
   66: 	cd system_dependencies; make
   67: 
   68: TEST_lpml_scripts:
   69: 	@echo "TESTING LPML INSTALLATION CODE"
   70: 	cd ../test; perl filecomparetest.pl
   71: 
   72: TEST_web_layer:
   73: 	@echo "TESTING WEB LAYER"
   74: 	cd weblayer_test; make
   75: 
   76: TEST_hosts_tab:
   77: 	@echo "Testing hosts.tab"
   78: 	@if (test -h ../hosts.tab); then \
   79: 		echo "there is a defined link; assume okay"; \
   80: 	else echo "**** ERROR **** hosts.tab not defined!" && \
   81: 	     echo -n "You need to do one of the following within your " && \
   82: 	     echo "CVS repository (cd loncapa/loncom)" && \
   83: 	     echo "   1) ln -s production_hosts.tab hosts.tab" && \
   84: 	     echo "   2) ln -s development_hosts.tab hosts.tab" && \
   85: 	     echo "or 3) ln -s rawhide_hosts.tab hosts.tab" && \
   86: 	     echo "(you most likely want option #1, production_hosts.tab)" && \
   87: 	     exit 1; \
   88: 	fi
   89: 
   90: NET_hosts_tab:
   91: 	make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
   92: 	MTARGET="hosts_tab" HOSTNAME="$(HOSTNAME)" lpmladm
   93: 
   94: hosts_tab: TEST_hosts_tab
   95: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
   96: 	perl xfml_parse.pl $(SOURCE)/doc/loncapafiles/valid_hosts.xfml | \
   97: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
   98: 	"$(TARGET)" > Makefile.install
   99: 	make -f Makefile.install directories
  100: 	make -f Makefile.install files
  101: 	@echo "If hosts.tab has changed, restart httpd and loncontrol:"
  102: 	@echo "   /etc/rc.d/init.d/httpd restart"
  103: 	@echo "   /etc/rc.d/init.d/loncontrol restart"
  104: 
  105: lpmladm:
  106: 	@if (test $(METAMTARGET) = "TRANSPORT"); then \
  107: 		echo "Transporting to $(HOSTNAME)"; \
  108: 		sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
  109: 		SOURCE="$(SOURCE)" \
  110: 		TARGET="lpmladm.$(TIMESTAMP)" \
  111: 		NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
  112: 		cd lpmladm.$(TIMESTAMP); \
  113: 		sudo tar czvf ../tarball$(TIMESTAMP).tar.gz .; \
  114: 		cd ..; scp tarball$(TIMESTAMP).tar.gz \
  115: 		lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
  116: 		ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
  117: 		ssh lpmladm@$(HOSTNAME) sudo tar -x -z -v -C / \
  118: 		-p --same-owner -f \
  119: 		/tarball$(TIMESTAMP).tar.gz; \
  120: 		ssh lpmladm@$(HOSTNAME) sudo rm -f \
  121: 		/tarball$(TIMESTAMP).tar.gz; \
  122: 	elif (test $(METAMTARGET) = "LAUNCH"); then \
  123: 		echo "Launching process on $(HOSTNAME)"; \
  124: 		LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
  125: 		make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
  126: 		TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
  127: 		LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
  128: 		scp $(SAVE) lpmladm@$(HOSTNAME):~/$(SAVE); \
  129: 		ssh lpmladm@$(HOSTNAME) sudo perl $(SAVE); \
  130: 		ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
  131: 	else \
  132: 		echo "**** ERROR **** Incorrect METAMTARGET"; \
  133: 	fi
  134: 
  135: HTML:
  136: 	install -d HTML
  137: 	cp $(SOURCE)/doc/loncapafiles/*.gif HTML
  138: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  139: 	perl lpml_parse.pl html development default "$(SOURCE)" '$(TARGET)' \
  140: 	> HTML/index.html
  141: 
  142: status:
  143: 	install -d HTML
  144: 	cp $(SOURCE)/doc/loncapafiles/*.gif HTML
  145: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  146: 	perl lpml_parse.pl html $(CATEGORY) $(DIST) "$(SOURCE)" "($TARGET)" | \
  147: 	perl lpml_html_posteval.pl > \
  148: 	HTML/filestatus.html
  149: 
  150: statuspost: status
  151: 	cp $(SOURCE)/doc/loncapafiles/*.gif \
  152: 	$(TARGET)/home/httpd/html/lon-status
  153: 	cp HTML/filestatus.html \
  154: 	$(TARGET)/home/httpd/html/lon-status/filestatus.html
  155: 
  156: rpmstatus:
  157: 	install -d RPMSTATUS
  158: 	rpm -qa --queryformat \
  159: 	'%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
  160: 	RPMSTATUS/current.tmp
  161: 	cat $(SOURCE)/doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
  162: 	cat $(SOURCE)/doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
  163: 	perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
  164: 	RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
  165: 
  166: rpmstatuspost: rpmstatus
  167: 	cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
  168: 
  169: configinstall: Makefile.configinstall
  170: 	make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  171: 	configfiles
  172: 	if (test "0" = $(NORESTORECONF)); then \
  173: 	perl loncaparestoreconfigurations suffix .lpmlnew; fi
  174: 
  175: Makefile.configinstall: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  176: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  177: 	perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
  178: 	"$(TARGET)" > Makefile.configinstall
  179: 
  180: warningnote:
  181: 	@if (test -s WARNINGS); then \
  182: 		W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
  183: 		E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
  184: 		N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
  185: 		echo "--->  $$W WARNINGS ENCOUNTERED!       "; \
  186: 		echo "--->  $$E ERRORS ENCOUNTERED!         "; \
  187: 		echo "--->  $$N NOTES ENCOUNTERED!          "; \
  188: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  189: 		echo "!!!!  Please read the WARNINGS file !!!!"; \
  190: 		echo "!!!!   to make sure everything is   !!!!"; \
  191: 		echo "!!!!    correct and taken care of   !!!!"; \
  192: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  193: 	fi
  194: 
  195: NET_webserverconf:
  196: 	make TIMESTAMP=`date +"%s"` METAMTARGET="LAUNCH" \
  197: 	MTARGET="webserverconf" HOSTNAME="$(HOSTNAME)" lpmladm
  198: 
  199: webserverconf:
  200: 	cat $(SOURCE)/doc/loncapafiles/webserver.piml | \
  201: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH)
  202: 
  203: sanitycheck:
  204: 	cat $(SOURCE)/doc/loncapafiles/sanitycheck.piml | \
  205: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
  206: 	tee -a WARNINGS
  207: 
  208: updatequery:
  209: 	cat $(SOURCE)/doc/loncapafiles/updatequery.piml | \
  210: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
  211: 
  212: postinstall:
  213: 	make webserverconf
  214: 	make sanitycheck
  215: 
  216: install: TEST_hosts_tab Makefile.install Makefile
  217: 	echo -n "" > WARNINGS
  218: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  219: 	directories
  220: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  221: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  222: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  223: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  224: 	make postinstall
  225: 	make warningnote
  226: 	echo "You can run 'make test' to see if your system is ready to go!"
  227: 	echo "NOTE THAT YOUR SYSTEM MUST HAVE MYSQL WITH A USER=\"www\" AND"
  228: 	echo -n "PASSWORD=\"localhostkey\" FOR www\@localhost"
  229: 	echo -n "(YOU MAY NEED TO REINITIALIZE YOUR MYSQL www\@localhost USER)"
  230: 	echo -n "Please see http://install.lon-capa.org/ for more information"
  231: 
  232: rawinstall: Makefile.install Makefile
  233: 	echo -n "" > WARNINGS
  234: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  235: 	directories
  236: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  237: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  238: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  239: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  240: 
  241: Makefile.install: alwaysrun
  242: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  243: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
  244: 	"$(TARGET)" > Makefile.install
  245: 
  246: build: Makefile.build pod2html.sh pod2man.sh
  247: 	install -d $(SOURCE)/doc/man
  248: 	install -d $(SOURCE)/doc/scripts
  249: 	install -d $(SOURCE)/doc/lib/perl/Apache
  250: 	echo -n "" > WARNINGS
  251: 	make -f Makefile.build all
  252: 	make warningnote
  253: 
  254: Makefile.build: $(SOURCE)/doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  255: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  256: 	perl lpml_parse.pl build $(CATEGORY) $(DIST) "$(SOURCE)" "$(TARGET)" \
  257: 	> Makefile.build
  258: 
  259: RPM: BinaryRoot base_rpm_file_list
  260: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  261: 	perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) \
  262: 	> base_customizerpm.xml
  263: 	cat base_rpm_file_list.txt | perl make_rpm.pl base 3.2 '' '' \
  264: 	BinaryRoot base_customizerpm.xml
  265: 
  266: setup_RPM:
  267: 	echo "SetupBinaryRoot/etc/passwd" > setup_rpm_file_list.txt
  268: 	echo "SetupBinaryRoot/etc/group" >> setup_rpm_file_list.txt
  269: 	echo "SetupBinaryRoot/etc/hosts.deny" >> setup_rpm_file_list.txt
  270: 	echo "SetupBinaryRoot/home/www" >> setup_rpm_file_list.txt
  271: 	echo "SetupBinaryRoot/etc/pam.d/passwd" >> setup_rpm_file_list.txt
  272: 	echo "SetupBinaryRoot/etc/pam.d/login" >> setup_rpm_file_list.txt
  273: 	perl setup_rpm_binaryroot.pl
  274: 	cat setup_rpm_file_list.txt | perl make_rpm.pl setup 3.2 '' '' \
  275: 	SetupBinaryRoot customizerpm.xml
  276: 
  277: DPKG:
  278: 	make TARGET='lon-capa-$(VERSION)' NORESTORECONF='1' install
  279: 	@echo "You will next need to follow instructions at:"
  280: 	@echo "http://people.debian.org/~jaldhar/make_package1.html"
  281: 	@echo "A directory with a snapshot of the debian package files"
  282: 	@echo "is LON-CAPA-base."
  283: # What DPKG steps need to happen (for future implementation):
  284: # export EMAIL="" ... probably sharrison@mail.lon-capa.org
  285: # deb-make
  286: # edit debian/control
  287: # make debian/dirs file
  288: # make debian/copyright file
  289: # debian/README.debian... point them to LON-CAPA URLS
  290: # debian/changelog
  291: # debian/conffiles
  292: # debuild
  293: # and maybe do some GPG-related steps around here
  294: 
  295: base_rpm_file_list:
  296: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  297: 	perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
  298: 	'BinaryRoot' | sort > base_rpm_file_list.txt
  299: 
  300: BinaryRoot: base_rpm_file_list
  301: 	make TARGET='BinaryRoot' NORESTORECONF='1' install
  302: 
  303: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
  304: doc:
  305: 	install -d docs
  306: 	@if (test -e installation_manual.pdf); then \
  307: 		cp -vf installation_manual.pdf docs/.; \
  308: 	else \
  309: 		touch docs/installation_manual.pdf; \
  310: 	fi
  311: 	install -m 0755 -d docs/icons
  312: 	install -m 0644 $(SOURCE)/doc/icons/[^C][^V]* docs/icons
  313: 	install -m 0755 -d docs/reconfig
  314: 	cd docs; ln -fs installation_manual.pdf index.pdf
  315: 	cd docs/reconfig; ln -fs ../installation_manual.pdf index.pdf
  316: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  317: 		$(SOURCE)/doc/build/reconfig.html > docs/reconfig/index.html
  318: 	install -m 0755 -d docs/reconfig/confexamples
  319: 	install -m 0644 $(SOURCE)/doc/build/confexamples/[^C][^V]* \
  320: 		docs/reconfig/confexamples
  321: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  322: 		$(SOURCE)/doc/build/installindex.html > docs/index.html
  323: 	install -m 0755 -d docs/license
  324: 	cd docs/license; ln -fs ../installation_manual.pdf index.pdf
  325: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  326: 		$(SOURCE)/doc/build/license.html > docs/license/index.html
  327: 	install -m 0755 -d docs/contact
  328: 	cd docs/contact; ln -fs ../installation_manual.pdf index.pdf
  329: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  330: 		$(SOURCE)/doc/build/contact.html > docs/contact/index.html
  331: 	install -m 0755 -d docs/faq
  332: 	cd docs/faq; ln -fs ../installation_manual.pdf index.pdf
  333: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  334: 		$(SOURCE)/doc/build/faq.html > docs/faq/index.html
  335: 	install -m 0755 -d docs/downloads
  336: 	cd docs/downloads; ln -fs ../installation_manual.pdf download.pdf
  337: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  338: 		$(SOURCE)/doc/build/download.html > docs/downloads/index.html
  339: 	install -m 0755 -d docs/install
  340: 	cd docs/install; ln -fs ../installation_manual.pdf install.pdf
  341: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  342: 		$(SOURCE)/doc/build/install.html > docs/install/index.html
  343: 	install -m 0755 -d docs/upgrade
  344: 	cd docs/upgrade; ln -fs ../installation_manual.pdf upgrade.pdf
  345: 	perl doc_template.pl $(SOURCE)/doc/templates/template.html \
  346: 		$(SOURCE)/doc/build/upgrade.html > docs/upgrade/index.html
  347: 	cd docs; tar czvpf ../docs.tar.gz .
  348: 
  349: pdfdoc: TEST_html2ps
  350: 	install -d pdfdoc
  351: 	/usr/local/html2ps/bin/html2ps -D \
  352: 	$(SOURCE)/doc/build/installindex_noform.html > pdfdoc/installindex.ps
  353: 	/usr/local/html2ps/bin/html2ps -D \
  354: 	$(SOURCE)/doc/build/reconfig.html | \
  355: 	perl -nle 's/\[EXAMPLE\]/\[EXAMPLE \(at end of document\)\]/g;print' \
  356: 	> pdfdoc/reconfig.ps
  357: 	/usr/local/html2ps/bin/html2ps -D \
  358: 	$(SOURCE)/doc/build/install.html > pdfdoc/install.ps
  359: 	/usr/local/html2ps/bin/html2ps -D \
  360: 	$(SOURCE)/doc/build/upgrade.html > pdfdoc/upgrade.ps
  361: 	/usr/local/html2ps/bin/html2ps -D \
  362: 	$(SOURCE)/doc/build/faq.html > pdfdoc/faq.ps
  363: 	/usr/local/html2ps/bin/html2ps -D \
  364: 	$(SOURCE)/doc/build/download.html > pdfdoc/download.ps
  365: 	/usr/local/html2ps/bin/html2ps -D \
  366: 	$(SOURCE)/doc/build/contact.html > pdfdoc/contact.ps
  367: 	/usr/local/html2ps/bin/html2ps -D \
  368: 	$(SOURCE)/doc/build/license.html > pdfdoc/license.ps
  369: #       This creates a bad confexamples.ps... so take the long way around
  370: #	cd $(SOURCE)/doc/build/confexamples; \
  371: #	mpage -P- -1 -H [^C]* > ../../../loncom/build/pdfdoc/confexamples.ps
  372: 	install -d pdfdoc/confexamples
  373: 	cd $(SOURCE)/doc/build/confexamples; \
  374: 	find . -type f | cut -b3- | grep -v '^C' | perl -nle \
  375: 	'`mpage -P- -1 -H $$_ > ../../../loncom/build/pdfdoc/confexamples/$$_.ps`;'
  376: 	echo '' > pdfdoc/contents.txt
  377: 	echo '' >> pdfdoc/contents.txt
  378: 	echo '          The Learning Online Network' >> pdfdoc/contents.txt
  379: 	echo '                    with the' >> pdfdoc/contents.txt
  380: 	echo '     Computer-Assisted Personalized Approach' >> \
  381: 	pdfdoc/contents.txt
  382: 	echo '' >> pdfdoc/contents.txt
  383: 	echo '' >> pdfdoc/contents.txt
  384: 	echo 'CONTENTS' >> pdfdoc/contents.txt
  385: 	echo '--------' >> pdfdoc/contents.txt
  386: 	echo 'Opening' >> pdfdoc/contents.txt
  387: 	echo 'Configuration' >> pdfdoc/contents.txt
  388: 	echo 'Installation' >> pdfdoc/contents.txt
  389: 	echo 'Upgrading a LON-CAPA Server' >> pdfdoc/contents.txt
  390: 	echo 'FAQ' >> pdfdoc/contents.txt
  391: 	echo 'Download' >> pdfdoc/contents.txt
  392: 	echo 'Contact Information' >> pdfdoc/contents.txt
  393: 	echo 'License Information' >> pdfdoc/contents.txt
  394: 	echo 'Configuration Examples' >> pdfdoc/contents.txt
  395: 	mpage -P- -1 \
  396: 	pdfdoc/contents.txt \
  397: 	pdfdoc/installindex.ps \
  398: 	pdfdoc/reconfig.ps \
  399: 	pdfdoc/install.ps \
  400: 	pdfdoc/upgrade.ps \
  401: 	pdfdoc/faq.ps \
  402: 	pdfdoc/download.ps \
  403: 	pdfdoc/contact.ps \
  404: 	pdfdoc/license.ps \
  405: 	pdfdoc/confexamples/*.ps \
  406: 	> pdfdoc/installation_manual.ps
  407: 	ps2pdf pdfdoc/installation_manual.ps pdfdoc/installation_manual.pdf
  408: 	mv -vf pdfdoc/installation_manual.pdf .
  409: 
  410: TEST_html2ps:
  411: 	@if (test -e /usr/local/html2ps/bin/html2ps); then \
  412: 		echo "I can find html2ps; assume okay"; \
  413: 	else \
  414: 	echo "**** ERROR **** cannot find /usr/local/html2ps/bin/html2ps!" && \
  415:         echo "Please visit http://www.tdb.uu.se/~jan/html2ps.html" && \
  416: 	exit 1; \
  417: 	fi
  418: 
  419: tardist:
  420: 	# ----------- MANIFEST the building, testing and standard loncapa files
  421: 	cat $(SOURCE)/doc/loncapafiles/buildfiles.lpml | \
  422: 	perl lpml_parse.pl MANIFEST development default \
  423: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' > $(SOURCE)/MANIFEST
  424: 	cat $(SOURCE)/doc/loncapafiles/testfiles.lpml | \
  425: 	perl lpml_parse.pl MANIFEST development default \
  426: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  427: 	cat $(SOURCE)/doc/loncapafiles/loncapafiles.lpml | \
  428: 	perl lpml_parse.pl MANIFEST development default \
  429: 	'$(SOURCE)' '$(TARGET)' | grep '[[:alnum:]]' >> $(SOURCE)/MANIFEST
  430: 	# ------ CVS/Entries directories to retain 'time-checking' intelligence
  431: 	cd $(SOURCE); find . -type f -name 'Entries' | grep 'CVS/Entries' >> \
  432: 	MANIFEST
  433: 	# ---- Files for top-level (the vanilla layer that the user first sees)
  434: 	echo 'README' >> $(SOURCE)/MANIFEST
  435: 	echo 'UPDATE' >> $(SOURCE)/MANIFEST
  436: 	echo 'TEST' >> $(SOURCE)/MANIFEST
  437: 	echo 'CHECKRPMS' >> $(SOURCE)/MANIFEST
  438: 	# ---------------------------------- might as well include the MANIFEST
  439: 	echo 'MANIFEST' >> $(SOURCE)/MANIFEST
  440: 	# ------------------------------------------ hosts.tab are belong to us
  441: 	echo 'loncom/rawhide_hosts.tab' >> $(SOURCE)/MANIFEST
  442: 	echo 'loncom/production_hosts.tab' >> $(SOURCE)/MANIFEST
  443: 	echo 'loncom/development_hosts.tab' >> $(SOURCE)/MANIFEST
  444: 	# ------------------ Files needed for dynamically generated directories
  445: 	echo 'doc/man' >> $(SOURCE)/MANIFEST
  446: 	echo 'doc/lib' >> $(SOURCE)/MANIFEST
  447: 	echo 'doc/lib/perl' >> $(SOURCE)/MANIFEST
  448: 	echo 'doc/lib/perl/Apache' >> $(SOURCE)/MANIFEST
  449: 	echo 'doc/scripts' >> $(SOURCE)/MANIFEST
  450: 	# --------------------------- Point UPDATE to the internal make process
  451: 	echo '#!/bin/sh' > $(SOURCE)/UPDATE
  452: 	echo 'touch loncom/build/WARNINGS' >> $(SOURCE)/UPDATE;
  453: 	echo 'ln -s loncom/build/WARNINGS WARNINGS' >> $(SOURCE)/UPDATE;
  454: 	echo 'cd loncom/build; make build' >> $(SOURCE)/UPDATE
  455: 	echo 'make rawinstall' >> $(SOURCE)/UPDATE
  456: 	echo 'make updatequery' >> $(SOURCE)/UPDATE
  457: 	echo 'make hosts_tab' >> $(SOURCE)/UPDATE
  458: 	echo 'make postinstall' >> $(SOURCE)/UPDATE
  459: 	echo 'make warningnote' >> $(SOURCE)/UPDATE
  460: 	# ----------------------------- Point TEST to the internal make process
  461: 	echo '#!/bin/sh' > $(SOURCE)/TEST
  462: 	echo 'cd loncom/build; make test' >> $(SOURCE)/TEST
  463: 	# ----------------------------- Copy CHECKRPMS to the vanilla top-level
  464: 	cp $(SOURCE)/loncom/build/CHECKRPMS $(SOURCE)/CHECKRPMS
  465: 	# ----------------------- vanilla executables must indeed be executable
  466: 	chmod a+rx $(SOURCE)/UPDATE
  467: 	chmod a+rx $(SOURCE)/TEST
  468: 	chmod a+rx $(SOURCE)/CHECKRPMS
  469: 	# -------------------------------- Copy README to the vanilla top-level
  470: 	cp $(SOURCE)/doc/shortest_path_redhat7.2.txt $(SOURCE)/README
  471: 	# --------------------------------------------------- Clean up MANIFEST
  472: 	cd $(SOURCE); \
  473: 	sort MANIFEST | perl -nle 'print "$(DIRTARGET)/$$_"' | \
  474: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  475: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  476: 	perl -nle 's/\w+\/\.\.\///g;s/\w+\/\.\.\///g;print' | \
  477: 	perl -nle 's/\/\.\//\//g;print' | sort | uniq > \
  478: 	MANIFEST_loncapa
  479: 	# -------------------------------------------------------- Make tardist
  480: 	@cd $(SOURCE); \
  481: 	if (test -h $(DIRTARGET)); then \
  482: 		echo "$(DIRTARGET) link already defined; assume okay"; \
  483: 	else \
  484: 		ln -s . $(DIRTARGET); \
  485: 	fi
  486: 	cd $(SOURCE); \
  487: 	tar --no-recursion --numeric-owner --files-from MANIFEST_loncapa \
  488: 	-h -czf loncapa.tar.gz 2>WARNINGS || [ "0" == "0" ]
  489: 	cat $(SOURCE)/WARNINGS | \
  490: 	xargs --replace=XXX echo '**** WARNING **** XXX' > WARNINGS
  491: 	rm -f $(SOURCE)/WARNINGS
  492: 	make warningnote
  493: 
  494: clean:
  495: 	rm -Rf HTML
  496: 	rm -f installation_manual.pdf
  497: 	rm -f Makefile.build
  498: 	rm -f Makefile.install
  499: 	rm -f Makefile.configinstall
  500: 	rm -Rf BinaryRoot
  501: 	rm -Rf SetupBinaryRoot
  502: 	rm -Rf LON-CAPA-base
  503: 	rm -f base_rpm_file_list.txt
  504: 	rm -f base_customizerpm.xml
  505: 	rm -f setup_rpm_file_list.txt
  506: 	rm -f docs.tar.gz
  507: 	rm -Rf docs
  508: 	rm -Rf pdfdoc
  509: 	rm -f program.pl*
  510: 	rm -Rf lpmladm.*
  511: 	rm -f WARNINGS
  512: 	rm -f $(SOURCE)/loncom/build/hosts.tab
  513: 
  514: reallyclean:
  515: 	rm -f $(SOURCE)/README
  516: 	rm -f $(SOURCE)/UPDATE
  517: 	rm -f $(SOURCE)/TEST
  518: 	rm -f $(SOURCE)/MANIFEST
  519: 	rm -f $(SOURCE)/loncapa
  520: 	rm -f $(SOURCE)/loncom/build/hosts.tab
  521: 	rm -f $(SOURCE)/loncapa.tar.gz
  522: 	rm -Rf HTML
  523: 	rm -f installation_manual.pdf
  524: 	rm -f Makefile.build
  525: 	rm -f Makefile.install
  526: 	rm -f Makefile.configinstall
  527: 	rm -Rf BinaryRoot
  528: 	rm -Rf SetupBinaryRoot
  529: 	rm -Rf LON-CAPA-base
  530: 	rm -f base_rpm_file_list.txt
  531: 	rm -f base_customizerpm.xml
  532: 	rm -f setup_rpm_file_list.txt
  533: 	rm -f docs.tar.gz
  534: 	rm -Rf docs
  535: 	rm -Rf pdfdoc
  536: 	rm -f program.pl*
  537: 	rm -Rf lpmladm.*
  538: 	make -f Makefile.cvs clean
  539: 	rm -f WARNINGS
  540: 
  541: alwaysrun:

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