Bibus installation under GNU/linux
Installation of Bibus is a bit tricky. Follow step by step the
following instructions.
- Bibus
installation under GNU/linux
- OpenOffice.org
- Checking if the
python-uno bridge is present
- 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
- Installing Python
from source
- Compiling Python2.2.x
from source
- Compiling Python2.3.x
from source
- Debian users
- Installing wxPython
- Installing a database
engine
- Installing SQLite
- Compiling PySQlite
- Debian users
- Installing
MySQL-python
- Compiling MySQL-python
- Debian users
- 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
- Download from www.openoffice.org an installer.
- If you want to use the python-uno bridge with the
OpenOffice.org software installed with your distribution, download the
same version than the one installed (Mandrake 10.1 and debian, it
should be 1.1.3)
- The last version is actually 1.1.4
- Install it for instance in /opt/OpenOffice.org1.1.4/
- Choose a default install or be sure to select the python-uno
bridge for a custom install
- When asked by Setup/setup.py script, select
/opt/OpenOffice.org1.1.4/program/ as the python-uno bridge location
- Download pyuno-1.1.3-linux-py2.2.tgz
- uncompress it:
- prompt> tar -zxf pyuno-1.1.3-linux-py2.2.tgz
- move the pyuno-1.1.3 directory to the desired location (for
instance in /opt)
- prompt> mv pyuno-1.1.3 /opt/
- Contrary to the python-uno bridge distributed with
OpenOffice.org, the pyuno bridge from http://bibus-biblio.sourceforge.net/
has been compiled with the system python and libraries. This means:
- You must install the libstlport package (libstlport_gcc.so).
- In Debian apt-get libstlport
- The other needed libraries are presumably present but the name
may be slightly different and you may have to make symbolic links.
- /usr/lib/libstdc++.so.5
- /lib/libgcc_s.so.1
- If you have a python-uno bridge installed in your OpenOffice.org
program directory, you must remove it or Bibus may be confused by the
two versions. Either re-install OpenOffice.org by choosing 'custom
intall' and uncheck python-uno bridge or manually delete the files (or
better rename them). The files you have to move way are:
- libpyuno.so
- pythonloader.py (and eventually pythonloader.pyc)
- pyunorc
- pyuno.so
- unohelper.py (and eventually unohelper.pyc)
- uno.py (and eventually uno.pyc)
- Try also to move away, because more recent versions of these
library are presumably present in your system in /lib/ and /usr/lib/
- libstdc++.so.*
- libgcc_s.so.*
- When asked by Setup/setup.py script, select
/opt/pyuno-1.1.3/ as the python-uno bridge location
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.
- To know if you python is compiled with ucs2 or ucs4 do:
- prompt> python2.3
- prompt>>> import sys
- prompt>>> print sys.maxunicode
- if you get : 1114111, your python is UCS4
- if you get : 65535, your python is UCS2 and it should work with
the python-uno bridge. To really test, see below.
If you want to test if your python2.3 works with the python-uno bridge
do the following:
- $PYUNO is the directory containg the python-uno bridge
- $PYUNO = /opt/pyuno-1.1.3/ OR
/usr/local/OpenOffice.org1.1.4/program OR
/opt/OpenOffice.org1.1.4/program
OR ...
- $OOPATH is the program directory contained in the OpenOffice.org
directory.
- $OOPATH = /usr/lib/openoffice/program OR
/usr/local/OpenOffice.org1.1.4/program OR
/opt/OpenOffice.org1.1.4/program OR ...
- If you python-uno bridge has been installed with your
OpenOffice.org, then $PYUNO = $OOPATH, but is may not be the case if
you installed OpenOffice.org with you Debian or Mandrake10 distribution
(/usr/lib/openoffice/program)
- prompt> export PYTHONPATH = $PYTHONPATH:$PYUNO
- prompt> export LD_LIBRARY_PATH = $PYTHONPATH:$OOPATH:$PYUNO
- prompt> python -c 'import uno'
- If you get an error (SystemError: dynamic module not initialized
properly), it is not working presumably because python was configured
with --enable-unicode=ucs4
- You can eventually get:
<>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.
- The stable wxPython is 2.4
- You can use the development series 2.5 with Bibus but don't ask
for help (but report problem in the bugs section of the Bibus site).
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
- pysqlite-1.0.x uses sqlite2 engine
- pysqlite-1.1.x uses sqlite3 engine
- both are compatible with Bibus, but are incompatible with each
other. Make your choice and stick to it.
- You can convert a database between the two format using the
sqlite utilities.
- If sqlite is the command for sqlite2 and sqlite3 for sqlite3
- The following command will convert the sqlite2 database
<sqlite2 db> to a sqlite3 database named <sqlite3 db>
- sqlite <sqlite2 db> .dump | sqlite3 <sqlite3 db>
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