May 2006

Sandboxed Builds

Life sucks, then you get a helmet.
Denis Leary

 

If you do not have root and you have the space a sandbox build can save your life (or career). In this example, only one piece of software needs to build and run; subversion. Easy enough? Unfortunately after running ./configure an alarm comes up requiring at least apache2 and the latest autoconf. The problem - no root access and a need to get it done.

Prepping the Build

One thing that needs to be set up, the prefix directory and a build directory:

export prefix=$HOME/sandbox
export build=$HOME/build

Now, how to get it all done ...

autoconf

Building autoconf is not too hard on most systems since it self bootstraps:

cd autoconf-X
./configure --prefix=$prefix
make && make install

Autoconf will install to $HOME/* and automatically create everything needed.

The Next Step

Now we need to somehow make apache aware of the new stuff lying in $HOME/sandbox/ - easy:

export AUTOCONF=$prefix/bin/autoconf

Time to build apache2...

cd httpd-X
./configure --prefix=$prefix/apache2
make  && make install

The shell will pass along the new AUTOCONF variable. It is a done deal; apache is in a user directory [1]

Now for the first one...

Now subversion can be compiled right? Well the new axps needs to be added....

cd subvesion-X
./configure --with-axps2=$prefix/apache2/bin/apxs --prefix=$prefix
make &&  make install

Summary

Building in userland is not too hard, just remember it is possible to become a dependency nightmare - if you go past 8 it is time to take another route. For library linking use this and remember it *will* include system defaults first; then add yours:

CPPFLAGS="-I/path/to/inc"
CFLAGS="-I/path/to/inc"
LDFLAGS="-L/path/to/lib"

Make sure to read your docs and source documents.

Footnotes

  • The portnumber needs to be changed to greater than 1024 for unprivileged mode.

 

Digg!
Submit site
news to Digg!

Slashdot Slashdot It!
Delicious Bookmark on Delicious