CVS and CVSWEB Installation - Linux and (possibly) UNIX

23 Mar 2004 16:51

Using CVS

CVSWrappers

CVS Installation on Windows

Open Source Development with CVSCvs Pocket ReferenceEssential CVS


Introduction

These instructions describe setting up a CVS server.  Typical users of CVS do not need to read these instructions.


Windows Version (CVSNT)

Click here for installing the Windows version.  The following instructions are for Linux.


Are your Files in WinCVS Marked "Modified" (Red) Incorrectly?

This is the WinCVS DST bug.


SSH Clients for Windows

[UNI]+X -based CVS servers can support the SSH protocol.  These instructions discuss installing the pserver protocol but SSH support isn't hard to set up.  You can look for a Windows SSH client here.


Repository Location

The CVS repository is installed in the directory /cvs.  These instructions assume you are using Linux.  If not, the instructions can be easily adapted to your flavor of UNIX.  cvs version 1.10 does not have NT friendly version of pserver.

All CVS interaction occurs via the cvs client/server gateway called pserver.  pserver allows source code to be managed in an environment that is independent of the clients that access it.  For example, when files are checked in, a message is posted to the engineering.checkins newsgroup.  Without pserver, we would be at the mercy of clients installing special tools (e.g., Perl) that allow CVS to post messages to newsgroups. 


Optional Software To Install

  • Samba
  • Apache (for CVSWeb or ViewCVS)
  • Development tools such as gcc, make, and CVS (most distributions come with CVS)

Installing CVS

CVS pserver allows source code to be retrieved and modified without access to a file system.  It may be more reliable and faster than using the file system on slow network connections.

There are more administrative information regarding pserver.

  1. Log in as root
  2. Create a user account called cvs
  3. Enter: ctlinnd newgroup engineering.checkins
    • This is optional, you can have the script send emails instead
  4. Add the following line to /etc/news/expire.ctl:
    engineering.checkins:A:1:90:never
    The messages will expire after 90 days.
  5. Install CVS.  Linux installs CVS if you select it as an option.  Note: CVS 1.10.6 has bugs with pserver.
    • Get CVS here
    • gunzip cvs.tar.gz
      tar -xf cvs.tar

      ./configure (see the README file)
      make
      make install
  6. Extract perl.tar.gz and perl_lib.tar.gz as described in the machine configuration
  7. Enter: mkdir /ext1/cvs
  8. Enter: chgrp cvs /ext1/cvs
  9. Enter: chown cvs /ext1/cvs
  10. Enter: ln -s /ext1/cvs /cvs
  11. Enter: chgrp cvs /cvs
  12. Enter: chown cvs /cvs
  13. Edit /etc/inetd.conf.  Add the line
    cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/cvs pserver
  14. Make sure /etc/services contains the line
    cvspserver 2401/tcp
  15. Enter: killall -HUP inetd
  16. To test, go to your home directory and enter:
    cvs -d :pserver:cvs@tiger:/cvs login
    cvs -d :pserver:cvs@tiger:/cvs co .
  17. Consult the loginfo, taginfo, and notify scripts page
  18. Copy cvsignore  to c:\sandbox\CVSROOT
    • This is optional
    • This file contains a list of file extensions that I recommend you don't store in the repository
    • For example, this file causes the cvs stat command to ignore OBJ files instead of telling you that the files aren't checked in.  Nice feature.
    • You can force CVS to ignore this file via cvs add, and WinCVS's "import" command always ignores it
    • Change the current directory to c:\sandbox\CVSROOT
  19. Enter cvs add cvsignore
  20. Enter cvs commit
    Congratulations!  You just committed your first changes!
  21. [optional] Make /cvs accessible via Samba so that Windows machines can access the source code tree as \\tiger\cvs. Generally, to perform backups -- See Samba Tips
  • Edit /etc/smb.conf
    • Set workgroup =
    • Set domain controller =
    • Set security = share
    • Add the following text to the bottom of the file
      [cvs]
      path=/cvs
      writable = no
      printable = no
      browseable = yes
      public = yes
  • Enter: /etc/rc.d/init.d/smb stop
  • Enter: /etc/rc.d/init.d/smb start
  • Make sure you can see the directory via Windows -- \\tiger\cvs
  • Add /etc/rc.d/init.d/smb start to /etc/rc.d/rc.local

Troubleshooting

Problem Solution
When checking in files, you get the error
NNTPERROR: 500 "POST" not implemented; try "help".
As root, change cfgmgmt/Globals.xml which is located in one of your Perl library directories (execute perl -V for a listing) and set NNTPServer to the IP address of the news server.
Error --allow-root not specified when logging into CVS.
As root, edit /etc/inetd.conf and add another --allow-root=/cvs entry.

 

NNTP server isn't responding As root, execute

/etc/rc.d/init.d/innd stop
/etc/rc.d/init.d/innd start

Make sure /etc/rc.d/rc.local contains the line /etc/rc.d/init.d/innd start

"notify" / "commit" emails aren't received

More often than not, the problem is that the c:\perl\lib\cfgmgmt\globals.xml file doesn't have the correct SMTP server setting.  You can test this by running:

cvs_notify.pl youremail@yourdomain

and pressing control-Z, which is the end-of-file character for Windows (use control-D for UNIX).

If the SMTP server can not be contacted you'll see the following error message:

Can't call method "mail" on an undefined value at cvs_notify.pl line 20

 

Adding New Developers

  • Log in to tiger as root and add the user via:
    /usr/sbin/useradd username
  • Edit /etc/passwd and assign the user to cvs's UID (e.g., 500):
    buildmaster:x:509:500::/home/buildmaster:/bin/bash

Installing CVSWEB

cvsweb is a feature-rich web-based application written in Perl by Henner Zeller.

  1. Save cvsweb to /home/httpd/cgi-bin