16 · 10

Google Appengine on Ubuntu Maverick - without Python 2.5

 First of all, install the required ubuntu packages:

 

 $ sudo aptitude install libssl-dev libsqlite3-dev

Then, fetch python2.5 source tarball:

 $ wget http://python.org/ftp/python/2.5/Python-2.5.tar.bz2
 $ tar xjf Python-2.5.tar.bz2

Before compiling, we need to tweak the file Python-2.5/Modules/Setup.dist (line 207) as following:

 _ssl _ssl.c \
 -DUSE_SSL -I/usr/include/openssl \
 -L/usr/lib -lssl -lcrypto

Compile and install:

 $ mkdir /opt/python2.5
 $ ./configure --prefix=/opt/python2.5
 $ make $ sudo make install

Finally, after having deployed the appengine framework package, we need to modify shebangs:

 $ cd /path/to/appengine
 $ find . -name '*.py' -exec sed -i "s/#!\/usr\/bin\/env python/#!\/opt\/python2.5\/python/" {} \;
 $ chmod -R 755 .