<?xml version='1.0' ?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
               "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % myvars SYSTEM "../variables.ent">
%myvars;
]>
  <appendix id="cvs-tips">
    <title>Using CVS with an OpenACS Site</title>
    
    <authorblurb>
<para>      By <ulink url="mailto:joel@aufrecht.org">Joel Aufrecht</ulink></para>
    </authorblurb>
    <formalpara id="cvs-service-import">
      <title>Add the Service to CVS - OPTIONAL</title>
      <indexterm>
        <primary>cvs</primary>
        <secondary>setup</secondary>
      </indexterm>
      <para>These steps take an existing OpenACS directory and add
          it to a <link linkend="install-cvs">CVS
          repository</link>.</para>
    </formalpara>
    <orderedlist>
      <listitem>
        <para>Create and set permissions on a subdirectory in the local cvs repository.</para>
        <screen>[root root]# <userinput>mkdir /cvsroot/<replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[root root]#<userinput> chown <replaceable>$OPENACS_SERVICE_NAME.$OPENACS_SERVICE_NAME</replaceable> /cvsroot/<replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[root root]#
<action>mkdir /cvsroot/<replaceable>$OPENACS_SERVICE_NAME</replaceable>
chown <replaceable>$OPENACS_SERVICE_NAME.$OPENACS_SERVICE_NAME</replaceable> /cvsroot/<replaceable>$OPENACS_SERVICE_NAME</replaceable></action></screen>
        </listitem>
        <listitem>
          <para>Add the repository location to the user environment.  On some systems, you may get better results with .bash_profile instead of .bashrc.</para>
          <screen>[root root]# <userinput>su - <replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$<userinput> emacs .bashrc</userinput></screen>
            <para>Put this string into <computeroutput>/home/<replaceable>$OPENACS_SERVICE_NAME</replaceable>/.bashrc</computeroutput>:</para>
            <programlisting>export CVSROOT=/cvsroot</programlisting>
            <screen>[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ <userinput>exit</userinput>
logout

[root root]#</screen>
          </listitem>
          <listitem>
            <para>Import all files into cvs.  In order to work on
            files with source control, the files must be checked out
            from cvs.  So we will import, move aside, and then check
            out all of the files.  In the cvs import command,
            <computeroutput><replaceable>$OPENACS_SERVICE_NAME</replaceable></computeroutput>
            refers to the cvs repository to use; it uses the CVSROOT
            plus this string,
            i.e.
            <computeroutput>/cvsroot/<replaceable>$OPENACS_SERVICE_NAME</replaceable></computeroutput>.
            "OpenACS" is the vendor tag, and "&cvsversiontag;" is the
            release tag.  These tags will be useful in upgrading and
            branching.  -m sets the version comment.</para>
            <screen>[root root]# <userinput>su - <replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ <userinput>cd /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ <userinput>cvs import -m "initial install" <replaceable>$OPENACS_SERVICE_NAME</replaceable> OpenACS &cvsversiontag;</userinput>
N <replaceable>$OPENACS_SERVICE_NAME</replaceable>/license.txt
N <replaceable>$OPENACS_SERVICE_NAME</replaceable>/readme.txt
<emphasis>(many lines omitted)</emphasis>
N <replaceable>$OPENACS_SERVICE_NAME</replaceable>/www/SYSTEM/flush-memoized-statement.tcl

No conflicts created by this import

[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ exit
[root root]#
<action>su - <replaceable>$OPENACS_SERVICE_NAME</replaceable>
cd /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable>
cvs import -m "initial install" <replaceable>$OPENACS_SERVICE_NAME</replaceable> OpenACS &cvsversiontag;
exit</action></screen>
            <para>Move the original directory to a temporary location, and check out the cvs repository in its place.</para>
        <screen>[root root]# <userinput>mv /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable> /var/tmp</userinput>
[root root]# <userinput>mkdir /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[root root]# <userinput>chown <replaceable>$OPENACS_SERVICE_NAME</replaceable>.<replaceable>$OPENACS_SERVICE_NAME</replaceable> /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[root root]# <userinput>su - <replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
[$OPENACS_SERVICE_NAME $OPENACS_SERVICE_NAME]$ <userinput>cd /var/lib/aolserver</userinput>
[$OPENACS_SERVICE_NAME aolserver]$ <userinput>cvs checkout <replaceable>$OPENACS_SERVICE_NAME</replaceable></userinput>
cvs checkout: Updating <replaceable>$OPENACS_SERVICE_NAME</replaceable>
U <replaceable>$OPENACS_SERVICE_NAME</replaceable>/license.txt
<emphasis>(many lines omitted)</emphasis>
U <replaceable>$OPENACS_SERVICE_NAME</replaceable>/www/SYSTEM/dbtest.tcl
U <replaceable>$OPENACS_SERVICE_NAME</replaceable>/www/SYSTEM/flush-memoized-statement.tcl
[$OPENACS_SERVICE_NAME aolserver]$ <userinput>exit</userinput>
logout

[root root]#

<action>mv /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable> /var/tmp
mkdir /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable>
chown <replaceable>$OPENACS_SERVICE_NAME</replaceable>.<replaceable>$OPENACS_SERVICE_NAME</replaceable> /var/lib/aolserver/<replaceable>$OPENACS_SERVICE_NAME</replaceable>
su - <replaceable>$OPENACS_SERVICE_NAME</replaceable>
cd /var/lib/aolserver
cvs checkout <replaceable>$OPENACS_SERVICE_NAME</replaceable>
exit</action></screen>
        </listitem>
      <listitem>
        <para>  If the service starts correctly, come back and remove the temporary copy of the uploaded files.</para>
      </listitem>
      </orderedlist>

  </appendix>
  
