[ckan-dev] apt-get install python-ckan

James Gardner james at 3aims.com
Fri Feb 18 12:21:54 UTC 2011


Hi everyone,

As part of an ongoing effort to improve installation and deployment of 
CKAN, we've been working towards being able to package up CKAN as .deb 
files for installation on Ubuntu Lucid. I'm pleased to say that today I 
have successfully completed the packaging and that it is now possible to 
install CKAN from our own alpha apt repository. This is quite a 
milestone but I'll make a separate announcement when I feel I've 
mastered the packaging process well enough to be used by people outside 
the core team.

If you are really keen you can look at the docs at:

http://ckan.org/install/

For now the only change for normal users is that the 
``pip-requirements.txt`` file you would usually use to install CKAN's 
dependencies has been broken into three files and all install_requires 
in setup.py have been moved into them. If you want to set up a virtual 
Python install as normal, you will now need to install from each of 
these files like this:

     wget 
https://bitbucket.org/okfn/ckan/raw/default/requires/lucid_missing.txt
     wget 
https://bitbucket.org/okfn/ckan/raw/default/requires/lucid_conflict.txt
     wget 
https://bitbucket.org/okfn/ckan/raw/default/requires/lucid_present.txt
     pip install -r lucid_missing.txt -r lucid_conflict.txt -r 
lucid_present.txt

The reason for the separation is that you may now only want to install 
packages into your virtual environment that aren't already present in 
Lucid. In which case you would do this:

     sudo apt-get install python-psycopg2 python-lxml python-sphinx 
python-pylons python-formalchemy python-repoze.who 
python-repoze.who-plugins python-tempita python-zope.interface
     wget 
https://bitbucket.org/okfn/ckan/raw/default/requires/lucid_missing.txt
     wget 
https://bitbucket.org/okfn/ckan/raw/default/requires/lucid_conflict.txt
     pip install -r lucid_missing.txt -r lucid_conflict.txt

Then you would be using the system libraries where they are available 
and other versions when they are not.

Some software that CKAN uses is more recent than the version in Lucid. 
In these cases the versions we need are added into a ckan-deps package 
which the core CKAN code is now configured to look in before it looks 
for the the version in Lucid. http://bitbucket.org/okfn/ckan-deps

One final point - please be very careful about editing any of the files 
in the /requires directory. Whereas in the past changes were fairly 
harmless they could now potentially be quite costly. Here are some 
guidelines:

If you are adding a new dependency to CKAN make sure that it is already 
present in a standard Lucid configuration. If this is possible, just add 
the dependency to the lucid_present.txt file both in the example at the 
top and in the main part of the file, making sure you set the version 
that Lucid uses so that anyone installing from lucid_present.txt gets 
the same version as they would if they had apt-get installed instead. 
Finally, edit ``doc/deb.rst`` and add your dependency to the line where 
we package CKAN so that it is treated as a CKAN dependency next time we 
use that command to package a new CKAN release.

If the dependency isn't present in Lucid we'll need to make our own 
package of it. Add it to lucid_missing.txt with the source repository 
URL and the exact revision you want packaged. Then let me know you've 
checked in your change and I'll package it up, updating the 
``doc/deb.rst`` file once I've done it.

If you really need a different version from the version in Lucid we'll 
need to add it to ckan-deps. Just add the specific revision from the 
source repository that you want and I'll try to copy that version into 
ckan-deps.

Other points are:

* I haven't tried running the test suite yet
* I'm not an real apt expert (yet), so don't try these packages unless 
you don't mind breaking your machine
* If you want to use openID with sreg extensions you'll need to edit 
your repoze.who file and also install a more recent version of 
repoze.who openid support. See the comments in the who.ini file.
* There are some docs about some of the things I've done to make this 
work at https://bitbucket.org/okfn/ckan/src/d5851ab332bd/doc/deb.rst 
(I'll try to make BuildKit public this weekend)

Cheers,

James







More information about the ckan-dev mailing list