File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.67: download - view: text, annotated - select for diffs
Mon Feb 11 06:29:04 2002 UTC (22 years, 3 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
rendering more documentation pages for install.lon-capa.org and
referencing also Makefile.cvs clean target

    1: # The LearningOnline Network with CAPA
    2: 
    3: # Scott Harrison
    4: # $Id: Makefile,v 1.67 2002/02/11 06:29:04 harris41 Exp $
    5: 
    6: DIST="default"
    7: CATEGORY="development"
    8: SOURCE="../.."
    9: TARGET=""
   10: NORESTORECONF="0"
   11: HOSTNAME=""
   12: LAUNCH=| perl
   13: OUTSTREAM=>
   14: SAVE=program.pl.$(TIMESTAMP)
   15: LAUNCHSAVE=$(OUTSTREAM) $(SAVE)
   16: METAMTARGET=""
   17: MTARGET=""
   18: 
   19: help: 
   20: 	@echo "*** You need to specify a valid target ***"
   21: 	@echo "NOTE: You can specify options to your Makefile target."
   22: 	@echo "(option) DIST can be redhat7.1, debian, redhat6.2, or default"
   23: 	@echo "(option) CATEGORY can be runtime or development"
   24: 	@echo "(option) SOURCE is an absolute or relative directory path"
   25: 	@echo "(option) TARGET is an absolute or relative directory path"
   26: 	@echo "build: compile the CVS source tree"
   27: 	@echo "install: install from a compiled CVS source tree to a "
   28: 	@echo "         specified TARGET destination on the filesystem"
   29: 	@echo "test: test different parts of the LON-CAPA system (TEST_*)"
   30: 	@echo "TEST_lpml_scripts: make sure that the system can process "
   31: 	@echo "                   the Linux Packaging Markup Language"
   32: 	@echo "TEST_system_dependencies: make sure that all needed system "
   33: 	@echo "                          components are active and present "
   34: 	@echo "                          on the server such as perl modules"
   35: 	@echo "                          and the MySQL database"
   36: 	@echo "TEST_web_layer: mimic a login and various system actions on "
   37: 	@echo "                a LON-CAPA system"
   38: 	@echo "HTML: generate an HTML-formatted description of the LON-CAPA"
   39: 	@echo "      CVS files"
   40: 	@echo "documentation_tree: compiles a documentation tree from the "
   41:         @echo "                    CVS:doc directory"
   42: 	@echo "status: compare the TARGET filesystem with a compiled CVS "
   43: 	@echo "        source directory"
   44: 	@echo "statuspost: post the results of "make status" to "
   45: 	@echo "            TARGET/home/httpd/html/lon-status/filestatus.html"
   46: 	@echo "rpmstatus: compare the rpms on a system to defined lists "
   47: 	@echo "           CVS:doc/otherfiles/cd_rpms and "
   48: 	@echo "           CVS:doc/otherfiles/rpm_list.txt"
   49: 	@echo "rpmstatuspost: post the results of "make rpmstatus" to "
   50: 	@echo "            TARGET/home/httpd/html/lon-status/rpmstatus.html"
   51: 	@echo "RPM: build LON-CAPA-base RPM from CVS repository"
   52: 	@echo "setup_RPM: build LON-CAPA-setup RPM from CVS repository"
   53: 	@echo "           handy for CD-ROM generation"
   54: 
   55: test: TEST_lpml_scripts TEST_system_dependencies TEST_web_layer
   56: 	@echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
   57: 
   58: TEST_system_dependencies:
   59: 	@echo "TESTING SYSTEM DEPENDENCIES"
   60: 	cd system_dependencies; make
   61: 
   62: TEST_lpml_scripts:
   63: 	@echo "TESTING LPML INSTALLATION CODE"
   64: 	cd ../test; perl filecomparetest.pl
   65: 
   66: TEST_web_layer:
   67: 	@echo "Testing of web layers is not yet implemented."
   68: 
   69: TEST_hosts_tab:
   70: 	@echo "Testing hosts.tab"
   71: 	@if (test -h ../hosts.tab); then \
   72: 		echo "there is a defined link; assume okay"; \
   73: 	else echo "**** ERROR **** hosts.tab not defined!" && \
   74: 	     echo -n "You need to do one of the following within your " && \
   75: 	     echo "CVS repository" && \
   76: 	     echo "   1) cd ../; ln -s production_hosts.tab hosts.tab" && \
   77: 	     echo "   2) cd ../; ln -s development_hosts.tab hosts.tab" && \
   78: 	     echo "or 3) cd ../; ln -s rawhide_hosts.tab hosts.tab" && \
   79: 	     echo "(you most likely want option #1, production_hosts.tab)" && \
   80: 	     exit 1; \
   81: 	fi
   82: 
   83: NET_hosts_tab:
   84: 	make TIMESTAMP=`date +"%s"` METAMTARGET="TRANSPORT" \
   85: 	MTARGET="hosts_tab" HOSTNAME="$(HOSTNAME)" lpmladm
   86: 
   87: hosts_tab: TEST_hosts_tab
   88: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
   89: 	perl xfml_parse.pl ../../doc/loncapafiles/valid_hosts.xfml | \
   90: 	perl xfml_parse.pl ../../doc/loncapafiles/no_globs.xfml | \
   91: 	perl xfml_parse.pl ../../doc/loncapafiles/no_links.xfml | \
   92: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
   93: 	"$(TARGET)" > Makefile.install
   94: 	make -f Makefile.install directories
   95: 	make -f Makefile.install files
   96: 	@echo "If hosts.tab has changed, restart httpd and loncontrol:"
   97: 	@echo "   /etc/rc.d/init.d/httpd restart"
   98: 	@echo "   /etc/rc.d/init.d/loncontrol restart"
   99: 
  100: lpmladm:
  101: 	@if (test $(METAMTARGET) = "TRANSPORT"); then \
  102: 		echo "Transporting to $(HOSTNAME)"; \
  103: 		sudo make DIST=$(DIST) CATEGORY=$(CATEGORY) \
  104: 		SOURCE="$(SOURCE)" \
  105: 		TARGET="lpmladm.$(TIMESTAMP)" \
  106: 		NORESTORECONF="$(NORESTORECONF)" "$(MTARGET)"; \
  107: 		cd lpmladm.$(TIMESTAMP); \
  108: 		sudo tar czvf ../tarball$(TIMESTAMP).tar.gz .; \
  109: 		cd ..; scp tarball$(TIMESTAMP).tar.gz \
  110: 		lpmladm@$(HOSTNAME):~/tarball$(TIMESTAMP).tar.gz; \
  111: 		ssh lpmladm@$(HOSTNAME) sudo mv tarball$(TIMESTAMP).tar.gz /; \
  112: 		ssh lpmladm@$(HOSTNAME) sudo tar -x -z -v -C / \
  113: 		-p --same-owner -f \
  114: 		/tarball$(TIMESTAMP).tar.gz; \
  115: 		ssh lpmladm@$(HOSTNAME) sudo rm -f \
  116: 		/tarball$(TIMESTAMP).tar.gz; \
  117: 	elif (test $(METAMTARGET) = "LAUNCH"); then \
  118: 		echo "Launching process on $(HOSTNAME)"; \
  119: 		LAUNCHSAVE=$(OUTSTREAM) $(SAVE); \
  120: 		make DIST=$(DIST) CATEGORY=$(CATEGORY) SOURCE="$(SOURCE)" \
  121: 		TARGET="$(TARGET)" NORESTORECONF="$(NORESTORECONF)" \
  122: 		LAUNCH="$(LAUNCHSAVE)" "$(MTARGET)"; \
  123: 		scp $(SAVE) lpmladm@$(HOSTNAME):~/$(SAVE); \
  124: 		ssh lpmladm@$(HOSTNAME) sudo perl $(SAVE); \
  125: 		ssh lpmladm@$(HOSTNAME) sudo rm -f $(SAVE); \
  126: 	else \
  127: 		echo "**** ERROR **** Incorrect METAMTARGET"; \
  128: 	fi
  129: 
  130: HTML:
  131: 	install -d HTML
  132: 	cp ../../doc/loncapafiles/*.gif HTML
  133: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  134: 	perl lpml_parse.pl html development default ../.. '' > HTML/index.html
  135: 
  136: status:
  137: 	install -d HTML
  138: 	cp ../../doc/loncapafiles/*.gif HTML
  139: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  140: 	perl lpml_parse.pl html $(CATEGORY) $(DIST) "../.." "" | \
  141: 	perl lpml_html_posteval.pl > \
  142: 	HTML/filestatus.html
  143: 
  144: statuspost: status
  145: 	cp ../../doc/loncapafiles/*.gif $(TARGET)/home/httpd/html/lon-status
  146: 	cp HTML/filestatus.html \
  147: 	$(TARGET)/home/httpd/html/lon-status/filestatus.html
  148: 
  149: rpmstatus:
  150: 	install -d RPMSTATUS
  151: 	rpm -qa --queryformat \
  152: 	'%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
  153: 	RPMSTATUS/current.tmp
  154: 	cat ../../doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
  155: 	cat ../../doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
  156: 	perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
  157: 	RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
  158: 
  159: rpmstatuspost: rpmstatus
  160: 	cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
  161: 
  162: configinstall: Makefile.configinstall
  163: 	make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  164: 	configfiles
  165: 	if (test "0" = $(NORESTORECONF)); then \
  166: 	perl loncaparestoreconfigurations suffix .lpmlnew; fi
  167: 
  168: Makefile.configinstall: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  169: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  170: 	perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
  171: 	"$(TARGET)" > Makefile.configinstall
  172: 
  173: warningnote:
  174: 	@if (test -s WARNINGS); then \
  175: 		W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
  176: 		E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
  177: 		N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
  178: 		echo "--->  $$W WARNINGS ENCOUNTERED!       "; \
  179: 		echo "--->  $$E ERRORS ENCOUNTERED!         "; \
  180: 		echo "--->  $$N NOTES ENCOUNTERED!          "; \
  181: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  182: 		echo "!!!!  Please read the WARNINGS file !!!!"; \
  183: 		echo "!!!!   to make sure everything is   !!!!"; \
  184: 		echo "!!!!    correct and taken care of   !!!!"; \
  185: 		echo "!!!!    (it is output below here)   !!!!"; \
  186: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
  187: 		cat WARNINGS; \
  188: 	fi
  189: 
  190: NET_webserverconf:
  191: 	make TIMESTAMP=`date +"%s"` METAMTARGET="LAUNCH" \
  192: 	MTARGET="webserverconf" HOSTNAME="$(HOSTNAME)" lpmladm
  193: 
  194: webserverconf:
  195: 	cat ../../doc/loncapafiles/webserver.piml | \
  196: 	perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH)
  197: 
  198: postinstall:
  199: 	make webserverconf
  200: 
  201: install: TEST_hosts_tab Makefile.install Makefile
  202: 	echo -n "" > WARNINGS
  203: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  204: 	directories
  205: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
  206: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
  207: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
  208: 	NORESTORECONF="$(NORESTORECONF)" configinstall
  209: 	make warningnote
  210: 
  211: Makefile.install: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  212: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  213: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
  214: 	"$(TARGET)" > Makefile.install
  215: 
  216: build: Makefile.build pod2html.sh pod2man.sh
  217: 	echo -n "" > WARNINGS
  218: 	make -f Makefile.build all
  219: 	make warningnote
  220: 
  221: Makefile.build: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
  222: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  223: 	perl lpml_parse.pl build $(CATEGORY) $(DIST) "../.." "" > \
  224: 	Makefile.build
  225: 
  226: RPM: BinaryRoot base_rpm_file_list
  227: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  228: 	perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) \
  229: 	> base_customizerpm.xml
  230: 	cat base_rpm_file_list.txt | perl make_rpm.pl base 3.2 '' '' \
  231: 	BinaryRoot base_customizerpm.xml
  232: 
  233: setup_RPM:
  234: 	echo "SetupBinaryRoot/etc/passwd" > setup_rpm_file_list.txt
  235: 	echo "SetupBinaryRoot/etc/group" >> setup_rpm_file_list.txt
  236: 	echo "SetupBinaryRoot/etc/hosts.deny" >> setup_rpm_file_list.txt
  237: 	echo "SetupBinaryRoot/home/www" >> setup_rpm_file_list.txt
  238: 	echo "SetupBinaryRoot/etc/pam.d/passwd" >> setup_rpm_file_list.txt
  239: 	echo "SetupBinaryRoot/etc/pam.d/login" >> setup_rpm_file_list.txt
  240: 	perl setup_rpm_binaryroot.pl
  241: 	cat setup_rpm_file_list.txt | perl make_rpm.pl setup 3.2 '' '' \
  242: 	SetupBinaryRoot customizerpm.xml
  243: 
  244: DPKG:
  245: 	make TARGET='LON-CAPA-base' NORESTORECONF='1' install
  246: 	@echo "You will next need to follow instructions at:"
  247: 	@echo "http://people.debian.org/~jaldhar/make_package1.html"
  248: 	@echo "A directory with a snapshot of the debian package files"
  249: 	@echo "is LON-CAPA-base."
  250: 
  251: base_rpm_file_list:
  252: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
  253: 	perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
  254: 	'BinaryRoot' | sort > base_rpm_file_list.txt
  255: 
  256: BinaryRoot: base_rpm_file_list
  257: 	make TARGET='BinaryRoot' NORESTORECONF='1' install
  258: 
  259: loncapaconfig:
  260: 	rm -Rf LoncapaconfigRoot
  261: 	install -d LoncapaconfigRoot/usr/src/
  262: 	install -d LoncapaconfigRoot/usr/lib/python1.5/site-packages
  263: 	install /usr/lib/python1.5/site-packages/kudzumodule.so \
  264: 	LoncapaconfigRoot/usr/lib/python1.5/site-packages/kudzumodule.so
  265: 	cd LoncapaconfigRoot/usr/src; cp -pR /mnt/drive/loncapaconfig .
  266: 	install -d LoncapaconfigRoot/usr/sbin
  267: 	@echo -e "#!/bin/sh\ncd /usr/src/loncapaconfig/usr/bin; \
  268: 	./loncapaconfig\n" > LoncapaconfigRoot/usr/sbin/loncapaconfig
  269: 	chmod u+x LoncapaconfigRoot/usr/sbin/loncapaconfig
  270: 	find LoncapaconfigRoot -type d | xargs chmod o-wxr
  271: 	find LoncapaconfigRoot -type f | xargs chmod o-wxr
  272: 	find LoncapaconfigRoot/ -type d | grep 'src/lon' > \
  273: 	loncapaconfig_file_list.txt
  274: 	find LoncapaconfigRoot/ -type d | grep \
  275: 	'^LoncapaconfigRoot/usr/lib/python1.5/site-packages' >> \
  276: 	loncapaconfig_file_list.txt
  277: 	find LoncapaconfigRoot/ -type f >> loncapaconfig_file_list.txt
  278: 	cat loncapaconfig_file_list.txt | perl make_rpm.pl loncapaconfig 3.1 \
  279: 	'' '' LoncapaconfigRoot
  280: 	cp LON-CAPA-loncapaconfig-3.1-1.i386.rpm \
  281: 	/mnt/drive/install.lon-capa.org/3.1/currentcdsource/RedHat/RPMS/.
  282: 
  283: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
  284: doc:
  285: 	install -d docs
  286: 	install -m 0755 -d docs/icons
  287: 	install -m 0644 ../../doc/icons/[^C][^V]* docs/icons
  288: 	install -m 0755 -d docs/reconfig
  289: 	perl doc_template.pl ../../doc/templates/template.html \
  290: 		../../doc/build/reconfig.html > docs/reconfig/index.html
  291: 	install -m 0755 -d docs/reconfig/confexamples
  292: 	install -m 0644 ../../doc/build/confexamples/[^C][^V]* \
  293: 		docs/reconfig/confexamples
  294: 	perl doc_template.pl ../../doc/templates/template.html \
  295: 		../../doc/build/installindex.html > docs/index.html
  296: 	install -m 0755 -d docs/license
  297: 	perl doc_template.pl ../../doc/templates/template.html \
  298: 		../../doc/build/license.html > docs/license/index.html
  299: 	install -m 0755 -d docs/contact
  300: 	perl doc_template.pl ../../doc/templates/template.html \
  301: 		../../doc/build/contact.html > docs/contact/index.html
  302: 	cd docs; tar czvpf ../docs.tar.gz .
  303: 
  304: documentation_tree: cvsreport
  305: 	install -d docs
  306: 	install ../../doc/build/cvsreport.html docs/cvsreport.html
  307: 	install ../../doc/build/doc.html docs/index.html
  308: 	install -d docs/hardware
  309: 	install ../../doc/hardware/hardware.html docs/hardware/hardware.html
  310: 	install -d docs/3.1
  311: 	install ../../doc/build/install.html docs/3.1/index.html
  312: 	install ../../doc/build/instructions_with_cd.html \
  313: 	docs/3.1/instructions_with_cd.html
  314: 	install ../../doc/build/libraryserverconfiguration.gif \
  315: 	docs/3.1/libraryserverconfiguration.gif
  316: 	install ../../doc/build/librarysystemsettings.gif \
  317: 	docs/3.1/librarysystemsettings.gif
  318: 	install -d docs/cvsupgrade
  319: 	install ../../doc/build/cvsupgrade.html docs/cvsupgrade/index.html
  320: 	install -d docs/upgrade
  321: 	install ../../doc/build/upgrade.html docs/upgrade/index.html
  322: 	install -d docs/reconfig
  323: 	install ../../doc/build/reconfig.html docs/reconfig/index.html
  324: 	install -d docs/3.1/otherfiles
  325: 	install ../../doc/otherfiles/rpm_list.txt \
  326: 	docs/3.1/otherfiles/rpm_list.txt
  327: 	install ../../doc/build/loncapanetwork.html docs/loncapanetwork.html
  328: 	install ../../doc/build/loncapanfs.html docs/loncapanfs.html
  329: 	install ../../doc/build/loncapaappleshares.html \
  330: 	docs/loncapaappleshares.html
  331: 	install ../../doc/build/loncapasqldatabase.html \
  332: 	docs/loncapasqldatabase.html
  333: 	install ../../doc/build/loncapapasswords.html \
  334: 	docs/loncapapasswords.html
  335: 	install ../../doc/build/loncapapasswordauthentication.html \
  336: 	docs/loncapapasswordauthentication.html
  337: 	install ../../doc/build/loncapatimesync.html docs/loncapatimesync.html
  338: 	install ../../doc/build/loncapamathequivalency.html \
  339: 	docs/loncapamathequivalency.html
  340: 	tar czvf install.lon-capa.org_docs.tar.gz docs
  341: 	rm -Rf docs
  342: 
  343: cvsreport:
  344: 
  345: clean:
  346: 	rm -Rf HTML
  347: 	rm -f Makefile.build
  348: 	rm -f Makefile.install
  349: 	rm -f Makefile.configinstall
  350: 	rm -Rf BinaryRoot
  351: 	rm -Rf SetupBinaryRoot
  352: 	rm -Rf LON-CAPA-base
  353: 	rm -f base_rpm_file_list.txt
  354: 	rm -f base_customizerpm.xml
  355: 	rm -f setup_rpm_file_list.txt
  356: 	rm -f docs.tar.gz
  357: 	rm -Rf docs
  358: 	rm -f program.pl*
  359: 	rm -Rf lpmladm.*
  360: 	make -f Makefile.cvs clean

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