2.1. Installing CVS
CVS is client/server software that runs on Unix and Linux platforms, including Mac OS X. The CVSNT program is a CVS-like server that runs on Windows, and there are CVS clients for Windows, Mac (including pre-OS X Macintosh), Linux, and Unix. When you install CVS on a Unix/Linux server, you automatically get both server and client software. To access CVS across the network from any Unix/Linux machine, install CVS on the machine in question. The server and (command-line) client software are one and the same.
CVS is available from http://cvs.nongnu.org. It is also available as an installation package with many GNU/Linux distributions, including Debian, Red Hat, and SUSE.
A Windows-compatible CVS server is available at http://www.cvsnt.org. This server is not identical to the Unix server, but the differences are clearly listed in the CVS NT FAQ, and an installation guide is available on its web site.
2.1.1. Is CVS Installed?
If you are running Mac OS X, Cygwin, Unix, or Linux, you may already have CVS installed. If it's installed and in your path, typing cvs at the command line produces the results shown in Example 2-1.
Example 2-1. CVS help display
If you already have CVS installed, you can skip this section and jump ahead to "Building Your First Repository."
2.1.2. Graphic User Interfaces
If you prefer GUI clients, I recommend a visit to http://www.wincvs.org. There you'll find gCVS, WinCVS, and MacCVS, which are GUI clients for Unix and GNU/Linux, Windows, and Macintosh (pre-OS X), respectively.
A list of additional GUI clients is available in the CVS Wiki (http://ximbiot.com/cvs/wiki/index.php?title=CVS_Clients).
2.1.3. Secure Shell
If you plan to use CVS over a network, I recommend using the Secure Shell (SSH) protocol to establish secure connections between clients and server. You must install compatible versions of SSH on your client and server machines. For clients, you may need to find a version of SSH that can be used from the command line. See "Accessing Remote Repositories" later in this chapter for more information on this topic.
The OpenSSH web site (http://www.openssh.com) is a good starting point for information on SSH and SSH clients. You may also want to read SSH, The Secure Shell: The Definitive Guide, by Daniel J. Barrett et al. (O'Reilly). For more than you ever wanted to know about SSH, see the FAQ at http://www.openssh.org/faq.html. The Google list of SSH documentation is at http://directory.google.com/Top/Computers/Internet/Protocols/SSH/Documentation/.
Most Unix and Linux systems have an SSH client installed as part of the standard set of programs. Mac OS X also comes with an SSH client preinstalled. If it is not installed automatically, an SSH client is usually available in your distribution as an optional program.
The web site for MacCVS has a useful article on SSH for pre-OS X Macintosh users at http://www.heilancoo.net/MacCVSClient/MacCVSClientDoc/ssh-classic.html. The instructions are useful regardless of which Macintosh CVS client you use.
To find an SSH client for Windows, start from the OpenSSH web site on Windows clients (http://www.openssh.com/windows.html).
Once you have installed SSH on both the server and the client computers, generate keys for the clients and add their public keys to the server. This step lets your users run CVS without needing to give their password for every command.
2.1.4. Installing CVS with a Package Manager
The easiest way to install CVS under GNU/Linux is with a package manager such as YaST, GnoRPM, Kpackage, or Synaptic. In all of the package managers that I'm familiar with, the package name is either cvs or cvs followed by some punctuation and a version number. Figures 2-1 and 2-2 are screenshots of the installation with package managers, and show which menu CVS can be found in. Find and select CVS, and then click on the Install or OK button, as appropriate.
Figure 2-1. CVS installation with Synaptic
Figure 2-2. CVS installation with Fedora
The second easiest way to install CVS on GNU/Linux is using a command-line package manager. If you're using apt (Debian, Ubuntu, and Mac OS X users who are running Fink), log in as root and use the command apt-get install cvs. apt will find the most recent version in its sources list. If using yum, the command is yum install cvs. Examples 2-2 and 2-3 show an apt and a yum installation.
Example 2-2. CVS installation with apt
Example 2-3. CVS installation with yum
2.1.5. Installing and Building CVS from Source
Download the compressed .tar file from http://cvs.nongnu.org. Decompress and unarchive the file. If you intend to keep the source after you compile it, unzip the compressed .tar file into /usr/src/cvs. Otherwise, you can decompress and unarchive it into /tmp. Next, cd into the cvs directory, read the INSTALL and README files, and run the commands there. I recommend that novice users disable automake and autoconf. (In CVS 1.12.1 and later, autoconf and automake are disabled by default.)
Example 2-4 shows a sample installation from source. In this example, I decompress and unarchive the .tar file into /tmp and change directory into the top level of the resulting source tree. As I'm using a later version than 1.12.1, I don't need to disable automake and autoconf. The next steps described in INSTALL for CVS 1.12.9 are to run the configure script provided and then, if that exits successfully, run make, switch to the root user, and run make install.
Example 2-4. Installing from source