Differences between revisions 2 and 3
Revision 2 as of 2011-09-11 07:29:10
Size: 2537
Editor: FrankPolte
Comment:
Revision 3 as of 2022-04-05 01:53:10
Size: 0
Editor: mkoeppe
Comment: outdated
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Using couchdb in sagemath =

For using couchdb you need to recompile the sagemath-python with ssl-support. This is quite easy:

 * Download the python package e.g: python-2.6.4.p11.spkg
 * wether you use the safe part (first) or do it directly (second)

 * first way
  1. rename it to: '''python-2.6.4.p11.tar.bz2'''
  2. unpack it

 * second way
  1. '''unp python-2.6.4.p11.spkg'''

 * edit the Setup.Dist like it is explained here: http://www.webtop.com.au/blog/compiling-python-with-ssl-support-fedora-10-2009020237

== This is the interesting part ==

----
{{{#!highlight python

Now I had to modify the file Modules/Setup.dist in the Python source (mine was located in /usr/local/src/Python-2.6.1). Change the following lines (highlighted in red).
> vi Modules/Setup.dist
...

206 # CSV file helper
207 #_csv _csv.c
208
209 # Socket module helper for socket(2)
210 _socket socketmodule.c
211
212 # Socket module helper for SSL support; you must comment out the other
213 # socket line above, and possibly edit the SSL variable:
214 #SSL=/usr/local/ssl
215 _ssl _ssl.c \
216 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
217 -L$(SSL)/lib -lssl -lcrypto
218
219 # The crypt module is now disabled by default because it breaks builds
220 # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
221 #
222 # First, look at Setup.config; configure may have set this for you.
223
224 #crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
}}}
----

 * uncomment line 210 and 215-217. Maybe in your version the line numbers are different.

 * pack it again with: '''tar -cjf python-2.6.4.p11.spkg ./python-2.6.4.p11/'''
 * now you need to force the install in sage with: '''/usr/local/sage-4.7.1/sage -f python-2.6.4.p11.spkg''' (change it to your path!!)

== now you can install the couchdb python package ==;

 * start the sagemath sh-mode: '''/usr/local/sage-4.7.1/sage -sh'''
 * now there should be: ''(sage subshell) centre:~ root$''
 * here you need to do e.g just: '''easy_install http://pypi.python.org/packages/2.6/C/CouchDB/CouchDB-0.8-py2.6.egg#md5=b47f8fe5f0c76d7c45bf8e4805d43de4'''

The link for the current version you will find here: http://pypi.python.org/pypi/CouchDB

If you want to use a local couchdb-Server you will have to install it on your local machine.
For debian/ubuntu do '''sudo apt-get install couchdb''' in a terminal.

For getting started: http://packages.python.org/CouchDB/index.html