File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.105: download - view: text, annotated - select for diffs
Thu May 9 04:58:03 2002 UTC (22 years ago) by harris41
Branches: MAIN
CVS tags: HEAD
BUG 419; fix
also a few other minor touch-ups

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

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