1: # The LearningOnline Network with CAPA
2:
3: # Scott Harrison
4: # $Id: Makefile,v 1.64 2002/02/05 00:51:48 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:
76: hosts_tab: TEST_hosts_tab
77: cat ../../doc/loncapafiles/loncapafiles.lpml | \
78: perl xfml_parse.pl ../../doc/loncapafiles/valid_hosts.xfml | \
79: perl xfml_parse.pl ../../doc/loncapafiles/no_globs.xfml | \
80: perl xfml_parse.pl ../../doc/loncapafiles/no_links.xfml | \
81: perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
82: "$(TARGET)" > Makefile.install
83: make -f Makefile.install files
84: @echo "If hosts.tab has changed, restart httpd and loncontrol:"
85: @echo " /etc/rc.d/init.d/httpd restart"
86: @echo " /etc/rc.d/init.d/loncontrol restart"
87:
88: HTML:
89: install -d HTML
90: cp ../../doc/loncapafiles/*.gif HTML
91: cat ../../doc/loncapafiles/loncapafiles.lpml | \
92: perl lpml_parse.pl html development default ../.. '' > HTML/index.html
93:
94: status:
95: install -d HTML
96: cp ../../doc/loncapafiles/*.gif HTML
97: cat ../../doc/loncapafiles/loncapafiles.lpml | \
98: perl lpml_parse.pl html $(CATEGORY) $(DIST) "../.." "" | \
99: perl lpml_html_posteval.pl > \
100: HTML/filestatus.html
101:
102: statuspost: status
103: cp ../../doc/loncapafiles/*.gif $(TARGET)/home/httpd/html/lon-status
104: cp HTML/filestatus.html \
105: $(TARGET)/home/httpd/html/lon-status/filestatus.html
106:
107: rpmstatus:
108: install -d RPMSTATUS
109: rpm -qa --queryformat \
110: '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | sort > \
111: RPMSTATUS/current.tmp
112: cat ../../doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
113: cat ../../doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
114: perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp \
115: RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
116:
117: rpmstatuspost: rpmstatus
118: cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
119:
120: configinstall: Makefile.configinstall
121: make -f Makefile.configinstall SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
122: configfiles
123: if (test "0" = $(NORESTORECONF)); then \
124: perl loncaparestoreconfigurations suffix .lpmlnew; fi
125:
126: Makefile.configinstall: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
127: cat ../../doc/loncapafiles/loncapafiles.lpml | \
128: perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "$(SOURCE)" \
129: "$(TARGET)" > Makefile.configinstall
130:
131: warningnote:
132: @if (test -s WARNINGS); then \
133: W=`grep -c '\*\*\*\* WARNING' WARNINGS`; \
134: E=`grep -c '\*\*\*\* ERROR' WARNINGS`; \
135: N=`grep -c '\*\*\*\* NOTE' WARNINGS`; \
136: echo "---> $$W WARNINGS ENCOUNTERED! "; \
137: echo "---> $$E ERRORS ENCOUNTERED! "; \
138: echo "---> $$N NOTES ENCOUNTERED! "; \
139: echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
140: echo "!!!! Please read the WARNINGS file !!!!"; \
141: echo "!!!! to make sure everything is !!!!"; \
142: echo "!!!! correct and taken care of !!!!"; \
143: echo "!!!! (it is output below here) !!!!"; \
144: echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; \
145: cat WARNINGS; \
146: fi
147:
148: install: TEST_hosts_tab Makefile.install Makefile
149: echo -n "" > WARNINGS
150: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
151: directories
152: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" files
153: make -f Makefile.install SOURCE="$(SOURCE)" TARGET="$(TARGET)" links
154: make SOURCE="$(SOURCE)" TARGET="$(TARGET)" \
155: NORESTORECONF="$(NORESTORECONF)" configinstall
156: make warningnote
157:
158: Makefile.install: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
159: cat ../../doc/loncapafiles/loncapafiles.lpml | \
160: perl lpml_parse.pl install $(CATEGORY) $(DIST) "$(SOURCE)" \
161: "$(TARGET)" > Makefile.install
162:
163: build: Makefile.build pod2html.sh pod2man.sh
164: echo -n "" > WARNINGS
165: make -f Makefile.build all
166: make warningnote
167:
168: Makefile.build: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
169: cat ../../doc/loncapafiles/loncapafiles.lpml | \
170: perl lpml_parse.pl build $(CATEGORY) $(DIST) "../.." "" > \
171: Makefile.build
172:
173: RPM: BinaryRoot base_rpm_file_list
174: cat ../../doc/loncapafiles/loncapafiles.lpml | \
175: perl lpml_parse.pl make_rpm $(CATEGORY) $(DIST) $(SOURCE) $(TARGET) \
176: > base_customizerpm.xml
177: cat base_rpm_file_list.txt | perl make_rpm.pl base 3.2 '' '' \
178: BinaryRoot base_customizerpm.xml
179:
180: setup_RPM:
181: echo "SetupBinaryRoot/etc/passwd" > setup_rpm_file_list.txt
182: echo "SetupBinaryRoot/etc/group" >> setup_rpm_file_list.txt
183: echo "SetupBinaryRoot/etc/hosts.deny" >> setup_rpm_file_list.txt
184: echo "SetupBinaryRoot/home/www" >> setup_rpm_file_list.txt
185: echo "SetupBinaryRoot/etc/pam.d/passwd" >> setup_rpm_file_list.txt
186: echo "SetupBinaryRoot/etc/pam.d/login" >> setup_rpm_file_list.txt
187: perl setup_rpm_binaryroot.pl
188: cat setup_rpm_file_list.txt | perl make_rpm.pl setup 3.2 '' '' \
189: SetupBinaryRoot customizerpm.xml
190:
191: DPKG:
192: make TARGET='LON-CAPA-base' NORESTORECONF='1' install
193: @echo "You will next need to follow instructions at:"
194: @echo "http://people.debian.org/~jaldhar/make_package1.html"
195: @echo "A directory with a snapshot of the debian package files"
196: @echo "is LON-CAPA-base."
197:
198: base_rpm_file_list:
199: cat ../../doc/loncapafiles/loncapafiles.lpml | \
200: perl lpml_parse.pl rpm_file_list $(CATEGORY) $(DIST) $(SOURCE) \
201: 'BinaryRoot' | sort > base_rpm_file_list.txt
202:
203: BinaryRoot: base_rpm_file_list
204: make TARGET='BinaryRoot' NORESTORECONF='1' install
205:
206: loncapaconfig:
207: rm -Rf LoncapaconfigRoot
208: install -d LoncapaconfigRoot/usr/src/
209: install -d LoncapaconfigRoot/usr/lib/python1.5/site-packages
210: install /usr/lib/python1.5/site-packages/kudzumodule.so \
211: LoncapaconfigRoot/usr/lib/python1.5/site-packages/kudzumodule.so
212: cd LoncapaconfigRoot/usr/src; cp -pR /mnt/drive/loncapaconfig .
213: install -d LoncapaconfigRoot/usr/sbin
214: @echo -e "#!/bin/sh\ncd /usr/src/loncapaconfig/usr/bin; \
215: ./loncapaconfig\n" > LoncapaconfigRoot/usr/sbin/loncapaconfig
216: chmod u+x LoncapaconfigRoot/usr/sbin/loncapaconfig
217: find LoncapaconfigRoot -type d | xargs chmod o-wxr
218: find LoncapaconfigRoot -type f | xargs chmod o-wxr
219: find LoncapaconfigRoot/ -type d | grep 'src/lon' > \
220: loncapaconfig_file_list.txt
221: find LoncapaconfigRoot/ -type d | grep \
222: '^LoncapaconfigRoot/usr/lib/python1.5/site-packages' >> \
223: loncapaconfig_file_list.txt
224: find LoncapaconfigRoot/ -type f >> loncapaconfig_file_list.txt
225: cat loncapaconfig_file_list.txt | perl make_rpm.pl loncapaconfig 3.1 \
226: '' '' LoncapaconfigRoot
227: cp LON-CAPA-loncapaconfig-3.1-1.i386.rpm \
228: /mnt/drive/install.lon-capa.org/3.1/currentcdsource/RedHat/RPMS/.
229:
230: # Generates CVS:loncom/build/docs; root location of install.lon-capa.org
231: doc:
232: install -d docs
233: install -m 0755 -d docs/icons
234: install -m 0644 ../../doc/icons/[^C][^V]* docs/icons
235: install -m 0755 -d docs/reconfig
236: perl doc_template.pl ../../doc/templates/template.html \
237: ../../doc/build/reconfig.html > docs/reconfig/index.html
238: install -m 0755 -d docs/reconfig/confexamples
239: install -m 0644 ../../doc/build/confexamples/[^C][^V]* \
240: docs/reconfig/confexamples
241: cd docs; tar czvpf ../docs.tar.gz .
242:
243: documentation_tree: cvsreport
244: install -d docs
245: install ../../doc/build/cvsreport.html docs/cvsreport.html
246: install ../../doc/build/doc.html docs/index.html
247: install -d docs/hardware
248: install ../../doc/hardware/hardware.html docs/hardware/hardware.html
249: install -d docs/3.1
250: install ../../doc/build/install.html docs/3.1/index.html
251: install ../../doc/build/instructions_with_cd.html \
252: docs/3.1/instructions_with_cd.html
253: install ../../doc/build/libraryserverconfiguration.gif \
254: docs/3.1/libraryserverconfiguration.gif
255: install ../../doc/build/librarysystemsettings.gif \
256: docs/3.1/librarysystemsettings.gif
257: install -d docs/cvsupgrade
258: install ../../doc/build/cvsupgrade.html docs/cvsupgrade/index.html
259: install -d docs/upgrade
260: install ../../doc/build/upgrade.html docs/upgrade/index.html
261: install -d docs/reconfig
262: install ../../doc/build/reconfig.html docs/reconfig/index.html
263: install -d docs/3.1/otherfiles
264: install ../../doc/otherfiles/rpm_list.txt \
265: docs/3.1/otherfiles/rpm_list.txt
266: install ../../doc/build/loncapanetwork.html docs/loncapanetwork.html
267: install ../../doc/build/loncapanfs.html docs/loncapanfs.html
268: install ../../doc/build/loncapaappleshares.html \
269: docs/loncapaappleshares.html
270: install ../../doc/build/loncapasqldatabase.html \
271: docs/loncapasqldatabase.html
272: install ../../doc/build/loncapapasswords.html \
273: docs/loncapapasswords.html
274: install ../../doc/build/loncapapasswordauthentication.html \
275: docs/loncapapasswordauthentication.html
276: install ../../doc/build/loncapatimesync.html docs/loncapatimesync.html
277: install ../../doc/build/loncapamathequivalency.html \
278: docs/loncapamathequivalency.html
279: tar czvf install.lon-capa.org_docs.tar.gz docs
280: rm -Rf docs
281:
282: cvsreport:
283:
284: clean:
285: rm -Rf HTML
286: rm -f Makefile.build
287: rm -f Makefile.install
288: rm -f Makefile.configinstall
289: rm -Rf BinaryRoot
290: rm -Rf SetupBinaryRoot
291: rm -Rf LON-CAPA-base
292: rm -f base_rpm_file_list.txt
293: rm -f base_customizerpm.xml
294: rm -f setup_rpm_file_list.txt
295: rm -f docs.tar.gz
296: rm -Rf docs
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>