Bibus installation under GNU/linux

Installation of Bibus is a bit tricky. Follow step by step the following instructions.
  1. Bibus installation under GNU/linux
    1. OpenOffice.org
      1. Checking if the python-uno bridge is present
      2. Installing OpenOffice.org software with the python-uno bridge
      3. Installing the pyuno bridge from http://bibus-biblio.sourceforge.net/
    2. Checking if your python2.3 is compatible with the python-uno bridge
    3. Installing Python from source
      1. Compiling Python2.2.x from source
      2. Compiling Python2.3.x from source
      3. Debian users
    4. Installing wxPython
    5. Installing a database engine
      1. Installing SQLite
        1. Compiling PySQlite
        2. Debian users
      2. Installing MySQL-python
        1. Compiling MySQL-python
        2. Debian users
    6. Optional: ODBC

OpenOffice.org

OpenOffice.org software has presumably been installed with your linux distribution. It may however not contain the python-uno bridge needed by Bibus to communicate with OpenOffice.org (this is the case in Debian and Mandrake 10).

Checking if the python-uno bridge is present

In a console, type:
>> cd /usr/lib/openoffice/program	# you may have to change the path depending on your linux distribution
>> ./python.sh

You should get:

Python 2.2.2 (#1, Jul 21 2003, 15:13:13)
[GCC 3.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
If it is installed, go to the next step, otherwise install OpenOffice.org or download the bridge from http://bibus-biblio.sourceforge.net/

Installing OpenOffice.org software with the python-uno bridge

Installing the pyuno bridge from http://bibus-biblio.sourceforge.net/

Checking if your python2.3 is compatible with the python-uno bridge

Most modern distribution contains python2.3 as the default python and don't propose to use python2.2. The python-uno bridge is compatible with python2.3 is you system python has been configured with the option --enable-unicode=ucs2. This is not the case of the Debian python2.3.
If you want to test if your python2.3 works with the python-uno bridge do the following:
<>RuntimeWarning: Python C API version mismatch for module pyuno: This Python has API version 1012, module pyuno has version 1011. import pyuno
This means that the python-uno bridge was compiled for python2.2 but it seems to be fine. You can eventually download a version compiled for python2.3 from http://bibus-biblio.sourceforge.net/. This however does not solve the --enable-unicode=ucs4 problem used to compile most python2.3.

Installing Python from source

The python-uno bridge included with OpenOffice.org works with python2.2.x and sometimes with python2.3. If you cannot use python2.3, you must install python2.2. Most modern distribution contains python2.3 and it is not possible to download a python2.2 compiled binary and you must compile it from source.

Compiling Python2.2.x from source

Download from www.python.org Python-2.2.x.tgz
> tar -zxf Python-2.2.3.tgz
> cd Python-2.2.3
> ./configure
> make
> su -c "make altinstall" # this will preserve your previous python install
> Password: <enter password>


You should now be able to start python2.2 with:
> python2.2
Python 2.2.3+ (#1, Nov 11 2004, 22:28:26)
[GCC 3.3.5 (Debian 1:3.3.5-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

If it is not the case, check your PATH variable or use the complete path ('/usr/local/bin/python2.2')

Compiling Python2.3.x from source

Download from www.python.org Python-2.3.x.tgz
> tar -zxf Python-2.3.x.tgz
> cd Python-2.3.x
> ./configure --enable-unicode=ucs2 --enable-shared
> make
> su -c "make altinstall" # this will preserve your previous python install
> Password: <enter password>

Debian users

The Debian python2.3 does not work with the python-uno bridge because it has been configured with the option --enable-unicode=ucs4.
Thanks to the debian team, you can install python2.2 using apt-get:
python2.2-xmlbase
python2.2-dev (needed to compile some additional modules)
python2.2

Installing wxPython

wxPython is the GUI library used by Bibus. You absolutely need it to run Bibus. I strongly recommend to use a version for gtk2 that supports unicode.
If you are using python2.3, there is presumably a package in your distribution.
For python2.2 you may have to compile it from source.
Download wxPythonSrc-2.4.2.4.tgz from http://www.wxpython.org

> export WXPREF=/opt/wxPython # or another place
> tar -zxf wxPythonSrc-2.4.2.4.tgz
> cd wxPythonSrc-2.4.2.4
> mkdir build # if it does not exist !
> cd build
> ../configure --with-gtk --prefix=$WXPREF --enable-rpath=$WXPREF/lib --with-opengl --enable-geometry --enable-optimise --enable-debug_flag --enable-gtk2 --enable-unicode
> make
> su # root access needed if you don't have write permission to WXPREF (/opt/wxPython)
> Password: <root password>
> make install
> cd ../wxPython
> export WXPREF=/opt/wxPython
> python2.2 setup.py WX_CONFIG=$WXPREF/bin/wx-config WXPORT=gtk2 UNICODE=1 build install
> exit
You should now have a working wxPython distribution included in your python2.2

Installing a database engine

Bibus can use both MySQL or SQLite.
For a multiuser installation, MySQL is presumably the best but mysql-python IS NOT COMPATIBLE WITH MYSQL >=4.1. You must use MySQL 3.x.y or 4.0.x
For a single user install, SQLite is easier to configure and does not require a deamon.

Installing SQLite

From http://pysqlite.sourceforge.net/. Download pysqlite-1.0.x.tgz or pysqlite-1.1.x.tgz

Compiling PySQlite

> tar -zxf pysqlite-1.X.X.tgz
> cd pysqlite-1.X.X
> python2.2 setup.py build
> su -c "python2.2 setup.py install"
> Password: <root password>

Debian users

apt-get python2.2-sqlite
I however did not check recently this package. I had in the past problems with unicode support. I you get errors when using non ascii characters, recompile it from source.

Installing MySQL-python

MySQL-python is NOT compatible with MySQL >= 4.1

Compiling MySQL-python

You need to have MySQL developement files installed
Download from http://sourceforge.net/projects/mysql-python, MySQL-python-1.x.tgz
> tar -zxf MySQL-python-1.x.tar.gz
> cd MySQL-python-1.x
> python2.2 setup.py build
> su -c "python2.2 setup.py install"
> Password: <root password>

Debian users

apt-get python2.2-mysqldb

Optional: ODBC

If you want to be able to use the classical OpenOffice.org interface to insert references, you must install odbc.

This is presumably available in your linux distribution. In debian you need to install
libmyodbc - MySQLodbc driver
odbcinst1 - Support library and helper program for accessing odbc ini files
unixodbc - ODBC tools libraries
If you use sqlite, you must install sqlite-odbc from http://www.ch-werner.de/sqliteodbc/

For MySQL : http://dev.mysql.com/doc/mysql/en/ODBC.html
For SQLite : http://www.ch-werner.de/sqliteodbc/

It is then easy to configure odbc using for instance gODBCConfig.

On my system :
*******************
** /etc/odbc.ini **
*******************
empty file

***********************
** /etc/odbcinst.ini **
***********************
[MySQL]
Description = MySQL driver
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
CPTimeout =
CPReuse =
FileUsage = 1

[SQLite]
Description=SQLite ODBC Driver
Driver=/usr/local/lib/libsqliteodbc.so
Setup=/usr/local/lib/libsqliteodbc.so

*****************
** ~/.odbc.ini **
*****************
[MySQL-Biblio]
Description = MySQL Bibliographic database
Driver = MySQL
Server = localhost
Database = Biblio

[Test]
Description = SQLite
Driver = SQLite
Database = /home/pmartino/biblio.sqlite
Timeout = 2000
StepAPI = No