[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]

svn-buildpackage - maintaining Debian packages with Subversion
Chapter 2 - Getting started


Besides of the packages that are installed by dependencies when you install svn-buildpackage, you may need ssh and the obligatory tool chain: dpkg-dev, build-essential and all the packages they pull into the system.


2.1 Basic svn usage

You need only few commands to start using svn with svn-buildpackage scripts. If you wish to learn more about it, read parts of the the Subversion Book. The most used commands are:

If you are familiar with CVS you will probably know almost all you need.


2.2 Creating Subversion repository

The main Subversion repository is easily created with:

     svnadmin create repo-directory

For our example, we choose the name svn-deb-repo and put it in /home/user.

If you plan to keep many packages in the one repository including upstream tarballs, consider to put it on a hard disk with much free space and good performance (especially short disk access times) since the repository will grow and the filesystem may become fragmented over time.


2.3 Using by multiple developers

Multiple developers with local access to the repository may share it using a common group. To do so, create a new group and add all developers to it. Run "chgrp -R sharedGroup repdir ; chmod -R g+s repdir" for the shared group and the repository directory. Now, on local access to this repository everybody will create files with the appropriate group setting. However, the developers will need to set a liberal umask before using svn (like "0022"). If somebody resists to do so, there is still brute-force sollution: fix the permissions by a post-commit script.

To do so, create the file hooks/post-commit in the repository directory and add something like the shell code below. There are other example scripts in that directory which you could study by the way.

     #!/bin/sh
     
     # POST-COMMIT HOOK
     # The following corrects the permissions of the repository files
     
     REPOS="$1"
     REV="$2"
     
     chgrp -R sharedGroup $REPOS
     chown -R g+r $REPOS
     chown -R g+w $REPOS

Replace sharedGroup with your group and make the script executable when done.


2.3.1 SVN over SSH

To run Subversion over SSH, you basically need a shell on the target system and a subversion repository located there which is created following the description above. The repository must be configured for access by the system users of the remote system.

Assuming that your user name on the client system is the same as on the server side, there is not much to configure. Just change the protocol specificaton from file:// to svn+ssh://server-hostname in all examples showed in this manual.

If your local username differs from that on the remote side, you will need to configure your ssh invocation method to use the correct user name. To do so, edit the file ~/.subversion/config and add the section [tunnels] to it, following by your custom transport definition. Example:

     # personal subversion config with custom ssh tunnel command
     [tunnels]
     # SSH account on Alioth, remote so use compression
     alioth = ssh -C -l blade
     # SSH account for NQ intranet development
     nq = ssh -C -l zomb

You can use the new defined tunnels in a similar ways as described above but replace svn+ssh with svn+tunnelname, so the final URL looks like:

     svn+alioth://myproject.alioth.debian.org/svn/myproject/ourpackage/trunk

.


2.3.2 Anonymous access

You can allow outsiders to have anonymous (read-only) access using the svnserver program, as described in the Subversion documentation.

Another method is using HTTP/WebDAV with Apache2. More about a such setup can be found in the Subversion Book. svn.debian.org is an example site granting anonymous access to some selected projects hosted there.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ next ]

svn-buildpackage - maintaining Debian packages with Subversion

$LastChangedDate: 2004-02-14 01:03:11 +0100 (Sat, 14 Feb 2004) $

Eduard Bloch