This Python code partially automates the task of building chrooted jails. The basic principle is that files, directories, links, and devices are fed in. An sh script is then emitted. The sh script actually does the work of setting up the chrooted environment. The code works for any application, but there is a module specifically for chrooting Python applications as well.
The code is alpha and the current release is chrootbuilder-0.2.tar.gz.