SoftwareInstallSchemeTo have complete control over what versions of the software is being used, I use the following scheme for installing software. All software is installed independent from the Linux distribution, This:
software on the system,
All software is installed in a single directory we'll call /topdir in this page. This directory is structured as follows:
InstallingSo to build a software package:
See below for details on Python installs.
You can then refer to the software directly (e.g. /topdir/pkgs/wxWidgets/bin/wx-config) A problem (and benefit) of this approach is that not all binaries are in the same directory (cf. /usr), and you cannot set $PATH to a single dir. Hence, there should be a directory /topdir/pkgs/bin that contains links to the relevant binaries. E.g. ln -s /topdir/pkgs/wxWidgets/bin/wx-config /topdir/pkgs/bin/wx-config In cases where a package depends on other packages (i.e., libraries) it may be necessary to set $LD_LIBRARY_PATH to point the right version (and not the Linux distro one). Therefore, /topdir/pkgs/bin may also contain scripts that indirectly access the software. For example, Python depends on the wxWidgets library, so we would create a script /topdir/pkgs/bin/python: #!/bin/sh PYTHONPATH=/prod/pkgs/m2crypto/lib/python2.4/site-packages:"$PYTHONPATH" PYTHONPATH=/prod/pkgs/wxPython/lib/python2.4/site-packages/wx-2.8-gtk2-unicode:"$PYTHONPATH" LD_LIBRARY_PATH=/prod/pkgs/openssl/lib:"$LD_LIBRARY_PATH" LD_LIBRARY_PATH=/prod/pkgs/wxWidgets/lib:"$LD_LIBRARY_PATH" export LD_LIBRARY_PATH export PYTHONPATH /prod/pkgs/Python/bin/python "$@" Python packagesI consider Python packages as separate software packages. So they are also installed in their own directory in /topdir/pkgs (e.g. /topdir/pkgs/m2crypto-0.17), rather than in the Python installation. To make sure Python finds them, we have to set $PYTHONPATH in the script, as in the example. Note that to make sure you're using the right version of Python when installing, you must install Python packages as follows: /topdir/pkgs/bin/python setup.py build /topdir/pkgs/bin/python setup.py build_ext /topdir/pkgs/bin/python setup.py install --prefix=/topdir/pkgs/m2crypto-0.17 And also for them, create a symbolic link: ln -s /topdir/pkgs/m2crypto-0.17 /topdir/pkgs/m2crypto Upgrading and RevertingTo upgrade a package, simply install it via the above procedure. Then, carefully, taking into account running processes, replace the symbolic link to the new version: ln -sf /topdir/pkgs/m2crypto-0.18 /topdir/pkgs/m2crypto To revert, just change back the symbolic link to the old version (if the software allows this, e.g. upgraded data formats, etc.) |