Mozilla's webtool projects - lxr and bonsai - can be used to present CVS contents and activity online. They are used with great success for instance, by GNOME and Mozilla itself. They allow you to:
Greg Leblanc's instructions are still up-to-date, so there is no need to repeat them here.
In particular, you do still need to apply this patch. It seems to have been ignored by the maintainers because it's not needed for mozilla itself.
And it's easy not to notice that lxr should be set up to index the checked-out cvs code. Of course you need to keep checking it out if you expect the web pages to stay up-to-date - see the next section.
You need to copy the registry module to your html directory, next to your lxr and bonsai directories. These cgi scripts are used by some bonsai links to show the files contents.
You will need to add a <Directory> section to your httpd.conf file, like the existing sections for lxr and bonsai.
The default bonsai installation expects lxr to be at http://lxr.mozilla.org. To change it, go to /bonsai/admin.cgi in your browser, and click on the "edit bonsai operating parameters" link. Change the lxr_base property to something like http://cvs.something.com/lxr/source.
You really do need to read the bonsai INSTALL file, which explains about adding a line to CVSROOT/loginfo to run a script that sends an email to an email alias (added to /etc/aliases), which runs a script in bonsai to update the database.
However, on RedHat 7.2 at least, this will fail because smsrh (SendMail Restricted SHell), will prevent you from running aribitrary scripts. Fix this by just adding a symlink in /etc/smrsh/. For instance:
# ln -s /var/www/html/bonsai/handleCheckinMail.pl /etc/smrsh/handleCheckinMail.pl
My thanks to David Miller for his help with this.
People seem to use cron scripts to make sure that lxr indexes a current checkout of the source code from cvs. I'm no expert in cron scripts, and I haven't seen any body else's scripts, but the following seem to work for me. By all means email me your criticisms or improvements.
I'm using RedHat 7.2, which has handy /etc/cron.daily and /etc/cron.hourly directories. I just had to put the scripts in those directories for them to be run daily and hourly. Your system might be different and possibly more difficult.
cvs checkout
So that the lxr web pages show the current code, and so that bonsai can show up-to-date change history, you need to checkout the code regularly. I place this script in /etc/cron.hourly.
#!/bin/sh #Tell cvs to use the correct repository: export CVSROOT=:pserver:lxrcron@cvs.somedomainname.com:/cvs WEBTOOLSCVS_LXRDIR=/var/www/html/lxr WEBTOOLSCVS_LXRCHECKOUTDIR=$WEBTOOLSCVS_LXRDIR/cvs_checkout #Checkout all modules from cvs, so that lxr can index the current stuff: # . means all cd $WEBTOOLSCVS_LXRCHECKOUTDIR cvs co . #Then update them to prune any removed files: #There is probably a more efficient way to do this, in one step. cvs update -PdNotice that I am using the lxrcron cvs user name, which I created for this purpose.
For this to work, you need to do a one-off login to cvs as the lxrcron cvs user. This will put some stuff in the .cvspass file that makes login unnecessary in future. However, though cron seems to run as root, on my box, it's home directory is / rather than /root, so you need to copy the .cvspass file to /.cvspass
Generating the lxr database
So that the online list of directories and files is up-to-date, lxr needs to index the checked-out source code.
I place this script in /etc/cron.daily.
#!/bin/sh WEBTOOLSCVS_LXRDIR=/var/www/html/lxr WEBTOOLSCVS_LXRCHECKOUTDIR=$WEBTOOLSCVS_LXRDIR/cvs_checkout #Create the lxr index: cd $WEBTOOLSCVS_LXRDIR /var/www/html/lxr/genxref $WEBTOOLSCVS_LXRCHECKOUTDIR
Copyright © Murray Cumming.
