Creation date: 2004.05.28
Last revision: 2004.06.02

**************
** Preamble **
**************
1) You must have the python-uno bridge installed.
   It is normally installed by default if you use OpenOffice.org > 1.1
   To know if it is installed try in a console:
	prompt> $OO/program/python
   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.
	>>>

2) If it is not the case.
   Restart OpenOffice.org installation, choose 'custom install' and
   check that the python-uno bridge is indeed checked for installation.

3) As you see, the python installed by OpenOffice.org is 2.2.2 (linux)
   and it is compiled with GCC 3.2.2
   For the installation to work, you must use below the "same" python than OpenOffice.org
   (or a bug fix like 2.2.3)
   and a "compatible" GCC (in my case 3.3.3 was fine).
   If you have problem, try to use exactly the same versions.

************************
** Short installation **
************************

If the packages do exist in your distribution, install:

1) Python 2.2.x
2) wxPython >= 2.4 If possible with unicode and gtk2 (linux) support.
   (Don't use 2.5 for the moment except for Windows98, it will crash).
3) Either MySQL-python or pySQLite
4) ODBC
5) ODBC driver for MySQL and/or SQLite

In Debian the following packages must be installed:
	python2.2-xmlbase
	python2.2-sqlite   ! does not contains unicode support. If you need it install from source.
	python2.2-mysqldb
	python2.2-dev	(needed below to compile wxPython)
	python2.2
	libmyodbc
	odbcinst1
	unixodbc
In addition, in debian you will have to compile wxPython
   since it does not exist for python2.2 (and you want unicode support)
   and to download and install the odbc driver for mysqlite (see below).

Configuring your python installation to use the python-uno bridge
-----------------------------------------------------------------
You must set the environment variables PATH and PYTHONPATH
   to $OO/program (normally "/usr/local/OpenOffice.org1.1.1/program").
There are several ways to do that.
The simpliest solution is to use the supplied bibus.sh script.
Just eventually edit the OO variable line 2.
To start bibus, double click on bibus.sh (eventually make it executable chmod +x)

***********************************
** Longer installation procedure **
***********************************

If some of the packages are missing in your distribution or if you want to compile them
  (this is particularly the case of wxPython since unicode and gtk2 support
   are not activated in most distributions).

Below, python2.2 is the command to start your distribution python2.2 interpreter.
  You may need to include the correct path in front of it.

**************
** wxPython **
**************
Bibus has been developped with wxPython2.4.2.4
I have tested with the newly release 2.5.1.5 version and it works except for some glitches
	a) Error messages are displayed in the console instead of a dialog.
           I will try to fix that.
           It has presumably something to do with wxLog which is not correctly initialized
              to wxLogGui as needed.
           If you know how to correct this, please let me know.
	b) Don't choose "Expert mode" in the search dialogs, it will crash.
I thus don't recommend you to use wxPython2.5 until it is fixed
(I found the problems but I have to change the code in order to turn around the wxPython bugs
or wait for them to be fixed).

The following procedure will compile and install wxPython 2.4 with unicode and gtk2 support.

This is from wxPythonSrc-2.4.2.4/README.1st.txt

1) export WXPREF=/opt/wxPython		# or another place
2) tar -zxf wxPythonSrc-2.4.2.4.tgz
2) cd wxPythonSrc-2.4.2.4
3) mkdir build 				#if it does not exist !
4) cd build
5) ../configure --with-gtk --prefix=$WXPREF --enable-rpath=$WXPREF/lib --with-opengl --enable-geometry --enable-optimise --enable-debug_flag --enable-gtk2 --enable-unicode
6) make
7) as root : make install		# root needed in order to have write permission to $WXPREF
8) cd ../wxPython
9) as root :
	export WXPREF=/opt/wxPython
	python2.2 setup.py WX_CONFIG=$WXPREF/bin/wx-config WXPORT=gtk2 UNICODE=1 build install

******************
** MySQL-python **
******************
You need MySQL developement files

1) http://sourceforge.net/projects/mysql-python. Download MySQL-python-0.9.2.tar.gz
2) tar -zxf MySQL-python-0.9.2.tar.gz ; cd MySQL-python-0.9.2
3) python2.2 setup.py build
4) as root :
	python2.2 setup.py install

***************
** PySQLlite **
***************
1) http://pysqlite.sourceforge.net/. Download pysqlite-0.5.0.tar.gz
2) tar -zxf pysqlite-0.5.0.tar.gz ; cd pysqlite-0.5.0
3) python2.2  setup.py build
4) as root :
	python2.2 setup.py install

**********
** 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

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




