JuangaCovas.info

La página personal de Juan Gabriel Covas

Herramientas de usuario

Herramientas del sitio


linux:howtos:build-svn-from-sources

Build Subversion from sources for Linux RedHat, CentOS or Ubuntu, including svn 1.14

– By Juan Gabriel Covas - 2019 - 2021

How to build Subversion / SVN from Sources, on CentOS 8, CentOS 7 or Ubuntu 18 / 19 / 20, so you can use the latest subversion version. This how-to is based on this blog post: Building Subversion on Ubuntu 12.10 but over time some changes have been made.

NOTE: This how-to is OK for a subversion client OR updating the binaries of a subversion SERVER that does NOT use Apache or any other stuff. Since I'm only interested in svn+ssh protocol, it's fine for me. Anyway a subversion SERVER requires more setup if you want to use Apache, svn+ssh, etc. which is not the purpose of this document. You can check my notes on setup a subversion server for svn+ssh


CentOS 8 minimal: build SVN 1.14 from sources

Compilation tested on CentOS 8 (minimal install, NO stock subversion installed). Updated 2020-11-02

Pre-requisites:

yum -y install epel-release
yum install net-tools bind-utils nano wget perl mlocate mailx crontabs cronie rsync openssh-server unzip perl-libwww-perl yum-utils curl psmisc git cpan colordiff pwgen bc perl-LWP-Protocol-https gcc libevent libevent-devel zlib zlib-devel bzip2-devel openssl-devel pcre pcre-devel libmcrypt libmcrypt-devel libjpeg-turbo-utils optipng zlib-devel libuuid-devel gcc make git autoconf automake pkgconfig utf8proc apr apr-devel apr-util apr-util-devel libtool boost python2

As non-root user:

cd ~; mkdir src; cd src
wget https://dlcdn.apache.org/subversion/subversion-1.14.1.tar.gz
tar xzf subversion-1.14.1.tar.gz
cd subversion-1.14.1
./get-deps.sh

We have python executable as python2:

$ python2 --version
Python 2.7.17

Now, to avoid error: /usr/bin/env: ‘python’: No such file or directory when doing autogen:

$ sudo alternatives --set python /usr/bin/python2
$ python --version
Python 2.7.17

Under CentOS 8 we must set this env. variable:

$ export LIBTOOL_M4=/usr/share/aclocal

Next, autogen:

$ ./autogen.sh
[...]
You can run ./configure now.
[...]

Configure…

$ ./configure --with-lz4=internal --with-utf8proc=internal
[...]
config.status: executing svn_private_config.h.tmp commands

And make:

$ make

To check we pass all tests:

$ make check

Finally install:

$ sudo make install

We should have svn client there:

$ svn --version --quiet
1.14.1

CentOS 7 minimal: compiling SVN 1.14 from sources

Compilation tested on CentOS 7 (minimal install, NO stock subversion installed). Updated 2020-11-02

Subversion build: success as normal user (no root), under /home/user/src

Pre-requisites (and some other tools I like)

sudo yum install net-tools bind-utils nano
sudo yum install net-tools wget nano perl mlocate mailx bind-utils crontabs cronie rsync openssh-server unzip perl-libwww-perl yum-utils deltarpm curl psmisc git cpan colorize colordiff pwgen bc
sudo yum install epel-release
sudo yum install cpan colorize colordiff pwgen perl-LWP-Protocol-https
sudo yum install gcc libevent libevent-devel zlib zlib-devel bzip2-devel gamin-devel lua lua-devel openssl-devel pcre pcre-devel pcre-static libmcrypt libmcrypt-devel
sudo yum install libjpeg-turbo-utils optipng gifsicle
sudo yum install zlib-devel libuuid-devel gcc make git autoconf autogen automake pkgconfig
sudo yum install utf8proc utf8proc-devel apr apr-devel apr-util apr-util-devel libtool

Installing subversion from sources:

$ cd ~; mkdir src; cd src
$ wget https://dlcdn.apache.org/subversion/subversion-1.14.1.tar.gz
$ tar xzf subversion-1.14.1
$ cd subversion-1.14.1
$ ./get-deps.sh

Now, since SVN 1.14.x, we need to make install newer APR tools (stock CentOS 7 version for APR is 1.5 which is old):

$ cd apr/; ./buildconf; ./configure; make; sudo make install
$ cd ../apr-util; ./buildconf; ./configure --with-apr=../apr; make; sudo make install
$ cd ../apr-util/xml/expat/; ./buildconf.sh; ./configure; make; sudo make install; cd ../../..

Make sure you do this on CentOS:

$ export LIBTOOL_M4=/usr/share/aclocal
$ export LIBTOOL_CONFIG=/usr/share/libtool/config

Then autogen will work:

./autogen.sh

Now for svn 1.14 we need to tell configure where APR is:

$ ./configure --with-lz4=internal
$ ./configure --with-lz4=internal --with-apr=./apr --with-apr-util=./apr-util
$ make

If you want peace of mind, run the tests:

$ make check

Install binaries:

$ sudo make install

Check version:

# svn --version --quiet
1.14.1

Also be sure to check the final notes at the page bottom, when you need to re-compile a newer version of SVN.


Ubuntu 19 server: Compiling and installing SVN from sources

Tested on Ubuntu 19 Server (minimal install, NO stock subversion previously installed)

Subversion build: success as a normal user, in /home/user/src

Pre-requisites on Ubuntu 18

# apt-get install build-essential git libtool libtool-bin unzip libutf8proc1 libutf8proc-dev

Pre-requisites on Ubuntu 19 (libutf8proc1 is not needed anymore)

# apt-get install build-essential git libtool libtool-bin unzip

More pre-requisites:

  • Enable (uncomment) the lines beginning with deb-src inside the file /etc/apt/sources.list
  • Update the packages now with sudo apt-get update
  • Get dependencies from the stock subversion (lazy & dirty) with sudo apt-get build-dep subversion

Download subversion sources:

# cd ~; mkdir src; cd src
# wget https://dlcdn.apache.org/subversion/subversion-1.14.1.tar.gz
# tar xvzf subversion-*
# cd subversion-1.14.1

Going to compile and install subversion from sources on Ubuntu:

# ./get-deps.sh apr serf zlib sqlite
# cd apr/; ./buildconf
# cd ../apr-util; ./buildconf
# cd ../apr-util/xml/expat/; ./buildconf.sh; cd ../../..

Continue:

# ./autogen.sh
# ./configure --with-lz4=internal
# make
# make check
# sudo make install

Everything went OK, make and (sudo) make install, BUT got this error when tried to execute svn command:

# svn
svn: error while loading shared libraries: libsvn_ra_svn-1.so.0: cannot open shared object file: No such file or directory

Fixed forcing ldconfig:

sudo ldconfig

Then it works:

# svn --version --quiet
1.14.1


Note on RE-building subversion from sources

How to fix error: recipe for target 'subversion/svnmucc/svnmucc' failed

If you RE-build a new version from sources, you should move or delete all files prefixed libsvn_* from /usr/local/lib to avoid the following errors when doing make: (this is an example when I re-build svn v1.12 when previously compiled 1.11 on the same box):

../../subversion/libsvn_client/.libs/libsvn_client-1.so: undefined reference to `svn_wc__get_experimental_dir'
../../subversion/libsvn_client/.libs/libsvn_client-1.so: undefined reference to `svn_wc__find_copies_of_repos_path'
collect2: error: ld returned 1 exit status
build-outputs.mk:1194: recipe for target 'subversion/svnmucc/svnmucc' failed
make: *** [subversion/svnmucc/svnmucc] Error 1

After moving the files, make succeeded.

Comments

Escribe el comentario. Se permite la sintaxis wiki:
 
linux/howtos/build-svn-from-sources.txt · Última modificación: 19/09/2021 12:34 por Juanga Covas