Skip to content

Instantly share code, notes, and snippets.

@jpina
Created November 24, 2015 10:24
Show Gist options
  • Save jpina/ab529df1f35df96772f8 to your computer and use it in GitHub Desktop.
Save jpina/ab529df1f35df96772f8 to your computer and use it in GitHub Desktop.
Compile SVN 1.7.20 with neon support (Ubuntu 14.04)
#!/bin/bash
# Get script path
SOURCE_DIR=/usr/local/src
SVN_VERSION=1.7.20
SVN_SRC_DIR=$SOURCE_DIR/subversion-$SVN_VERSION
# Install dependencies
sudo apt-get -y install build-essential libxml2 libxml2-dev libxslt1-dev openssl libssl-dev
#Download the latest version
# http://subversion.apache.org/download/
# http://blog.ilwilliams.net/compiling-subversion-1-7-1-from-source-with-ssl/
wget -c -t3 -O $SOURCE_DIR/subversion-1.7.20.tar.gz https://archive.apache.org/dist/subversion/subversion-$SVN_VERSION.tar.gz
tar -zxf $SOURCE_DIR/subversion-$SVN_VERSION.tar.gz -C $SOURCE_DIR
# Use the in-built script to download the required dependencies, and configure neon for SSL
cd $SVN_SRC_DIR
bash get-deps.sh
cd $SVN_SRC_DIR/neon
cat <<PATCH > ./neon-ssl.patch
--- src/ne_openssl.c 2015-05-04 09:26:32.753844886 +0200
+++ src/ne_openssl.c.new 2015-05-04 09:26:10.245849502 +0200
@@ -565,11 +565,8 @@
/* enable workarounds for buggy SSL server implementations */
SSL_CTX_set_options(ctx->ctx, SSL_OP_ALL);
SSL_CTX_set_verify(ctx->ctx, SSL_VERIFY_PEER, verify_callback);
- } else if (mode == NE_SSL_CTX_SERVER) {
- ctx->ctx = SSL_CTX_new(SSLv23_server_method());
- SSL_CTX_set_session_cache_mode(ctx->ctx, SSL_SESS_CACHE_CLIENT);
} else {
- ctx->ctx = SSL_CTX_new(SSLv2_server_method());
+ ctx->ctx = SSL_CTX_new(SSLv23_server_method());
SSL_CTX_set_session_cache_mode(ctx->ctx, SSL_SESS_CACHE_CLIENT);
}
return ctx;
PATCH
patch -p0 < neon-ssl.patch
./configure --with-ssl
make
sudo make install
cd ..
# Download and install the required sqlite3.c
cd $SOURCE_DIR
wget -c -t 3 -O ./sqlite-amalgamation-3.7.0.1.tar.gz http://www.sqlite.org/sqlite-amalgamation-3.7.0.1.tar.gz
tar xzf sqlite-amalgamation-3.7.0.1.tar.gz -C ./
sudo mkdir -pv $SVN_SRC_DIR/sqlite-amalgamation/
sudo cp sqlite-3.7.0.1/sqlite3.c $SVN_SRC_DIR/sqlite-amalgamation/
# Configure & make Subversion
cd $SVN_SRC_DIR
./configure --with-neon=/usr/local --with-openssl=/usr
make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment