1: # Makefile
2: # For LON-CAPA
3: # Scott Harrison
4: # November 2000
5:
6: CDTARGET="."
7: CDFSLOC="/mnt/loncapacd/install.lon-capa.org/3.1/currentcdsource"
8: DIST="default"
9: CATEGORY="development"
10:
11: all:
12: # nothing yet here
13:
14: test: TEST_system_dependencies
15: @echo "ALL SYSTEM DEPENDENCY TESTS SUCCESSFUL"
16:
17: TEST_system_dependencies:
18: cd system_dependencies; make
19:
20: cd:
21: # Build temporary script to get cd
22: # make sure there is enough disk space
23: @echo "# Automatically generated Makefile for LON-CAPA" > Makefile.cd.tmp
24: @/bin/df $(CDTARGET) | perl -e '@l=<>;split(/\s+/,$$l[1]);$$s=@_[3]*1024;if ($$s>1000000000) {print "\S=1\n";} else {print "\S=0\n";}' >> Makefile.cd.tmp
25: @echo "cd:" >> Makefile.cd.tmp
26: @echo -e "ifeq (\$$(S),1)" >> Makefile.cd.tmp
27: @echo -e "\t@echo \"There is enough disk space. Good!\"" >> Makefile.cd.tmp
28: # set up commands to copy cd image from install.lon-capa.org (wget -r)
29: @echo -e "\tcd \$$(TARGET); wget -np -N -r -l 1000 http://install.lon-capa.org/3.1/currentcdsource" >> Makefile.cd.tmp
30: @echo -e "\tcd \$$(TARGET); find ./install.lon-capa.org -name index.html | xargs rm -f" >> Makefile.cd.tmp
31: # set up cvs update commands
32: # set up cd image compilation (mkisofs)
33: @echo -e "\tcd \$$(TARGET)/install.lon-capa.org/3.1/currentcdsource/; mkisofs -v -R -T -V \"LON-CAPA and Red Hat 6.2\" -b images/boot.img -c boot.cat -o \$$(TARGET)/redhat.img ." >> Makefile.cd.tmp
34: @echo -e "else" >> Makefile.cd.tmp
35: @echo -e "\t@echo \"ERROR ******* Not enough disk space. There must be at least one gigabyte free\"" >> Makefile.cd.tmp
36: @echo -e "endif" >> Makefile.cd.tmp
37: @echo -e "\t@echo \"To mount this for something like an http network install; mount -t iso9660 -o ro,loop=/dev/loop0 /mnt/drive/redhat.img /home/harris41/public_html/mount\"" >> Makefile.cd.tmp
38: make -f Makefile.cd.tmp TARGET="$(CDTARGET)" cd
39:
40: cd_cover:
41:
42: HTML:
43: install -d HTML
44: cp ../../doc/loncapafiles/*.gif HTML
45: perl parse.pl ../../doc/loncapafiles/loncapafiles.html HTML > HTML/index.html
46:
47: status:
48: install -d HTML
49: cp ../../doc/loncapafiles/*.gif HTML
50: cat ../../doc/loncapafiles/loncapafiles.lpml | \
51: perl lpml_parse.pl html $(CATEGORY) $(DIST) "../.." "" > \
52: HTML/filestatus.html
53: # perl parse.pl ../../doc/loncapafiles/loncapafiles.html status > HTML/filestatus.html
54:
55: statuspost: status
56: cp ../../doc/loncapafiles/*.gif /home/httpd/html/lon-status
57: cp HTML/filestatus.html /home/httpd/html/lon-status/filestatus.html
58:
59: rpmstatus:
60: install -d RPMSTATUS
61: rpm -qa --queryformat '%{NAME}\t%{VERSION}\t%{BUILDTIME}\n' | sort > RPMSTATUS/current.tmp
62: cat ../../doc/otherfiles/cd_rpms.txt > RPMSTATUS/standard.tmp
63: cat ../../doc/otherfiles/rpm_list.txt > RPMSTATUS/expected.tmp
64: perl rpmparse.pl RPMSTATUS/standard.tmp RPMSTATUS/current.tmp RPMSTATUS/expected.tmp > RPMSTATUS/rpmstatus.html
65:
66: rpmstatuspost: rpmstatus
67: cp RPMSTATUS/rpmstatus.html /home/httpd/html/lon-status/rpmstatus.html
68:
69: LCMakefile:
70: perl parse.pl ../../doc/loncapafiles/loncapafiles.html LCMakefile > LCMakefile
71:
72: SPEC:
73: perl parse.pl ../../doc/loncapafiles/loncapafiles.html SPEC
74:
75: configinstall: Makefile.configinstall
76: make -f Makefile.configinstall SOURCE="../.." TARGET="" configfiles
77: # perl loncaparestoreconfigurations lasttimestamp
78: # make -f Makefile.configinstall TARGET="" configpermissions
79:
80: Makefile.configinstall: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
81: # perl parse.pl ../../doc/loncapafiles/loncapafiles.html configinstall > Makefile.configinstall
82: cat ../../doc/loncapafiles/loncapafiles.lpml | \
83: perl lpml_parse.pl configinstall $(CATEGORY) $(DIST) "../.." "" > \
84: Makefile.configinstall
85:
86: install: Makefile.install
87: make -f Makefile.install SOURCE="../.." TARGET="" directories
88: make -f Makefile.install SOURCE="../.." TARGET="" files
89: make -f Makefile.install SOURCE="../.." TARGET="" links
90: make configinstall
91:
92: Makefile.install: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
93: cat ../../doc/loncapafiles/loncapafiles.lpml | \
94: perl lpml_parse.pl install $(CATEGORY) $(DIST) "../.." "" > \
95: Makefile.install
96:
97: build: Makefile.build
98: make -f Makefile.build all
99:
100: Makefile.build: ../../doc/loncapafiles/loncapafiles.lpml lpml_parse.pl
101: cat ../../doc/loncapafiles/loncapafiles.lpml | \
102: perl lpml_parse.pl build $(CATEGORY) $(DIST) "../.." "" > \
103: Makefile.build
104:
105: RPM: BinaryRoot
106: cat base_file_list.txt | perl make_rpm.pl base 3.1 '' '' BinaryRoot
107: cat setup_file_list.txt | perl make_rpm.pl setup 3.1 '' '' BinaryRoot
108: cp LON-CAPA-base-3.1-1.i386.rpm $(CDFSLOC)/RedHat/RPMS/.
109: cp LON-CAPA-setup-3.1-1.i386.rpm $(CDFSLOC)/RedHat/RPMS/.
110:
111: BinaryRoot:
112: perl parse.pl ../../doc/loncapafiles/loncapafiles.html BinaryRoot
113:
114: loncapaconfig:
115: rm -Rf LoncapaconfigRoot
116: install -d LoncapaconfigRoot/usr/src/
117: install -d LoncapaconfigRoot/usr/lib/python1.5/site-packages
118: install /usr/lib/python1.5/site-packages/kudzumodule.so LoncapaconfigRoot/usr/lib/python1.5/site-packages/kudzumodule.so
119: cd LoncapaconfigRoot/usr/src; cp -pR /mnt/drive/loncapaconfig .
120: install -d LoncapaconfigRoot/usr/sbin
121: @echo -e "#!/bin/sh\ncd /usr/src/loncapaconfig/usr/bin; ./loncapaconfig\n" > LoncapaconfigRoot/usr/sbin/loncapaconfig
122: chmod u+x LoncapaconfigRoot/usr/sbin/loncapaconfig
123: find LoncapaconfigRoot -type d | xargs chmod o-wxr
124: find LoncapaconfigRoot -type f | xargs chmod o-wxr
125: find LoncapaconfigRoot/ -type d | grep 'src/lon' > loncapaconfig_file_list.txt
126: find LoncapaconfigRoot/ -type d | grep '^LoncapaconfigRoot/usr/lib/python1.5/site-packages' >> loncapaconfig_file_list.txt
127: find LoncapaconfigRoot/ -type f >> loncapaconfig_file_list.txt
128: cat loncapaconfig_file_list.txt | perl make_rpm.pl loncapaconfig 3.1 '' '' LoncapaconfigRoot
129: cp LON-CAPA-loncapaconfig-3.1-1.i386.rpm /mnt/drive/install.lon-capa.org/3.1/currentcdsource/RedHat/RPMS/.
130:
131: install.lon-capa.org: cvsreport
132: install -d docs
133: install ../../doc/build/cvsreport.html docs/cvsreport.html
134: install ../../doc/build/doc.html docs/index.html
135: install -d docs/hardware
136: install ../../doc/hardware/hardware.html docs/hardware/hardware.html
137: install -d docs/3.1
138: install ../../doc/build/install.html docs/3.1/index.html
139: install ../../doc/build/instructions_with_cd.html docs/3.1/instructions_with_cd.html
140: install ../../doc/build/libraryserverconfiguration.gif docs/3.1/libraryserverconfiguration.gif
141: install ../../doc/build/librarysystemsettings.gif docs/3.1/librarysystemsettings.gif
142: install -d docs/cvsupgrade
143: install ../../doc/build/cvsupgrade.html docs/cvsupgrade/index.html
144: install -d docs/upgrade
145: install ../../doc/build/upgrade.html docs/upgrade/index.html
146: install -d docs/reconfig
147: install ../../doc/build/reconfig.html docs/reconfig/index.html
148: install -d docs/3.1/otherfiles
149: install ../../doc/otherfiles/rpm_list.txt docs/3.1/otherfiles/rpm_list.txt
150: install ../../doc/build/loncapanetwork.html docs/loncapanetwork.html
151: install ../../doc/build/loncapanfs.html docs/loncapanfs.html
152: install ../../doc/build/loncapaappleshares.html docs/loncapaappleshares.html
153: install ../../doc/build/loncapasqldatabase.html docs/loncapasqldatabase.html
154: install ../../doc/build/loncapapasswords.html docs/loncapapasswords.html
155: install ../../doc/build/loncapapasswordauthentication.html docs/loncapapasswordauthentication.html
156: install ../../doc/build/loncapatimesync.html docs/loncapatimesync.html
157: install ../../doc/build/loncapamathequivalency.html docs/loncapamathequivalency.html
158: tar czvf install.lon-capa.org_docs.tar.gz docs
159: rm -Rf docs
160:
161: cvsreport:
162: echo "<H1>Automatically generated CVS report</H1>" > ../../doc/build/cvsreport.html
163: echo "<H1>LON-CAPA Software Changes from `date --date='7 days ago' +\"%Y-%m-%d\"` to `date +\"%Y-%m-%d\"`</H1>" >> ../../doc/build/cvsreport.html
164: echo "<P>Number of altered files:" >> ../../doc/build/cvsreport.html
165: cd ../..; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" loncom CAPA doc packaging 2>/dev/null | perl loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- | wc -l >> doc/build/cvsreport.html
166: echo "</P><P>Altered files:</P><P><PRE>" >> ../../doc/build/cvsreport.html
167: cd ../..; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" loncom CAPA doc packaging 2>/dev/null | perl loncom/build/cvsfilter.pl | grep '^Working file:' | cut -b15- >> doc/build/cvsreport.html
168: echo "</PRE></P><P>Log entries for <B>loncom</B>:</P><PRE>" >> ../../doc/build/cvsreport.html
169: cd ../../loncom; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> ../doc/build/cvsreport.html
170: echo "</PRE></P><P>Log entries for <B>CAPA</B>:</P><PRE>" >> ../../doc/build/cvsreport.html
171: cd ../../CAPA; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> ../doc/build/cvsreport.html
172: echo "</PRE></P><P>Log entries for <B>doc</B>:</P><PRE>" >> ../../doc/build/cvsreport.html
173: cd ../../doc; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> ../doc/build/cvsreport.html
174: echo "</PRE></P><P>Log entries for <B>packaging</B>:</P><PRE>" >> ../../doc/build/cvsreport.html
175: cd ../../packaging; cvs log -d ">`date --date='8 days ago' +\"%Y-%m-%d\"`" . 2>/dev/null | perl ../loncom/build/cvsfilter.pl >> ../doc/build/cvsreport.html
176: echo "</PRE></P>" >> ../../doc/build/cvsreport.html
177: clean:
178: rm -Rf HTML
179: rm -f *.spec
180: rm -f LCMakefile
181: rm -Rf BinaryRoot
182: rm -f Makefile.BinaryRoot
183: rm -f Makefile.build
184: rm -f Makefile.install
185: rm -f Makefile.install.tmp
186: rm -f Makefile.cd.tmp
187: rm -f *.rpm
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>