Questa guida non è stata ancora completamente tradotta. Se vuoi contribuire alla sua traduzione contatta il Gruppo Traduzione di Ubuntu-it.

Server CVS

CVS è un sistema di controllo della versione che è possibile utilizzare per registrare i cambiamenti al codice sorgente di un programma.

Installazione

Per installare CVS, eseguire il seguente comando in un terminale:

sudo apt-get install cvs
Una volta installato cvs, installare xinetd per avviare/fermare il server CVS. In un terminale, digitare quando segue per installare xinetd:
sudo apt-get install xinetd

Configurazione

Once you install cvs, the repository will be automatically initialized. By default, the repository resides under the /srv/cvs directory. You can change this path by running following command:

cvs -d /your/new/cvs/repo init
Once the initial repository is set up, you can configure xinetd to start the CVS server. You can copy the following lines to the /etc/xinetd.d/cvspserver file.
service cvspserver
{
     port = 2401
     socket_type = stream
     protocol = tcp
     user = root
     wait = no
     type = UNLISTED
     server = /usr/bin/cvs
     server_args = -f --allow-root /srv/cvs pserver
     disable = no
}

Be sure to edit the repository if you have changed the default repository (/srv/cvs) directory.

Once you have configured xinetd you can start the cvs server by running following command:
sudo /etc/init.d/xinetd restart

Per avere la conferma che il server CVS è in esecuzione, digitare il seguente comando:

sudo netstat -tap | grep cvs

L'output del comando precedente dovrebbe essere:

tcp 0 0 *:cvspserver *:* LISTEN 

A questo punto è possibile aggiungere altri utenti, nuovi progetti e gestire il server CVS.

CVS consente di aggiungere nuovi utenti indipendentemente dal sistema operativo. Il modo più semplice è utilizzare l'utente Linux per CVS, benché presenti dei problemi di sicurezza. Per maggiori informazioni, consultare il manuale di CVS.

Aggiungere progetti

This section explains how to add new project to the CVS repository. Create the directory and add necessary document and source files to the directory. Now, run the following command to add this project to CVS repository:

cd your/project
cvs -d :pserver:username@hostname.com:/srv/cvs import -m \
"Importing my project to CVS repository" . new_project start

È possibile utilizzare la variabile d'ambiente CVSROOT per memorizzare la directory root di CVS. Una volta esportata, si può evitare di utilizzare l'opzione "-d" nel comando precedente.

The string new_project is a vendor tag, and start is a release tag. They serve no purpose in this context, but since CVS requires them, they must be present.

When you add a new project, the CVS user you use must have write access to the CVS repository (/srv/cvs). By default, the src group has write access to the CVS repository. So, you can add the user to this group, and he can then add and manage projects in the CVS repository.