You're not currently signed in.

Installing SVK on Debian Stable (Woody)

By DominiqueQuatravaux

InstallingSVK gives general installation instructions. This page focuses on the Debian "woody" (the current stable distribution, at the time of this writing). There is quite a lot of tedious recompiling involved, but SVK is well worth it :-)

Understanding these instructions suppose a great deal of familiarity with the process of building software packages from source, and using Perl's CPAN shell. Please consider switching Linux distributions instead if this description does not fit you (see InstallingSVK).

Road map

  • SVK uses some fairly recent modules from CPAN, some of which (e.g. IO::Digest) require Perl 5.8's new IO discipline code.
  • Perl 5.8 is only available in Debian Sarge. Even invoking the vast powers of http://www.backports.org or a mixed stable/testing apt configuration ( http://free2.org/d/preferences ) don't cut it, as Perl is a fairly low-level package: there simply is no way of installing any kind of perl_5.8*.deb without turning your Woody into a Sarge.
  • SVK uses Subversion to store the client-side repository mirrors, and a recent release (e.g. 1.1.0) is recommended for performance and stability. Again this is difficult to achieve under Woody (although not impossible)...
  • ... and anyway, we also need Subversion's Perl bindings, an optional sub-package which ships with Subversion's sources but are not built in generally-available .deb's.
  • So we need to rebuild Perl and Subversion, and Subversion's Perl bindings. This in turn requires rebuilding SWIG ( http://www.swig.org/ ), a middleware compiler that is tied to a precise version of Perl ! Fortunately, these three packages are very good namespace citizens and easy to install in non-standard locations (I chose /usr/local/ but I guess a private directory would have done just as well).
  • Once the Big Three (Perl, Subversion and SWIG) are up and running, a slew of dependencies for SVK must be recompiled from CPAN. Some, but not all, will be shared with the Perl 5.6 installation in /usr/share/perl5/ and can be fetched with plain apt-get's; on the other hand, all CPAN packages that use XS are tied to a specific version of the Perl interpreter and thus need a recompile to work with the new Perl.

Compile Perl

Believe it or not, this is the easiest part!

  1. Download the sources, for example from http://www.cpan.org/src/stable.tar.gz, and unpack them. (Or if rebuilding from already unpacked sources, delete the config.sh file).
  1. Run ./Configure -de -Dotherlibdirs=/usr/share/perl5 -Dversiononly
  1. Run make, then make test.
  1. Run make install.

That's it. Check that the new Perl interpreter is installed as /usr/local/bin/perl5.8.5, so that it will not conflict with the system's Perl in any way (such is the virtue of the -Dversiononly directive).

The make test part is important, and you should run the test suite of every package along the way in this walkthrough if at all possible.

Compile SWIG

Note: for this part, more up-to-date instructions may be available in Subversion's source tree, in subversion/bindings/swig/INSTALL. As said file states, the commands vary slightly depending on the version of SWIG. Below are instructions for version 1.3.19:

  1. Uninstall Woody's swig .deb package if needed (you can reinstall it once everything is over, but Subversion may not pick the right runtime libraries to link with if there are two versions of SWIG installed)
  1. Download the sources from http://www.swig.org/
  1. Run ./configure --with-perl5=/usr/local/bin/perl5.8.5 (and --with-python=whatever if you care about Python in any way - I, for one, don't :-)
  1. Run make && make runtime
  1. As root, run make install install-runtime
  1. Check that the following files appeared: /usr/local/bin/swig , /usr/local/lib/libswig*.so and /usr/local/lib/swig1.3/*.i .

Compile Subversion and its Perl bindings

  1. Download the sources from http://subversion.tigris.org/. You need at least version 0.36, but a version above 1.1.0 is preferred (advice taken from InstallingSVK). I used Subversion's "bleeding-edge" own repository, at https://svn.collab.net/repos/svn/trunk but this requires a previous version of Subversion to bootstrap :-). Official releases should do just as well.
  1. Untar, change dir into tree, run ./configure SWIG=/usr/local/bin/swig PERL=/usr/local/bin/perl5.8.5
  1. run make
  1. As root, make install
  1. (Again, the remainder of these instructions are lifted from subversion/bindings/swig/INSTALL in the sources) Run make swig-pl, then make check-swig-pl.
  1. As root, run make install-swig-pl

Compile SVK and it's dependencies from the CPAN

This is as simple as running CPAN.pm with the new Perl interpreter, e.g.

perl5.8.5 -MCPAN -e shell

look SVK

perl5.8.5 Makefile.PL

... and there the dependencies headaches begin :-). By all means, attempt to fetch as many dependencies as possible using apt-get instead of the CPAN: not only will it ease the dependency tracking problems, but most Perl modules downloaded that way will interoperate between the system's Perl and /usr/local/bin/perl5.8.5. I used

apt-cache search perl | grep ^lib | less

and then searched my way through SVK's suggested dependencies (remember, Perl package Foo::Bar is Debian's libfoo-bar-perl).

It is not unusual, though, that a Debian package would be properly installed as far as /usr/bin/perl is concerned, but would not show up when re-running perl5.8.5 Makefile.PL in SVK's sources (try [=perl5.8.5 -MReplace::With::Faulty::Module::Name] to find out why). Some badly-Debianized Perl packages install in /usr/lib/perl5 even though they contain no XS code at all, so you may find it useful to set up a handful of symbolic links. I used

/usr/share/perl5/FreezeThaw.pm -> /usr/lib/perl5/FreezeThaw.pm

/usr/share/perl5/HTML/Entities.pm -> /usr/lib/perl5/HTML/Entities.pm

/usr/share/perl5/HTML/Tagset.pm -> /usr/lib/perl5/HTML/Tagset.pm

/usr/share/perl5/IPC/Run3.pm -> /usr/local/share/perl/5.6.1/IPC/Run3.pm

Other packages have a XS dependency (that is, they contain add-ons written in C for the Perl interpreter) and therefore aren't portable between different versions of Perl, and the new perl5.8.5 will wisely steer clear from them. So you have to re-install them a second time using perl5.8.5 -MCPAN (which will stash them apart in adequate sub-directories of /usr/local/lib/perl5, so that the system's Perl will not trip on them).

Install all needed Perl modules using a clever mixture of apt-get and perl5.8.5 -MCPAN, until running perl5.8.5 Makefile.PL inside SVK's source tree says everything is OK. Oh, and don't be shy on those optional dependencies of SVK, such as SVN::Mirror and friends: install all of them, they are well worth that much of your disk space :-)

Once all dependencies are settled, compile and test SVK with

perl5.8.5 -MCPAN -e shell

look SVK

perl5.8.5 Makefile.PL

make test

Then as root,

make install

for i in /usr/local/bin/svk /usr/local/bin/svm; do vi $i; done

and change the first line in each from #!/usr/local/bin/perl to #!/usr/local/bin/perl5.8.5

That's it: type svk help, and... voilĂ !

Goodies

Congratulations for making it through that far! Why not cover the extra mile and install VCP too? (so you can interoperate SVK with e.g. CVS, see MirrorVCP). This is just another CPAN module, but it is not in the public CPAN tree (see MirrorVCP for availability details).

Once this is done, re-run the tests in SVN::Mirror (a dependency to SVK, whose sources you should still have lying around from the above CPAN spree). Some more tests pertaining to VCP are now run as part of SVN::Mirror's suite. And aren't those "writing revisions:" progress bars just yummy? :-)

Cleanup

In order to restore the previous "look and feel" of the system, you may move away mostly everything in /usr/local/bin that was installed by this procedure (Perl, Subversion, SWIG), except perl5.8.5 and svk. It is advised to keep at least the /usr/local/bin/svn and /usr/local/bin/svnadmin binaries around (maybe rename them if you already have another version of Subversion installed?) to debug or database-recover the local mirror repositories, if need be.

You can re-install SWIG now using apt-get, if you had to uninstall it along the way.