Skip to content

Instantly share code, notes, and snippets.

@slawekzachcial
Last active May 23, 2018 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slawekzachcial/bde79a188b5e782419c923bee3a8300e to your computer and use it in GitHub Desktop.
Save slawekzachcial/bde79a188b5e782419c923bee3a8300e to your computer and use it in GitHub Desktop.
# We do it in a Docker container
docker run -it --name svn_build debian:jessie
# Set HTTP proxy if required
export http{,s}_proxy=http://proxy_host:proxy_port
# Install all the dependencies
apt-get update
apt-get install curl bzip2 gcc autoconf libtool make python
# create WORK_DIR and TARGET_DIR
export WORK_DIR=/path/to/workdir TARGET_DIR=/path/to/targetdir
mkdir -p $WORK_DIR
mkdir -p $TARGET_DIR
# Download subversion and its dependencies
cd $WORK_DIR
curl -OL http://www-eu.apache.org/dist/subversion/subversion-1.10.0.tar.bz2
curl -OL http://www-us.apache.org/dist//apr/apr-1.6.3.tar.bz2
curl -OL http://www-us.apache.org/dist//apr/apr-util-1.6.1.tar.bz2
curl -OL https://www.sqlite.org/2018/sqlite-autoconf-3230100.tar.gz
curl -OL https://zlib.net/zlib-1.2.11.tar.gz
curl -OL http://www-us.apache.org/dist//apr/apr-iconv-1.2.2.tar.bz2
curl -OL https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2
curl -OL https://www.openssl.org/source/openssl-1.1.0h.tar.gz
curl -L -o expat-2.2.5.tar.gz https://github.com/libexpat/libexpat/archive/R_2_2_5.tar.gz
curl -OL http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
# Verify checksums of what's been downloaded
# sha1sum ...
# sha256sum ...
# sha512sum ...
# Build apr
cd $WORK_DIR
tar xjf apr-1.6.3.tar.bz2
cd apr-1.6.3
./configure --prefix=$TARGET_DIR
make
make install
# Build expat
cd $WORK_DIR
tar zxf expat-2.2.5.tar.gz
cd libexpat-R_2_2_5/expat
./buildconf.sh
./configure --prefix=$TARGET_DIR --without-xmlwf
make
make install
# Build apr-util
cd $WORK_DIR
tar xjf apr-util-1.6.1.tar.bz2
cd apr-util-1.6.1
./configure --with-apr=$TARGET_DIR --prefix=$TARGET_DIR --with-expat=$TARGET_DIR
make
make install
# Build apr-iconv
cd $WORK_DIR
tar xjf apr-iconv-1.2.2.tar.bz2
cd apr-iconv-1.2.2
./configure --with-apr=$TARGET_DIR --prefix=$TARGET_DIR
make
make install
# Build zlib
cd $WORK_DIR
tar xzf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=$TARGET_DIR
make
make install
# Build sqlite
cd $WORK_DIR
cd sqlite-autoconf-3230100
./configure --prefix=$TARGET_DIR
make
make install
# Build openssl
cd $WORK_DIR
tar xzf openssl-1.1.0h.tar.gz
cd openssl-1.1.0h
./config --prefix=$TARGET_DIR
make
make install
# Unpack SCons
cd $WORK_DIR
mkdir scons-local-2.3.0
cd scons-local-2.3.0
tar xzf ../scons-local-2.3.0.tar.gz
# Build serf
cd $WORK_DIR
tar xjf serf-1.3.9.tar.bz2
cd serf-1.3.9
ln -s $WORK_DIR/scons-local-2.3.0/scons.py scons
./scons APR=$TARGET_DIR APU=$TARGET_DIR OPENSSL=$TARGET_DIR PREFIX=$TARGET_DIR
./scons install
# Build subversion
cd $WORK_DIR
tar xjf subversion-1.10.0.tar.bz2
cd subversion-1.10.0
./configure --without-berkeley-db --without-apxs --with-zlib=$TARGET_DIR --with-sqlite=$TARGET_DIR --without-pic --disable-shared --with-apr=$TARGET_DIR --with-apr-util=$TARGET_DIR --prefix=$TARGET_DIR --with-lz4=internal --with-utf8proc=internal --with-serf=$TARGET_DIR
make
make install
# Check build result
cd $WORK_DIR
$TARGET_DIR/bin/svnrdump --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment