pythonactivepython

How to create a Python Distribution like ActivePython?


How would I create a Python Distro like ActivePython?

Basically its only for linux (Centos 5) platforms. Ideally it should work like ActivePython, as in I could just untar it on a location, e.g a nfs share /path/to/python, and get my scripts to use it?

This usually is a common scenario in enterprise environments, where they dont want you to touch the standard servers builds, e.g don't install anything using RPMs / pollute the /usr/local ... etc.

Sure, I could just download & use ActivePython, but I'm more interested in the process behind creating such distros.

EDIT: This is also the main reason I can't use the EPEL Python 2.6 Packages. sigh


Solution

  • Check out this Python build script from github https://github.com/wavetossed/pybuild and run it on a Debian or Ubuntu VM. The Python tarball that results can be run on any Linux including Centos, but the build script itself, needs to be run on a Debian derived system.

    Because the build uses RUNPATH/RPATH, it can be untarred into any folder, however one bit of fixup needs to be done to make it run, and that is to run the included patchelf tool to --set-interpreter to use the new path where the binaries live. This only affects the python binary and the patchelf binary, so untar it into /data1/packages/python272 first, run patchelf and then move it to where you want it in the directory tree.

    Or, you could just change $TARG before you build it.