Installing SVK on Dreamhost
From Dev411: The Code Wiki
Blog Tags: Dreamhost (http://www.dev411.com/blog/tag/dreamhost), SVK (http://www.dev411.com/blog/tag/svk)
Installing SVK, or even Subversion with its Perl bindings (aka SVN::Core), on Dreamhost isn't the most straight-forward process and I could not find any information on it or some of the test errors that show up. This article describes how to get Subversion 1.3.2 and SVK 1.08 installed on Dreamhost.
To discuss this article, go to the blog article (http://www.dev411.com/blog/2006/08/10/installing-svk-on-dreamhost).
| Table of contents |
Configuring CPAN
Follow the instructions for local configuration of CPAN on the Using CPAN page. The steps include:
- Create ~/local directory
- Configure CPAN
- Edit and source ~/.bashrc
- Edit ~/.cpan/CPAN/MyConfig.pm
These are described in detail on the Using CPAN page.
Installing SWIG
This is straight-forward and can be done with the following:
$ ./configure --prefix=/home/<username>/local \ --with-perl5=/path/to/perl $ make $ make install
Installing Subversion with SVN::Core
Run ./configure
This takes a few more steps because SVN::Core has a few issues on Dreamhost. I just used Dreamhost's Perl which is 5.8.4 and currently at /usr/local/bin/perl. Eventually it may be worthwhile to install a local Perl.
$ ./configure --prefix=/home/<username>/local \ PERL=/path/to/perl \ --with-swig=/home/<username>/local/bin/swig \ --without-berkeley-db --with-ssl --with-zlib
Editing the Subversion Makefile
make swig-pl gets the local Perl install directories wrong because it does not pass any parameters through to perl Makefile.PL. This can fixed in several places but I choose to edit the Subversion Makefile because it seemed the easiest, i.e. just edit one file in the working directory.
Edit the Make file and change the following line:
cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL
to the following assuming you are using Dreamhost's perl interpreter and they are still on version 5.8.4:
cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL \
PREFIX=/home/<username>/local \
SITELIBEXP=/home/<username>/local/share/perl/5.8.4 \
SITEARCHEXP=/home/<username>/local/lib/perl/5.8.4
Compiling Subversion and SVN::Core
Now let's compile the software. You should be able to just run through the following steps. You may see warnings and errors listed in the next section but they aren't important. They are described below for your information.
$ make $ make install $ make swig-pl $ make check-swig-pl $ make install-swig-pl
Warnings and Failures
Warning: libtool in make
When running make you may get lots of the following errors. You can ignore these and continue:
libtool: link: warning: `/usr/lib/gcc-lib/i486-linux/3.3.5/../../..//libgdbm.la' \ seems to be moved
Failure: SVN::Core 1.3.2 3client.t test
If you run make check-swig.pl you may get two test failures in 3client.t. If these are the only errors you get and they are numbers 16 and 20, you can just install the Perl bindings with make install-swig-pl.
The test failures look like the following:
../../../../../subversion/bindings/swig/perl/native/t/3client..........ok 15/112
# Failed test 'Returned revnum of current rev from revprop_set'
# in ../../../../../subversion/bindings/swig/perl/native/t/3client.t at line 80.
../../../../../subversion/bindings/swig/perl/native/t/3client..........NOK 16# \
got: '_p_svn_error_t=SCALAR(0x85ac2ac)'
# expected: '1'
../../../../../subversion/bindings/swig/perl/native/t/3client..........ok 19/112
# Failed test 'svn:log is expected value from revprop_list'
# in ../../../../../subversion/bindings/swig/perl/native/t/3client.t at line 96.
# got: ''
# expected: 'mkdir dir1'
../../../../../subversion/bindings/swig/perl/native/t/3client..........ok 109/112# cleanup
../../../../../subversion/bindings/swig/perl/native/t/3client..........ok 112/112# \
Looks like you failed 2 tests of 112.
../../../../../subversion/bindings/swig/perl/native/t/3client..........dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 16, 20
Failed 2/112 tests, 98.21% okay (less 7 skipped tests: 103 okay, 91.96%)
The failure involves the tests use of temp directories to create the test repo. You can ignore this because theoretically you'll always be running with a real repo, not one sitting in an automatically created temp directory. If you want to get rid of the errors to prove it to yourself, create your own ~/tmp directory:
$ mkdir ~/tmp
Then edit subversion/bindings/swig/perl/native/t/3client.t to set tempdir() to use that directory:
#my $testpath = tempdir('svn-perl-test-XXXXXX', TMPDIR => 1);
my $testpath = tempdir('svn-perl-test-XXXXXX', DIR => '/home/<username>/tmp/');
Voila, the errors disappear and you should get a 100% pass rate.
Installing SVK
Installing SVK via CPAN is straight-forward now that CPAN has been configured. Just run:
$ perl -MCPAN -e shell cpan> install SVK
The first time you go through you'll probably have to install a bunch of pre-requisites so I usually do this with a regular installinstall</span> first.
Unfortunately the tests for SVK 1.08 have some errors. If you only see the 5 tests in 72sign.t you can go ahead and do:
cpan> force install SVK
Chia-Liang Kao, the author of SVK, looked at the errors and said it was probably okay to just force install. The test failure is described below:
Warnings and Failures
Failure: SVK 1.08 72sign.t
If the below are the only errors you receive you're good to go. Chia-Liang Kao mentioned these can be ignored. If you run into problems mention them on the blog entry or on the #svk FreeNode IRC channel.
t/72sign.....................NOK 3
# Failed test 'ci -S -m "test signature" t/checkout/sign'
# in t/72sign.t at line 51.
# Structures begin differing at:
# $got->[3] = 'A repository hook failed: 'pre-revprop-change' hook \
failed with error output:'
# $expected->[3] = 'Syncing file:///tmp/svk-22395-1/A'
t/72sign.....................NOK 4
# Failed test 'pl --revprop -r5 //'
# in t/72sign.t at line 59.
# Structures begin differing at:
# $got->[0] = 'Invalid filesystem revision number: No such revision 5'
# $expected->[0] = 'Unversioned properties on revision 5:'
t/72sign.....................NOK 5
# Failed test 'pl --revprop -r3 /test/'
# in t/72sign.t at line 67.
# Structures begin differing at:
# $got->[1] = ' svn:author'
# $expected->[1] = ' svk:signature'
t/72sign.....................NOK 6
# Failed test 'verify 3 /test/'
# in t/72sign.t at line 75.
# Structures begin differing at:
# $got->[0] = 'No signature found for change 3 at /test/.'
# $expected->[0] = 'Signature verified.'
t/72sign.....................NOK 7
# Failed test 'verify 5'
# in t/72sign.t at line 77.
# Structures begin differing at:
# $got->[0] = 'Invalid filesystem revision number: No such revision 5'
# $expected->[0] = 'Signature verified.'
t/72sign.....................ok 8/9gpg: invalid armor header: \
MD5 e17fdaa833db6a48b9183fd2f61d304a Q/qu
# Looks like you failed 5 tests of 9.
t/72sign.....................dubious
Test returned status 5 (wstat 1280, 0x500)
DIED. FAILED tests 3-7
Failed 5/9 tests, 44.44% okay
Checkout Something
That's it, you should have svk and svn installed in /home/<username>/local/bin.
For an example checkout, let's look at Typo. I picked Typo because it seems to be the only sane way for me to upgrade due to the numerous mods I made to it:
$ cd ~ $ mkdir svk $ cd svk $ svk co svn://typosphere.org/typo/trunk typo
Discuss
If you have comments about this please post on the Installing SVK on Dreamhost blog article (http://www.dev411.com/blog/2006/08/10/installing-svk-on-dreamhost).
