Sunday, November 16, 2008

Installing CVS under Ubuntu 8.10

My experience installing CVS server on Ubuntu 8.10 Desktop
CVS version: 1.12.13
CVSD version: 1.0.15

Quick reference:

##########################################################################
# Installation
##########################################################################
# Install CVS
sudo apt-get install cvs

# Alternative install (RPM to DEB)
# Go to: ftp://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-linux/RPMS/i386/
# Download the latest RPM, save to ~/Desktop/
# Convert to DEB and install
# Summary of instructions from: http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/
#sudo apt-get update
#sudo apt-get install alien
#sudo alien -k name-of-rpm-file.rpm
#sudo dpkg -i name-of-deb-file.deb

# To remove CVS
#apt-get remove --purge cvsd

# Install CVS server
sudo apt-get install cvsd

##########################################################################
# Server Setup
##########################################################################
# Create root for repository
sudo cvsd-buildroot /usr/local/cvsroot/

# Create cvs group
groupadd cvs

# Give cvs group the ownership of the repository
sudo chown -R root:cvs /usr/local/cvsroot

# Set permissions so that the files created by the group remain
# in its ownership
# Note: until this command was run I could not execute the init
# due to permission problems
sudo chmod -R g+srw /usr/local/cvsroot/

# Initialize repository (creates empty repository in the root)
# /usr/local/cvsroot/CVSROOT/ admin folder will be created
cvs -d /usr/local/cvsroot init

# Add users to to cvs group.
# Note: to add user using gui, run sudo users-admin or
# access Users and Groups via System->Administration.
# Unclock the changes, modify the group and check desired users
sudo usermod -G cvs lomtik

##########################################################################
# Initial check in, check out, commit and release
# Eg project: ~/work/sample_project/ has file hello.c
##########################################################################
# Add CVSROOT environment variable
# In sh/bash, add the following lines to .profile/.bashrc:
CVSROOT=/usr/local/cvsroot
export CVSROOT
# In csh/tcl, add the following lines to .cshrc/.tcshrc:
#setenv CVSROOT /usr/local/cvsroot

# First check in
# Check in files from the current directory to sample_project folder
# with vendor lomtik and initialtag sample_proj_v_1_0
cd ~/work/sample_project/
# Note new directory: /usr/local/cvsroot/sample_project
cvs import -m "initial check in" sample_project lomtik sample_proj_v_1_0

# Move files from current directory to a temporary folderand check out
# their version from the repository
mv ~/work/sample_project/hello.c ~/work/temp/
cvs checkout sample_project

#
# Modify hello.c
#

# Commit/Check in the changes
cvs commit -m "Added changes to the file" hello.c

# Release the module
# After commit, the changes are synched with the vault. However,
# cvs does not lock the local files. Thus, either manually delete
# files or run release command to let cvs to check whether something
# has been changed since the last commit.
# Note: run from above dir
# Note: -d deletes the file
cd..
cvs release -d hello.c

##########################################################################
# Revisions
# http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_4.html#SEC44
##########################################################################

##########################################################################
# Notes
##########################################################################
# Repository directories relative to repository look can be found in:
# /etc/cvsd/cvsd.conf
# i.e. Repos /cvsrepo
# Repos /demo

# Things to look at:
# jCVS - GUI
# VC package for emacs

# CVS Space usage:
# 3 x single repository size or
# num_developers x single repository size

# Ideas:
# Setup VM with repository (can use pre-built images)
# Use free VM Player on any system for portability

# Rereferences:
# CVS Manual: http://ximbiot.com/cvs/manual/cvs-1.11.23/cvs_toc.html#SEC_Contents
# Quick Ubuntu, but incomplete: http://www.markcasimer.com/2006/06/12/InstallingCVSOnUbuntu.aspx
# Quick Ubuntu, missing details and group permission setup: http://sanatio.blogspot.com/2005/12/cvs-server-on-ubuntu.html
# Good guide, not for Ubuntu: http://rimuhosting.com/howto/cvs.jsp
# CVS RPMs: ftp://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-linux/RPMS/i386/
# Installing from RPM: http://ubuntu.wordpress.com/2005/09/23/installing-using-an-rpm-file/

1 comment:

zooplah said...

The problem with Ubuntu's CVS is that they use the 1.12 "features" branch instead of the 1.11 "stable" branch. The two aren't compatible with each other (many times, using the 1.12.x client just hangs indefinitely, and Mozilla in particular advises against using it). 1.11.23 is also much newer, from May; 1.12.13 dates back to 2006. I compiled it myself, but I'm weird that way. (It should be noted that one thing I do like about the 1.12 series is that you can send a configure option to set up your default RSH client.)

CVS is pretty much dead. They stated so explicitly a few years ago. That's basically why Subversion was started in the started: to create a virtual clone that's maintainable and doesn't have the warts of CVS. CVS dying has opened a can of worms, now that everyone and his brother has their own VCS. I use Subversion and think it is better than CVS in many ways (less cryptic, fewer misfeatures, etc.), but I've considered going back to CVS just to make a statement against the plethora of version control systems (especially the countless distributed systems that are nothing but a nuisance to people like me that don't want a whole repository, but just the latest and greatest version of certain software).