File:  [LON-CAPA] / loncom / build / Makefile
Revision 1.63: download - view: text, annotated - select for diffs
Mon Feb 4 23:40:47 2002 UTC (22 years, 4 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
prompting user to make a softlink and supporting different hosts.tab
specifications

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

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