version 1.1, 2001/01/16 17:58:43
|
version 1.8, 2001/01/17 11:57:59
|
Line 1
|
Line 1
|
<H1>LON-CAPA Software Developer Instructions</H1> |
<H1>LON-CAPA Software Developer Instructions</H1> |
|
|
|
<OL> |
|
<LI><A HREF="#Using_CVS">Using CVS</A> |
<UL> |
<UL> |
<LI>Using CVS |
<LI><A HREF="#cvslog">Logging in and out (cvs login; cvs logout)</A> |
<UL> |
<LI><A HREF="#cvsget">Getting files (cvs update -d)</A> |
<LI>Logging in and out (cvs login; cvs logout) |
<LI><A HREF="#cvsupdate">Updating files (cvs update -d)</A> |
<LI>Getting files (cvs update -d) |
<LI><A HREF="#cvssave">Saving files (cvs commit)</A> |
<LI>Updating files (cvs update -d) |
<LI><A HREF="#cvsadd">Adding files (cvs add)</A> |
<LI>Saving files (cvs commit) |
<LI><A HREF="#cvsadddir">Adding directories (cvs add/import)</A> |
<LI>Adding files (cvs add) |
<LI><A HREF="#cvsnotsure">What to do when you're not sure about your files (cvs update)</A> |
<LI>Adding directories (cvs add/import) |
|
<LI>What to do when you're not sure about your files (cvs update) |
|
</UL> |
</UL> |
<LI>Viewing the software (make HTML) |
<LI><A HREF="#makeHTML">Viewing the software (make HTML)</A> |
<LI>Compiling the software (make build) |
<LI><A HREF="#makebuild">Compiling the software (make build)</A> |
<LI>Adding/removing files from the LON-CAPA installation (doc/loncapafiles/loncapafiles.html) |
<LI><A HREF="#loncapafiles">Adding/removing files from the LON-CAPA installation (doc/loncapafiles/loncapafiles.html)</A> |
<LI>Configurable files versus non-configurable files |
<LI><A HREF="#configversusnonconfig">Configurable files versus non-configurable files</A> |
<LI>Updating the non-configurable files on your machine (make install) |
<LI><A HREF="#makeinstall">Updating the non-configurable files on your machine (make install)</A> |
<LI>Updating the configurable files on your machine (make configinstall) |
<LI><A HREF="#makeconfiginstall">Updating the configurable files on your machine (make configinstall)</A> |
<LI>Building RPMs (make RPM) |
<LI><A HREF="#makeRPM">Building RPMs (make RPM)</A> |
|
</OL> |
|
|
|
<OL> |
|
<A NAME="Using_CVS"> |
|
<LI><H2>Using CVS</H2> |
|
<UL> |
|
<LI><A NAME="cvslog"> |
|
<H3>Using CVS: Logging in and out (cvs login; cvs logout)</H3> |
|
<LI><A NAME="cvsget"> |
|
<H3>Using CVS: Getting files (cvs update -d)</H3> |
|
<LI><A NAME="cvsupdate"> |
|
<H3>Using CVS: Updating files (cvs update -d)</H3> |
|
<LI><A NAME="cvssave"> |
|
<H3>Using CVS: Saving files (cvs commit)</H3> |
|
<LI><A NAME="cvsadd"> |
|
<H3>Using CVS: Adding files (cvs add)</H3> |
|
<LI><A NAME="cvsadddir"> |
|
<H3>Using CVS: Adding directories (cvs add/import)</H3> |
|
<LI><A NAME="cvsnotsure"> |
|
<H3>Using CVS: What to do when you're not sure about your files (cvs update)</H3> |
</UL> |
</UL> |
|
<LI><A NAME="makeHTML"> |
|
<H2>Viewing the software (make HTML)</H2> |
|
<STRONG>Commands</STRONG> |
|
<FONT COLOR="#008800"> |
|
<PRE> |
|
cd loncom/build |
|
rm -Rf HTML <I>(or alternatively, "make clean")</I> |
|
make HTML |
|
cd HTML |
|
<I>(look at the index.html file with a web browser such as Netscape)</I> |
|
</PRE> |
|
</FONT> |
|
<STRONG>General description of what happens</STRONG> |
|
<P> |
|
This is the actual make target code. |
|
<FONT COLOR="#880000"> |
|
<PRE> |
|
<!-- LONCAPA MAKETARGET=HTML START --> |
|
HTML: |
|
install -d HTML |
|
cp ../../doc/loncapafiles/*.gif HTML |
|
perl parse.pl ../../doc/loncapafiles/loncapafiles.html HTML > HTML/index.html |
|
<!-- LONCAPA MAKETARGET=HTML END --> |
|
</PRE> |
|
</FONT> |
|
What basically happens is that specially marked-up data in the LON-CAPA |
|
cvs repository file <TT>doc/loncapafiles.html</TT> is parsed into a more |
|
viewable format by <TT>loncom/build/parse.pl</TT>. The resulting |
|
file gives a very well organized view of all the files, directories, |
|
links, ownerships, permissions, and brief documentation of what each |
|
file does. |
|
</P> |
|
<LI><A NAME="makebuild"> |
|
<H2>Compiling the software (make build)</H2> |
|
<STRONG>Commands</STRONG> |
|
<FONT COLOR="#008800"> |
|
<PRE> |
|
cd loncom/build |
|
rm -Rf HTML <I>(or alternatively, "make clean")</I> |
|
make HTML |
|
cd HTML |
|
<I>(look at the index.html file with a web browser such as Netscape)</I> |
|
</PRE> |
|
</FONT> |
|
<STRONG>General description of what happens</STRONG> |
|
<P> |
|
This is the actual make target code. |
|
<FONT COLOR="#880000"> |
|
<PRE> |
|
<!-- LONCAPA MAKETARGET=HTML START --> |
|
build: |
|
perl parse.pl ../../doc/loncapafiles/loncapafiles.html build > Makefile.build |
|
make -f Makefile.build all |
|
<!-- LONCAPA MAKETARGET=HTML END --> |
|
</PRE> |
|
</FONT> |
|
<TT>loncom/build/parse.pl</TT> reads in all the build information out |
|
of <TT>doc/loncapafiles/loncapafiles.html. A new Makefile named |
|
<TT>loncom/build/Makefile.build</TT> is dynamically constructed. |
|
This dynamically generated Makefile is then run to build/compile |
|
all the software targets from source. This currently takes 10 minutes |
|
(depends on the speed of the machine you compile with). |
|
</P> |
|
<STRONG>Example</STRONG> |
|
<P> |
|
Here is information for one file <TT>tth.so</TT> provided in |
|
<TT>doc/loncapafiles/loncapafiles.html</TT>. |
|
<FONT COLOR="#660033"> |
|
<PRE> |
|
<BR><METAGROUP> |
|
<BR><LONCAPA TYPE=LOCATION DIST="redhat6.2" SOURCE="loncom/modules/TexConvert/tthperl/tth.so" TARGET="usr/lib/perl5/site_perl/5.005/tth.so" CATEGORY="system file"> |
|
<BR><DESCRIPTION> |
|
<BR>shared library file for dynamic loading and unloading of TeX-to-HTML functionality |
|
<BR></DESCRIPTION> |
|
<BR><BUILD> |
|
<BR>loncom/modules/TexConvert/tthperl/commands |
|
<BR></BUILD> |
|
<BR><DEPENDENCIES> |
|
<BR>../tthdynamic/tthfunc.c |
|
<BR>../ttmdynamic/ttmfunc.c |
|
<BR></DEPENDENCIES> |
|
</PRE> |
|
</FONT> |
|
<TT>loncom/build/parse.pl</TT> sees the <B>BUILD</B> tags and sets up |
|
a dynamic file <TT>Makefile.build</TT> to run the command inside the |
|
<B>BUILD</B> tags (currently, <B>DEPENDENCIES</B> is not used for anything |
|
besides documentation). |
|
</P> |
|
<P> |
|
Here is an example of a dynamically generated <TT>Makefile.build</TT> |
|
that builds two LON-CAPA files (one of which is <TT>tth.so</TT>. |
|
<FONT COLOR="#660033"> |
|
<PRE> |
|
all: ../homework/caparesponse/capa.so ../modules/TexConvert/tthperl/tth.so |
|
|
|
../homework/caparesponse/capa.so: ../homework/caparesponse/caparesponse.c ../ho |
|
mework/caparesponse/caparesponse.pm alwaysrun |
|
cd ../homework/caparesponse/; sh ./commands |
|
|
|
../modules/TexConvert/tthperl/tth.so: ../modules/TexConvert/tthperl/../tthdynam |
|
ic/tthfunc.c ../modules/TexConvert/tthperl/../ttmdynamic/ttmfunc.c |
|
cd ../modules/TexConvert/tthperl/; sh ./commands |
|
|
|
alwaysrun: |
|
</PRE> |
|
</FONT> |
|
</P> |
|
<LI><A NAME="loncapafiles"> |
|
<H2>Adding/removing files from the LON-CAPA installation (doc/loncapafiles/loncapafiles.html)</H2> |
|
<LI><A NAME="configversusnonconfig"> |
|
<H2>Configurable files versus non-configurable files</H2> |
|
<LI><A NAME="makeinstall"> |
|
<H2>Updating the non-configurable files on your machine (make install)</H2> |
|
<LI><A NAME="makeconfiginstall"> |
|
<H2>Updating the configurable files on your machine (make configinstall)</H2> |
|
<LI><A NAME="makeRPM"> |
|
<H2>Building RPMs (make RPM)</H2> |
|
</OL> |