You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by PV...@capmon.dk on 2003/03/13 18:24:50 UTC

Experiences building subversion incl. 6 dependencies

Hi there,

My project and I are now happy subversion users! And I'll be using it at 
home too. 

But it has been a battle to get here, I must admit, taking a couple of 
days, not hours. I'm hoping that this example will help anyone trying to 
get to this same blissful subversioned place. I realize that this is a 
young-ish project and that SuSE 7.2 is dated, and so it is only natural 
that many prerequisites were out of date. But even my fairly new RedHat 
8.0 installation at home was out of date, so I'm hoping that my monster 
script will have some relevance even for users that don't have quite as 
old an installation as what I started out with.

If it would benefit the subversion community (or mostly its future new 
users) I wouldn't mind turning it into a more general purpose script or 
Makefile e.g. distributed with or mentioned in INSTALL. But if there is no 
interest in that, I won't bother :-) I would have *loved it* if something 
like this had been around for me - a working example of some of the useful 
configure parameters and environment variables for all the prerequisites 
using custom --prefix options.

I'd like to thank this list whose support has been simply outstanding. 
Nobody mentioned, nobody forgotten.

Sincerely,

Peter
---------------------------------------------------------------------

I needed to get subversion running on a SuSE 7.2 production server that 
could not be disturbed. It is also used for compiling code, so installing 
new versions of existing tools into standard directories (in /usr/lib, 
/usr/include, /usr/bin etc. ) was not an option.

I ended up having to build:

libtool-1.4.3.tar.gz
autoconf-2.57.tar.gz
db-4.0.14.tar.gz
httpd-2.0.44.tar.gz
Python-2.2.2.tgz
swig-1.3.17.tar.gz
subversion-0.19.1.tar.gz

I decided to cut a corner and not build the prerequisites for the 
documentation, since they're mostly available online...

---------------------------------------------------------------------

#!/bin/bash

# This works for a SuSE 7.2 system with most *-devel.rpms
# installed. mailto:pvm@capmon.dk will give you a list of exaclty what
# packages in what versions were installed on the machine to begin with.
# No libs or incs or anything like that differed from an original SuSE 7.2

################################################################################
# Change these settings to reflect where you're building to (PREFIX) and 
where
# you're building from (BUILD + DOWNLOAD):
PREFIX=$HOME/subversion
BUILD=`pwd`/build
DOWNLOAD=`pwd`/downloads

function usage {
    echo "Put all your tarballs in $DOWNLOAD"
    echo "then run this script."
    echo "It will build in $BUILD"
    echo "and install everything in $PREFIX"
    exit 1
}

# Takes no args
if [ "$1" != '' ] ; then 
    usage
fi
 
################################################################################
# Make sure LD_LIBRARY_PATH and PATH are set up to include
# $PREFIX. We'll do that just to be sure... And we'll want to use
# these libs before the ones in the users path because the existing paths 
quite
# likely contain old versions that we don't want to use.

# When running the final svn, you'll want to set up these
# environment variables with the same values too!
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export LD_RUN_PATH=$PREFIX/lib:$LIBDIR
export PATH=$PREFIX/bin:$PATH

################################################################################
# Check for sanity of above settings.
# Expect $DOWNLOAD to contain some tarballs, but first check 
# that they're all there

# Note: I probably should have done it like LIBTOOL=libtool.X.Y.Z.tar.gz;
# AUTOCONF=yadayada etc. so that each prerequisite was optional, but I
# didn't need that myself. This is one of the things that would change
# if it is made general purpose...

if [ ! -d $DOWNLOAD ]
then
    echo "The directory $DOWNLOAD should exist containing tarballs"
    exit 1
fi

# Check that the download directory contains all that we need.
for f in \
 'libtool-*.tar.gz' \
 'autoconf-*.tar.gz' \
 'db-4.0.14.tar.gz' \
 'httpd-2.*.tar.gz' \
 'Python*.tgz' \
 'swig-*.tar.gz' \
 'subversion-*.tar.gz'
do
    count=`find $DOWNLOAD -name $f -print | wc -l`
    if [ $count != 1 ]
    then
        echo "Need exaclty one of $DOWNLOAD/$f, not $count"
        exit 1
    fi
done

# If any of the mentioned directories are missing, create them.
for d in $PREFIX $BUILD
do
    if [ ! -d $d ]
    then
        mkdir -p $d
        if [ $? != 0 ] ; then
            echo "Couldn't create $d"
            exit 1
        fi
    fi
done
#
################################################################################

# Enable "set -x" to see more details of what this script executes
# set -x

# Will create visible dividers in the output
function title {
    echo '############################################################'
    echo '# BUILD: ' $1
    echo '############################################################'
}

###############################################################################
# libtool
###############################################################################
# Download from http://www.gnu.org/software/libtool/libtool.html
function mk_libtool {
    title libtool
    rm -rf $BUILD/libtool*
    cd $BUILD
    tar zxf $DOWNLOAD/libtool*.tar.gz
    cd libtool*
    ./configure --prefix=$PREFIX
    make && make install
}

###############################################################################
# autoconf
###############################################################################
# Download from http://www.gnu.org/software/autoconf/autoconf.html
function mk_autoconf {
    title autoconf
    rm -rf $BUILD/autoconf*
    cd $BUILD
    tar zxf $DOWNLOAD/autoconf*.tar.gz
    cd autoconf*
    ./configure --prefix=$PREFIX
    make && make install
}

###############################################################################
# The Berkely DB
###############################################################################
# Download from http://www.sleepycat.com/download/patchlogs.shtml 
# and make sure to get exactly version 4.0.14 - not newer...
function mk_db {
    title db
    rm -rf $BUILD/db*
    cd $BUILD
    tar zxf $DOWNLOAD/db*.tar.gz
    cd db*/build_unix
    ../dist/configure --prefix=$PREFIX
    make && make install
}
###############################################################################
# Apache 2.0.X
###############################################################################
# Download apache from http://www.apache.org and
function mk_apache {
    title Apache
    rm -rf $BUILD/httpd-*
    cd $BUILD
    tar zxf $DOWNLOAD/httpd-2.0*.tar.gz
    cd httpd-2.0*
    ./configure --prefix=$PREFIX --enable-ssl --enable-deflate \
     --enable-dav --enable-so --with-dbm=db4 \
     --with-berkeley-db=$PREFIX --enable-maintainer-mode
    make && make install

    # In our case, we use ssh so we'll be fine...
 
    # Otherwise, you may want to edit the $PREFIX/conf/httpd.conf 
    # e.g. to change Listen from 80 to 8080 or whatever
    # cat $PREFIX/conf/httpd.conf | \
    #  sed 's/^Listen 80$/Listen 8080/' > tmpfile
    # mv tmpfile $PREFIX/conf/httpd.conf
    # and then maybe
    # $PREFIX/bin/apachectl start
}

###############################################################################
# Python
###############################################################################
# Download from http://www.python.org/
function mk_Python {
    title Python
    rm -rf $BUILD/Python*
    cd $BUILD
    tar zxf $DOWNLOAD/Python*.tgz
    cd Python*
    ./configure --prefix=$PREFIX
    make && make install
}

###############################################################################
# swig
###############################################################################
# Download from http://sourceforge.net/projects/swig/
function mk_swig {
    title swig
    rm -rf $BUILD/SWIG*
    cd $BUILD
    tar zxf $DOWNLOAD/swig*.tar.gz
    cd SWIG*
    export LDFLAGS="-L$PREFIX/lib"
    export CPPFLAGS="-I$PREFIX/include"
    ./configure --prefix=$PREFIX
    make && make install
    unset LDFLAGS
    unset CPPFLAGS
}

###############################################################################
# Subversion
###############################################################################
# Download from http://subversion.tigris.org
function mk_subversion {
    title Subversion
    rm -rf $BUILD/subversion*
    cd $BUILD
    tar zxf $DOWNLOAD/subversion*.tar.gz
    cd subversion*
    sh autogen.sh
    configure --prefix=$PREFIX \
     --with-apr=$PREFIX \
     --with-apr-util=$PREFIX \
     --with-apxs=$PREFIX/bin/apxs \
     --with-berkeley-db=$PREFIX \
     --with-swig=$PREFIX \
     --enable-maintainer-mode --with-ssl
 
    make && make install && make install-swig-py && make check

    # When using ssh, this script needs to be the one called when a user
    # logs in and simply types "svnserve" so it needs to go on every
    # subversion user's path as "svnserve", somehow.
    echo '#!/bin/bash
    # Change this to reflect where your repository really is
    repos=/home/svnrepos
    umask 002
    svnserve.real -r $repos "$@"
    ' > ssh.svnserve
    chmod +x ssh.svnserve
    install ssh.svnserve $PREFIX/bin
}

###############################################################################
#
#
# Execute the build...
#
#
###############################################################################

mk_libtool
mk_autoconf
mk_db
mk_apache
mk_Python
mk_swig

# title "Settings before running subversion"
# libtool --version
# autoconf --version
# echo $LD_LIBRARY_PATH
# echo $PATH

mk_subversion


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Experiences building subversion incl. 6 dependencies

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
PVM@capmon.dk writes:
> But it has been a battle to get here, I must admit, taking a couple of 
> days, not hours. I'm hoping that this example will help anyone trying to 
> get to this same blissful subversioned place. I realize that this is a 
> young-ish project and that SuSE 7.2 is dated, and so it is only natural 
> that many prerequisites were out of date. But even my fairly new RedHat 
> 8.0 installation at home was out of date, so I'm hoping that my monster 
> script will have some relevance even for users that don't have quite as 
> old an installation as what I started out with.
> 
> If it would benefit the subversion community (or mostly its future new 
> users) I wouldn't mind turning it into a more general purpose script or 
> Makefile e.g. distributed with or mentioned in INSTALL. But if there is no 
> interest in that, I won't bother :-) I would have *loved it* if something 
> like this had been around for me - a working example of some of the useful 
> configure parameters and environment variables for all the prerequisites 
> using custom --prefix options.

Whew!  I'm sorry it was such a trial... But, it should be pointed out
that based on your list

> libtool-1.4.3.tar.gz
> autoconf-2.57.tar.gz
> db-4.0.14.tar.gz
> httpd-2.0.44.tar.gz
> Python-2.2.2.tgz
> swig-1.3.17.tar.gz
> subversion-0.19.1.tar.gz

... you were trying to get the server and the SWIG bindings.  In other
words, the most complex possible set of requirements :-).  Someone
just building a client won't encounter nearly as many problems.  And
even someone who wants a server still might not want SWIG bindings.

Also, why did you need autoconf?  The last item in your list is the
0.19.1 Subversion tarball, which should come preconfigured.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org