version 1.11, 2001/01/17 12:49:33
|
version 1.14, 2001/01/17 13:43:26
|
Line 5
|
Line 5
|
</HEAD> |
</HEAD> |
<BODY> |
<BODY> |
<H1>LON-CAPA Software Developer Instructions</H1> |
<H1>LON-CAPA Software Developer Instructions</H1> |
|
<BR><I>Written by Scott Harrison, January 17, 2001</I> |
|
<BR><I>Last updated, January 17, 2001</I> |
<OL> |
<OL> |
<LI><A HREF="#Using_CVS">Using CVS</A> |
<LI><A HREF="#Using_CVS">Using CVS</A> |
<UL> |
<UL> |
Line 91 make build
|
Line 92 make build
|
This is the actual make target code. |
This is the actual make target code. |
<FONT COLOR="#880000"> |
<FONT COLOR="#880000"> |
<PRE> |
<PRE> |
<!-- LONCAPA MAKETARGET=HTML START --> |
<!-- LONCAPA MAKETARGET=build START --> |
build: |
build: |
perl parse.pl ../../doc/loncapafiles/loncapafiles.html build > Makefile.build |
perl parse.pl ../../doc/loncapafiles/loncapafiles.html build > Makefile.build |
make -f Makefile.build all |
make -f Makefile.build all |
<!-- LONCAPA MAKETARGET=HTML END --> |
<!-- LONCAPA MAKETARGET=build END --> |
</PRE> |
</PRE> |
</FONT> |
</FONT> |
<TT>loncom/build/parse.pl</TT> reads in all the build information out |
<TT>loncom/build/parse.pl</TT> reads in all the build information out |
Line 152 alwaysrun:
|
Line 153 alwaysrun:
|
<LI><A NAME="loncapafiles"> |
<LI><A NAME="loncapafiles"> |
<H2>Adding/removing files from the LON-CAPA installation (doc/loncapafiles/loncapafiles.html)</H2> |
<H2>Adding/removing files from the LON-CAPA installation (doc/loncapafiles/loncapafiles.html)</H2> |
<STRONG>To add and remove (and alter)</STRONG> |
<STRONG>To add and remove (and alter)</STRONG> |
|
<P> |
All that you have to do to alter the behavior of the installation is |
All that you have to do to alter the behavior of the installation is |
edit a single file (<TT>doc/loncapafiles/loncapafiles.html</TT>). |
edit a single file (<TT>doc/loncapafiles/loncapafiles.html</TT>). |
Adding, removing, and altering files requires proper attention |
Adding, removing, and altering files requires proper attention |
to the syntax of file format of course. |
to the syntax of file format of course. |
|
</P> |
<STRONG>File Format</STRONG> |
<STRONG>File Format</STRONG> |
<P> |
<P> |
The preceding <A HREF=#"makebuild">"make build"</A> documentation |
The preceding <A HREF=#"makebuild">"make build"</A> documentation |
Line 248 combination has been working very effici
|
Line 251 combination has been working very effici
|
</P> |
</P> |
<LI><A NAME="configversusnonconfig"> |
<LI><A NAME="configversusnonconfig"> |
<H2>Configurable files versus non-configurable files</H2> |
<H2>Configurable files versus non-configurable files</H2> |
|
<STRONG>Machine-specific information is the difference</STRONG> |
|
<P> |
|
The current list of configurable files for the LON-CAPA system is |
|
/etc/httpd/access.conf, /etc/smb.conf, /etc/ntp.conf, /etc/krb.conf, |
|
/etc/atalk/config, /etc/ntp/step-tickers, |
|
/home/httpd/html/res/adm/includes/copyright.tab, |
|
/home/httpd/html/res/adm/includes/un_keyword.tab, |
|
/home/httpd/hosts.tab, and |
|
/home/httpd/spare.tab. |
|
</P> |
|
<P> |
|
All of these configurable files contain machine-specific information. |
|
For instance, the LON-CAPA system relies on unique host IDs such |
|
as msua3, s1, s2, msul1, and 103a1 (specified as a "PerlSetVar lonHostID" |
|
field within /etc/httpd/access.conf). |
|
Non-configurable files simply do NOT have machine-specific information. |
|
<STRONG>The impact on updating software</STRONG> |
|
<P> |
|
What this means in terms of software updating is that |
|
<UL> |
|
<LI>non-configurable files can be simply overwritten with newer versions |
|
(without "anything" else to worry about), |
|
<LI>and configurable files must follow these steps to be safely overwritten |
|
<OL> |
|
<LI>have their machine specific information saved, |
|
<LI>be overwritten, and then |
|
<LI>have their machine specific information restored. |
|
</OL> |
|
</UL> |
|
</P> |
<LI><A NAME="makeinstall"> |
<LI><A NAME="makeinstall"> |
<H2>Updating the non-configurable files on your machine (make install)</H2> |
<H2>Updating the non-configurable files on your machine (make install)</H2> |
|
<STRONG>Commands</STRONG> |
|
<FONT COLOR="#008800"> |
|
<PRE> |
|
cd loncom/build |
|
make install |
|
</PRE> |
|
</FONT> |
|
<STRONG>General description of what happens</STRONG> |
|
<P> |
|
This is the actual make target code. |
|
<FONT COLOR="#880000"> |
|
<PRE> |
|
<!-- LONCAPA MAKETARGET=install START --> |
|
install: build |
|
perl parse.pl ../../doc/loncapafiles/loncapafiles.html install > Makefil |
|
e.install |
|
make -f Makefile.install SOURCE="../.." TARGET="" directories |
|
make -f Makefile.install SOURCE="../.." TARGET="" files |
|
make -f Makefile.install SOURCE="../.." TARGET="" links |
|
<!-- LONCAPA MAKETARGET=install END --> |
|
</PRE> |
|
</FONT> |
|
For safety reasons (so as to not mess up a machine's configuration), |
|
configuration files are NOT installed during this step. This means |
|
that files such as /etc/httpd/access.conf, /etc/smb.conf, /etc/atalk/config, |
|
/home/httpd/html/res/adm/includes/copyright.tab, and |
|
/home/httpd/spare.tab are not overwritten, but remain as old, non-updated |
|
copies. (To automatically update these files and save/restore |
|
their encoded machine configuration, you must run "make configinstall"). |
|
</P> |
<LI><A NAME="makeconfiginstall"> |
<LI><A NAME="makeconfiginstall"> |
<H2>Updating the configurable files on your machine (make configinstall)</H2> |
<H2>Updating the configurable files on your machine (make configinstall)</H2> |
|
<STRONG>Commands</STRONG> |
|
<FONT COLOR="#008800"> |
|
<PRE> |
|
cd loncom/build |
|
make configinstall |
|
</PRE> |
|
</FONT> |
|
<STRONG>General description of what happens</STRONG> |
|
<P> |
|
This is the actual make target code. |
|
<FONT COLOR="#880000"> |
|
<PRE> |
|
<!-- LONCAPA MAKETARGET=configinstall START --> |
|
configinstall: |
|
# there is a dependency on having directories in place, but oh well... |
|
perl parse.pl ../../doc/loncapafiles/loncapafiles.html configinstall > Makefile.configinstall |
|
make -f Makefile.configinstall SOURCE="../.." TARGET="" configfiles |
|
perl loncaparestoreconfigurations lasttimestamp |
|
make -f Makefile.configinstall TARGET="" configpermissions |
|
<!-- LONCAPA MAKETARGET=configinstall END --> |
|
</PRE> |
|
</FONT> |
|
Configuration files are installed during this step. This means |
|
that files such as /etc/httpd/access.conf, /etc/smb.conf, /etc/atalk/config, |
|
/home/httpd/html/res/adm/includes/copyright.tab, and |
|
/home/httpd/spare.tab are overwritten. Before being overwritten, |
|
a backup copy is made though. Information is read out of these |
|
backup copies and restored to the new files by the |
|
<TT>loncaparestoreconfigurations</TT> script. To ensure that |
|
new file permissions and ownerships are installed, a final set of |
|
<TT>chown</TT> and <TT>chmod</TT> commands are called upon all |
|
the configuration files. |
|
</P> |
|
<STRONG>For the truly paranoid</STRONG> |
|
<P> |
|
If you are truly paranoid, you can just make the |
|
<TT>Makefile.configinstall</TT> file and then save, copy, |
|
and restore all the configuration values yourself. |
|
<TT>loncaparestoreconfigurations</TT> is pretty smart though, has yet to |
|
fail, and besides, a backup copy is always made (time-stamped so that backup |
|
copies are not overwritten). |
|
</P> |
<LI><A NAME="makeRPM"> |
<LI><A NAME="makeRPM"> |
<H2>Building RPMs (make RPM)</H2> |
<H2>Building RPMs (make RPM)</H2> |
|
<STRONG>Commands</STRONG> |
|
<FONT COLOR="#008800"> |
|
<PRE> |
|
cd loncom/build |
|
rm -Rf BinaryRootL <I>(or alternatively, "make clean")</I> |
|
make RPM |
|
<I>(to subsequently install, you can type commands like |
|
"rpm -Uvh --force LON-CAPA-base-3.1-1.i386.rpm") |
|
</PRE> |
|
</FONT> |
|
</P> |
|
<STRONG>WARNING!!!!!!!!!!!!!!</STRONG> |
|
<P> |
|
Never never never never never manually install the |
|
LON-CAPA-setup-3.1-1.i386.rpm. This RPM is meant to only be |
|
installed by the CD installation process (it wipes out |
|
the existing /etc/passwd file). |
|
</P> |
|
<STRONG>Configuration files</STRONG> |
|
<P> |
|
Configuration files are automatically saved with the file suffix |
|
".rpmsave". So <TT>/etc/httpd/conf/access.conf</TT> is saved as |
|
<TT>/etc/httpd/conf/access.conf.rpmsave</TT>. You can restore |
|
the machine-specific configuration information by running |
|
the <TT>/usr/sbin/loncaparestoreconfigurations</TT>. However, |
|
a <B>warning</B> is important here. If you install an RPM twice |
|
without restoring your configuration, you will overwrite the |
|
".rpmsave" files. |
|
</P> |
|
<STRONG>General description of what happens</STRONG> |
|
<P> |
|
This is the actual make target code. |
|
<FONT COLOR="#880000"> |
|
<PRE> |
|
<!-- LONCAPA MAKETARGET=RPM START --> |
|
RPM: BinaryRoot |
|
cat base_file_list.txt | perl make_rpm.pl base 3.1 '' '' BinaryRoot |
|
cat setup_file_list.txt | perl make_rpm.pl setup 3.1 '' '' BinaryRoot |
|
|
|
BinaryRoot: |
|
perl parse.pl ../../doc/loncapafiles/loncapafiles.html BinaryRoot |
|
<!-- LONCAPA MAKETARGET=RPM END --> |
|
</PRE> |
|
</FONT> |
|
A <TT>BinaryRoot</TT> directory is generated that reflects the locations, |
|
ownerships, permissions, and contents for all the CVS source |
|
files, compiled binaries, directories, and links as they should eventually |
|
occur on the '/' filesystem location. |
|
</P> |
|
<P> |
|
<TT>loncom/build/make_rpm.pl</TT> is robust (tested over the |
|
span of months) and, unlike other automated RPM-builders, cleanly |
|
builds new RPMs without any after-effect of temporary files left |
|
on the system. (On the negative side, there are a number of |
|
LON-CAPA specific customizations inside make_rpm.pl which, for |
|
the sake of reusability, should eventually be removed). Two new RPMs |
|
are generated: LON-CAPA-base-3.1-1.i386 and LON-CAPA-setup-3.1-1.i386.rpm |
|
(again, never manually install LON-CAPA-setup-3.1-1.i386.rpm). |
|
</P> |
</OL> |
</OL> |
</BODY> |
</BODY> |
</HTML> |
</HTML> |
|
|
|
|
|
|
|
|