[ 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 Quick guide

Here is a quick guide for those who wish to build an existing package using an existing, public available SVN repository. To create own repositories, skip this section and look for more details below.


2.2 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.3 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.4 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 a brute-force solution: fix the permissions with a post-commit script. However, this is an "unsound" solution and may lead to ALL KINDS OF PROBLEMS. MAKE SURE THAT YOU ARE AWARE OF THE POSSIBLE CONSEQUENCES BEFORE YOU OPEN THE PANDORA BOX. See Debian BTS for details. When you damage your repository, don't blame me and remember that there is "svnadmin recover".

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

2.4.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://remoteusername@server-hostname in all examples showed in this manual.

If you wish to use fsh over ssh (what I recommend because it is a significant speed-up with repeating operations), you will specify a custom transport method in subverions's configuration. 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 svn.d.o
     # compression is enabled in the ssh config
     deb = fsh -l blade
     # SSH account for NQ intranet, set fix username
     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+deb://svn.debian.org/svn/myproject/ourpackage/trunk

.


2.4.2 Anonymous access

You can allow outsiders to have anonymous (read-only) access using the svnserve 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 and the SubversionApache2SSL Howto. 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: 2005-03-29 03:19:19 +0200 (Di, 29 Mär 2005) $

Eduard Bloch