Linux HOWTOs

About | Home | Search


HOWTO: cvs
Description: Concurrent Versioning System
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# CVS
# ===
# Below are the latest "stable" and "feature" releases

# Slackware 11.0 and 12.0's 'cvs' packages includes version 1.11.22


# cvs 1.11.22 (latest stable release)
# ===========
# Prerequisites:
# bison
# Perl
# csh (optional; Slack includes a 'tcsh' package)
# mktemp
# sendmail
# groff
# espgs' ps2pdf (I would imagine it comes with GNU gs too)
# texinfo's texi2dvi
# kerberos (optional)
# elvis or vim
# wget

cd
test -f installed/cvs-1.11.22.tar.bz2 && mv installed/cvs-1.11.22.tar.bz2 .
test ! -f cvs-1.11.22.tar.bz2 &&
 wget http://ftp.gnu.org/non-gnu/cvs/source/stable/1.11.22/\
cvs-1.11.22.tar.bz2

# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "f24043a640509aff1aa28871dd345762  cvs-1.11.22.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "5dfa11da84a890d7d61516fd450c001dc24bcc0d  cvs-1.11.22.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 17F231A4 > /dev/null 2>&1 || gpg --recv-keys 17F231A4 ) &&
 wget -nc http://ftp.gnu.org/non-gnu/cvs/source/stable/1.11.22/\
cvs-1.11.22.tar.bz2.sig &&
  gpg --verify cvs-1.11.22.tar.bz2.sig && rm cvs-1.11.22.tar.bz2.sig

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cvs-*" -exec rm -r {} \;
tar xjvf ~/cvs-1.11.22.tar.bz2
cd cvs-1.11.22
test $UID = 0 && chown -R root:root .

# If you don't plan on setting up your copy of CVS to be a server, add
# --disable-server to the configure line.

./configure --prefix=/usr
make
su -c "test -x /sbin/removepkg && /sbin/removepkg cvs ; make install"
cd
mkdir -p -m 0700 installed
rm -f installed/cvs-*.tar.*
mv cvs-1.11.22.tar.bz2 installed/

# If you want to set up a local CVS repository, skip down to the bottom


# cvs 1.12.13 (latest feature release)
# ===========
# Prerequisites:
# <should be the same as above>

cd
test -f installed/cvs-1.12.13.tar.bz2 && mv installed/cvs-1.12.13.tar.bz2 .
test ! -f cvs-1.12.13.tar.bz2 &&
 wget http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/\
cvs-1.12.13.tar.bz2

# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "956ab476ce276c2d19d583e227dbdbea  cvs-1.12.13.tar.bz2" | md5sum -c

# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "93a8dacc6ff0e723a130835713235863f1f5ada9  cvs-1.12.13.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 17F231A4 > /dev/null 2>&1 || gpg --recv-keys 17F231A4 ) &&
 wget -nc http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/\
cvs-1.12.13.tar.bz2.sig &&
 gpg --verify cvs-1.12.13.tar.bz2.sig && rm cvs-1.12.13.tar.bz2.sig

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "cvs-*" -exec rm -r {} \;
tar xjvf ~/cvs-1.12.13.tar.bz2
cd cvs-1.12.13
test $UID = 0 && chown -R root:root .

# If you don't plan on setting up your copy of CVS to be a server, add
# --disable-server to the configure line.

./configure --prefix=/usr
make
su -c "test -x /sbin/removepkg && /sbin/removepkg cvs ; make install"
cd
mkdir -p -m 0700 installed
rm -f installed/cvs-*.tar.*
mv cvs-1.12.13.tar.bz2 installed/


# If you want to just use cvs to get files from elsewhere, you're done.
# Otherwise, continue below to set up a local CVS repository.

# I use /cvs below, so you'll need to be root to do that, but you don't have
# to use /cvs...
su

# Set the CVSROOT environment variable to where your source repository will
# be.  Here we use /cvs, but it can be anywhere you like.
test -z "$CVSROOT" && export CVSROOT=/cvs
test -d /etc/profile.d &&
 echo '#!/bin/sh' > /etc/profile.d/cvs.sh &&
 echo "export CVSROOT=/cvs" >> /etc/profile.d/cvs.sh &&
 chmod +x /etc/profile.d/cvs.sh
test ! -d /etc/profile.d &&
 echo "export CVSROOT=/cvs" >> /etc/profile

# Create a directory for the repository:
mkdir -p /cvs

# Create the repository:
cvs init

# From here on, do everything as a non-root user.  Either (as root) fix
# the permissions of /cvs so the non-root user can write to it, or create
# a project as root, then fix the permissions of the project's directory
# (/cvs/testproject) so the non-root user can write to it.

# Become yourself again
exit

# Create a test project:
mkdir -p -m 0700 ~/testproject
cd ~/testproject
echo "Hi" > README
echo "Testing 1, 2, 3..." > INSTALL
cvs import -m "Created test" testproject CVS_DIST CVS-TEST

# Kill the original:
cd ..
rm -r ./testproject

# checkout your source from CVS:
cvs checkout testproject
cd testproject

# Create a new file, add it to the repository:
echo "Testing 2, 3, 4..." > NEWFILE.txt
cvs add NEWFILE.txt

# Remove a file, remove it from CVS:
rm INSTALL
cvs remove INSTALL

# Commit your changes to CVS:
cvs commit -m "Added NEWFILE.txt, removed INSTALL"

# For info about setting up your repository to be a CVS pserver, run
# 'info cvs', hit g, type in "Password authentication server", hit enter.

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>