Preparing your Ubuntu system for software development

A fresh Ubuntu install lacks most things to do any form of development. You can not even start building packages from source. So you will need a few packages installed to get started.

All of the primary development packages are in main, so no extra repositories are required (the exception was mono in Hoary, but this is no longer the case in Breezy).

Install the build-essential package which will install most of the tools that you will need to compile most packages, as well as write your own.

CVS

Installing CVS

Much of the latest software can only be downloaded using CVS. Install the cvs package then to start working with it, create a build area

mkdir cvs

This will give you a nice place to work

cd cvs

and that's all there's to it.

Using CVS

The initial checkout of the code from a CVS repository is fairly simple, and is made up of three commands.

  1. The first is used to tell CVS where the repository is situated, and how it should connect to it. This is generally done with
    • export CVSROOT=:pserver:<user>@<server>:<directory>
    • replacing <user> with the username (generally anonymous for read-only access), <server> with the name of the server, and <directory> with the directory of the repository on the server.

  2. Next, we log on to the server. When you are only reading the repository (ie. most of the time), you will log on as anonymous, generally with no password, although some projects may be different. The login is performed with the command cvs login and entering the password when prompted.

  3. You can now finally get the code! Change to the directory you want the code in, and issue [cvs -z3 co <somemodule>}. The -z[n] parameter tells CVS to use compression, with 0 being no compression and 9 being the most. 3 is the most commonly used. 'co' means check-out, and <somemodule> needs to be replaced with the name of the module you wish to check-out.

  4. When the repository changes, you are likely to want the latest version again. This can be achieved with cvs update -dP in the directory of the local copy. The d parameter creates new directories, and the P deletes the old ones.

More information on CVS usage can be found with man cvs.

Subversion

Installing Subversion

Subversion (often known as SVN), while not as widely known/used as CVS, is rapidly gaining use in the source code management field. Many major software projects use it, as it has many distinct advantages over the older CVS. It is much easier to use, and has features that make administering the 'repositories' of code much easier. Just install the subversion package.

Using Subversion

Just as it is easy to install, Subversion is easy to use, with

cd someproject
svn checkout http://<server>/<directory>

getting the latest source code (when <server> is replaced with the server of the repository, and <directory> with the directory on the server in which the repository is situated), and putting it in the current directory. Further updates can be retrieved with

svn update

making sure that you are in the directory that you checked it out to.

Further information on Subversion can be found at http://subversion.tigris.org/, and help can be got with

svn help

or at http://www.svnbook.org/.


CategoryProgramming

DevelopingPreparation (last edited 2008-10-27 06:08:55 by cpe-69-207-215-155)