Annotation of loncom/build/Makefile, revision 1.62

1.48      harris41    1: # The LearningOnline Network with CAPA
                      2: 
1.1       harris41    3: # Scott Harrison
1.62    ! harris41    4: # $Id: Makefile,v 1.61 2002/01/11 17:35:39 harris41 Exp $
1.1       harris41    5: 
1.38      harris41    6: DIST="default"
1.39      harris41    7: CATEGORY="development"
1.51      harris41    8: SOURCE="../.."
                      9: TARGET=""
1.55      harris41   10: NORESTORECONF="0"
1.12      harris41   11: 
1.53      harris41   12: help: 
1.52      harris41   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"
1.54      harris41   33: 	@echo "documentation_tree: compiles a documentation tree from the "
                     34:         @echo "                    CVS:doc directory"
1.52      harris41   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"
1.55      harris41   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"
1.1       harris41   47: 
1.52      harris41   48: test: TEST_lpml_scripts TEST_system_dependencies TEST_web_layer
1.41      harris41   49: 	@echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
                     50: 
                     51: TEST_system_dependencies:
1.52      harris41   52: 	@echo "TESTING SYSTEM DEPENDENCIES"
1.41      harris41   53: 	cd system_dependencies; make
1.44      harris41   54: 
                     55: TEST_lpml_scripts:
1.52      harris41   56: 	@echo "TESTING LPML INSTALLATION CODE"
1.44      harris41   57: 	cd ../test; perl filecomparetest.pl
1.41      harris41   58: 
1.52      harris41   59: TEST_web_layer:
                     60: 	@echo "Testing of web layers is not yet implemented."
1.2       harris41   61: 
1.3       harris41   62: HTML:
                     63: 	install -d HTML
                     64: 	cp ../../doc/loncapafiles/*.gif HTML
1.55      harris41   65: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
                     66: 	perl lpml_parse.pl html development default ../.. '' > HTML/index.html
1.3       harris41   67: 
1.8       harris41   68: status:
1.7       harris41   69: 	install -d HTML
                     70: 	cp ../../doc/loncapafiles/*.gif HTML
1.39      harris41   71: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
1.49      harris41   72: 	perl lpml_parse.pl html $(CATEGORY) $(DIST) "../.." "" | \
                     73: 	perl lpml_html_posteval.pl > \
1.39      harris41   74: 	HTML/filestatus.html
1.48      harris41   75: 
1.22      harris41   76: statuspost: status
1.52      harris41   77: 	cp ../../doc/loncapafiles/*.gif $(TARGET)/home/httpd/html/lon-status
                     78: 	cp HTML/filestatus.html \
                     79: 	$(TARGET)/home/httpd/html/lon-status/filestatus.html
1.22      harris41   80: 
1.33      harris41   81: rpmstatus:
                     82: 	install -d RPMSTATUS
1.52      harris41   83: 	rpm -qa --queryformat \
                     84: 	'%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
                     85: 	RPMSTATUS/current.tmp
1.34      harris41   86: 	cat ../../doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
1.36      harris41   87: 	cat ../../doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
1.52      harris41   88: 	perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
                     89: 	RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
1.33      harris41   90: 
                     91: rpmstatuspost: rpmstatus
                     92: 	cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
                     93: 
1.37      albertel   94: configinstall: Makefile.configinstall
1.55      harris41   95: 	make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
                     96: 	configfiles
                     97: 	if (test "0" = $(NORESTORECONF)); then \
                     98: 	perl loncaparestoreconfigurations suffix .lpmlnew; fi
1.9       harris41   99: 
1.40      harris41  100: Makefile.configinstall: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
                    101: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
1.55      harris41  102: 	perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
                    103: 	"$(TARGET)" > Makefile.configinstall
1.37      albertel  104: 
1.45      harris41  105: warningnote:
                    106: 	@if (test -s WARNINGS); then \
                    107: 		W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
                    108: 		E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
                    109: 		N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
                    110: 		echo "--->  $$W WARNINGS ENCOUNTERED!       "; \
                    111: 		echo "--->  $$E ERRORS ENCOUNTERED!         "; \
                    112: 		echo "--->  $$N NOTES ENCOUNTERED!          "; \
                    113: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
                    114: 		echo "!!!!  Please read the WARNINGS file !!!!"; \
                    115: 		echo "!!!!   to make sure everything is   !!!!"; \
                    116: 		echo "!!!!    correct and taken care of   !!!!"; \
                    117: 		echo "!!!!    (it is output below here)   !!!!"; \
                    118: 		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
                    119: 		cat WARNINGS; \
                    120: 	fi
                    121: 
1.51      harris41  122: install: Makefile.install Makefile
1.46      harris41  123: 	echo -n "" > WARNINGS
1.52      harris41  124: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
                    125: 	directories
1.51      harris41  126: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
                    127: 	make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
1.55      harris41  128: 	make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
                    129: 	NORESTORECONF="$(NORESTORECONF)" configinstall
1.45      harris41  130: 	make warningnote
1.4       harris41  131: 
1.38      harris41  132: Makefile.install: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
                    133: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
1.52      harris41  134: 	perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
                    135: 	"$(TARGET)" > Makefile.install
1.37      albertel  136: 
1.50      harris41  137: build: Makefile.build pod2html.sh pod2man.sh
1.46      harris41  138: 	echo -n "" > WARNINGS
1.37      albertel  139: 	make -f Makefile.build all
1.45      harris41  140: 	make warningnote
1.37      albertel  141: 
1.39      harris41  142: Makefile.build: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
                    143: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
                    144: 	perl lpml_parse.pl build $(CATEGORY) $(DIST) "../.." "" > \
                    145: 	Makefile.build
1.8       harris41  146: 
1.55      harris41  147: RPM: BinaryRoot base_rpm_file_list
                    148: 	cat ../../doc/loncapafiles/loncapafiles.lpml | perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) > base_customizerpm.xml
                    149: 	cat base_rpm_file_list.txt | perl make_rpm.pl base 3.2 '' '' \
                    150: 	BinaryRoot base_customizerpm.xml
                    151: 
1.59      harris41  152: setup_RPM:
1.55      harris41  153: 	echo "SetupBinaryRoot/etc/passwd" > setup_rpm_file_list.txt
                    154: 	echo "SetupBinaryRoot/etc/group" >> setup_rpm_file_list.txt
                    155: 	echo "SetupBinaryRoot/etc/hosts.deny" >> setup_rpm_file_list.txt
                    156: 	echo "SetupBinaryRoot/home/www" >> setup_rpm_file_list.txt
                    157: 	echo "SetupBinaryRoot/etc/pam.d/passwd" >> setup_rpm_file_list.txt
                    158: 	echo "SetupBinaryRoot/etc/pam.d/login" >> setup_rpm_file_list.txt
                    159: 	perl setup_rpm_binaryroot.pl
                    160: 	cat setup_rpm_file_list.txt | perl make_rpm.pl setup 3.2 '' '' \
                    161: 	SetupBinaryRoot customizerpm.xml
1.60      harris41  162: 
                    163: DPKG:
                    164: 	make TARGET='LON-CAPA-base' NORESTORECONF='1' install
                    165: 	@echo "You will next need to follow instructions at:"
                    166: 	@echo "http://people.debian.org/~jaldhar/make_package1.html"
                    167: 	@echo "A directory with a snapshot of the debian package files"
                    168: 	@echo "is LON-CAPA-base."
1.55      harris41  169: 
                    170: base_rpm_file_list:
                    171: 	cat ../../doc/loncapafiles/loncapafiles.lpml | \
                    172: 	perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
                    173: 	'BinaryRoot' | sort > base_rpm_file_list.txt
1.6       harris41  174: 
1.55      harris41  175: BinaryRoot: base_rpm_file_list
                    176: 	make TARGET='BinaryRoot' NORESTORECONF='1' install
1.5       harris41  177: 
1.23      harris41  178: loncapaconfig:
                    179: 	rm -Rf LoncapaconfigRoot
                    180: 	install -d LoncapaconfigRoot/usr/src/
1.24      harris41  181: 	install -d LoncapaconfigRoot/usr/lib/python1.5/site-packages
1.52      harris41  182: 	install /usr/lib/python1.5/site-packages/kudzumodule.so \
                    183: 	LoncapaconfigRoot/usr/lib/python1.5/site-packages/kudzumodule.so
1.23      harris41  184: 	cd LoncapaconfigRoot/usr/src; cp -pR /mnt/drive/loncapaconfig .
                    185: 	install -d LoncapaconfigRoot/usr/sbin
1.52      harris41  186: 	@echo -e "#!/bin/sh\ncd /usr/src/loncapaconfig/usr/bin; \
                    187: 	./loncapaconfig\n" > LoncapaconfigRoot/usr/sbin/loncapaconfig
1.23      harris41  188: 	chmod u+x LoncapaconfigRoot/usr/sbin/loncapaconfig
1.24      harris41  189: 	find LoncapaconfigRoot -type d | xargs chmod o-wxr
                    190: 	find LoncapaconfigRoot -type f | xargs chmod o-wxr
1.52      harris41  191: 	find LoncapaconfigRoot/ -type d | grep 'src/lon' > \
                    192: 	loncapaconfig_file_list.txt
                    193: 	find LoncapaconfigRoot/ -type d | grep \
                    194: 	'^LoncapaconfigRoot/usr/lib/python1.5/site-packages' >> \
                    195: 	loncapaconfig_file_list.txt
1.24      harris41  196: 	find LoncapaconfigRoot/ -type f >> loncapaconfig_file_list.txt
1.52      harris41  197: 	cat loncapaconfig_file_list.txt | perl make_rpm.pl loncapaconfig 3.1 \
                    198: 	'' '' LoncapaconfigRoot
                    199: 	cp LON-CAPA-loncapaconfig-3.1-1.i386.rpm \
                    200: 	/mnt/drive/install.lon-capa.org/3.1/currentcdsource/RedHat/RPMS/.
1.23      harris41  201: 
1.62    ! harris41  202: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
        !           203: doc:
        !           204: 	install -d docs
        !           205: 	install -m 0755 -d docs/icons
        !           206: 	install -m 0644 ../../doc/icons/[^C][^V]* docs/icons
        !           207: 	install -m 0755 -d docs/reconfig
        !           208: 	perl doc_template.pl ../../doc/templates/template.html \
        !           209: 		../../doc/build/reconfig.html > docs/reconfig/index.html
        !           210: 	install -m 0755 -d docs/reconfig/confexamples
        !           211: 	install -m 0644 ../../doc/build/confexamples/[^C][^V]* \
        !           212: 		docs/reconfig/confexamples
        !           213: 	cd docs; tar czvpf ../docs.tar.gz .
        !           214: 
1.54      harris41  215: documentation_tree: cvsreport
1.26      harris41  216: 	install -d docs
1.31      harris41  217: 	install ../../doc/build/cvsreport.html docs/cvsreport.html
1.26      harris41  218: 	install ../../doc/build/doc.html docs/index.html
                    219: 	install -d docs/hardware
1.27      harris41  220: 	install ../../doc/hardware/hardware.html docs/hardware/hardware.html
1.26      harris41  221: 	install -d docs/3.1
                    222: 	install ../../doc/build/install.html docs/3.1/index.html
1.52      harris41  223: 	install ../../doc/build/instructions_with_cd.html \
                    224: 	docs/3.1/instructions_with_cd.html
                    225: 	install ../../doc/build/libraryserverconfiguration.gif \
                    226: 	docs/3.1/libraryserverconfiguration.gif
                    227: 	install ../../doc/build/librarysystemsettings.gif \
                    228: 	docs/3.1/librarysystemsettings.gif
1.35      harris41  229: 	install -d docs/cvsupgrade
                    230: 	install ../../doc/build/cvsupgrade.html docs/cvsupgrade/index.html
1.26      harris41  231: 	install -d docs/upgrade
1.35      harris41  232: 	install ../../doc/build/upgrade.html docs/upgrade/index.html
1.26      harris41  233: 	install -d docs/reconfig
                    234: 	install ../../doc/build/reconfig.html docs/reconfig/index.html
1.27      harris41  235: 	install -d docs/3.1/otherfiles
1.52      harris41  236: 	install ../../doc/otherfiles/rpm_list.txt \
                    237: 	docs/3.1/otherfiles/rpm_list.txt
1.27      harris41  238: 	install ../../doc/build/loncapanetwork.html docs/loncapanetwork.html
                    239: 	install ../../doc/build/loncapanfs.html docs/loncapanfs.html
1.52      harris41  240: 	install ../../doc/build/loncapaappleshares.html \
                    241: 	docs/loncapaappleshares.html
                    242: 	install ../../doc/build/loncapasqldatabase.html \
                    243: 	docs/loncapasqldatabase.html
                    244: 	install ../../doc/build/loncapapasswords.html \
                    245: 	docs/loncapapasswords.html
                    246: 	install ../../doc/build/loncapapasswordauthentication.html \
                    247: 	docs/loncapapasswordauthentication.html
1.28      harris41  248: 	install ../../doc/build/loncapatimesync.html docs/loncapatimesync.html
1.52      harris41  249: 	install ../../doc/build/loncapamathequivalency.html \
                    250: 	docs/loncapamathequivalency.html
1.27      harris41  251: 	tar czvf install.lon-capa.org_docs.tar.gz docs
                    252: 	rm -Rf docs
1.26      harris41  253: 
1.30      harris41  254: cvsreport:
1.52      harris41  255: 
1.1       harris41  256: clean:
1.3       harris41  257: 	rm -Rf HTML
1.8       harris41  258: 	rm -f Makefile.build
                    259: 	rm -f Makefile.install
1.57      harris41  260: 	rm -f Makefile.configinstall
1.55      harris41  261: 	rm -Rf BinaryRoot
                    262: 	rm -Rf SetupBinaryRoot
1.62    ! harris41  263: 	rm -Rf LON-CAPA-base
1.56      harris41  264: 	rm -f base_rpm_file_list.txt
1.58      harris41  265: 	rm -f base_customizerpm.xml
1.56      harris41  266: 	rm -f setup_rpm_file_list.txt
1.62    ! harris41  267: 	rm -f docs.tar.gz
        !           268: 	rm -Rf docs

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