<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>LinuxInstall</title> </head> <body> <h1 style="text-align: center;"><a class="mozTocH1" name="mozTocId722804"></a>Bibus installation under GNU/linux<br> </h1> Installation of Bibus is a bit tricky. Follow step by step the following instructions.<br> <ol id="mozToc"> <!--mozToc h1 1 h2 2 h3 3 h4 4 h5 5 h6 6--><li><a href="#mozTocId722804">Bibus installation under GNU/linux </a> <ol> <li><a href="#mozTocId754888">OpenOffice.org</a> <ol> <li><a href="#mozTocId494898">Checking if the python-uno bridge is present</a></li> <li><a href="#mozTocId510916">Installing OpenOffice.org software with the python-uno bridge </a></li> <li><a href="#mozTocId825115">Installing the pyuno bridge from http://bibus-biblio.sourceforge.net/</a></li> </ol> </li> <li><a href="#mozTocId183447">Checking if your python2.3 is compatible with the python-uno bridge </a></li> <li><a href="#mozTocId734264">Installing Python from source </a> <ol> <li><a href="#mozTocId303187">Compiling Python2.2.x from source</a></li> <li><a href="#mozTocId453858">Compiling Python2.3.x from source </a></li> <li><a href="#mozTocId549732">Debian users</a></li> </ol> </li> <li><a href="#mozTocId839387">Installing wxPython</a></li> <li><a href="#mozTocId450461">Installing a database engine</a> <ol> <li><a href="#mozTocId131866">Installing SQLite</a> <ol> <li><a href="#mozTocId672674">Compiling PySQlite</a></li> <li><a href="#mozTocId994206">Debian users</a></li> </ol> </li> <li><a href="#mozTocId444507">Installing MySQL-python</a> <ol> <li><a href="#mozTocId803351">Compiling MySQL-python</a></li> <li><a href="#mozTocId943320">Debian users</a></li> </ol> </li> </ol> </li> <li><a href="#mozTocId405500">Optional: ODBC</a></li> </ol> </li> </ol> <br> <h2><a class="mozTocH2" name="mozTocId754888"></a>OpenOffice.org<br> </h2> 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).<br> <h3><a class="mozTocH3" name="mozTocId494898"></a>Checking if the python-uno bridge is present</h3> In a console, type:<br> <pre>>> cd /usr/lib/openoffice/program # you may have to change the path depending on your linux distribution<br>>> ./python.sh<br><br>You should get:<br><br>Python 2.2.2 (#1, Jul 21 2003, 15:13:13) <br>[GCC 3.2.2] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>><br></pre> If it is installed, go to the <a href="#mozTocId734264">next step</a>, otherwise <a href="#mozTocId510916">install OpenOffice.org</a> or <a href="#mozTocId825115">download the bridge</a> from <a href="http://bibus-biblio.sourceforge.net/">http://bibus-biblio.sourceforge.net/</a> <h3><a class="mozTocH3" name="mozTocId510916"></a>Installing OpenOffice.org software with the python-uno bridge<br> </h3> <ul> <li>Download from www.openoffice.org an installer. <br> </li> <ul> <li>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)<br> </li> </ul> <ul> <li>The last version is actually 1.1.4</li> </ul> <li>Install it for instance in /opt/OpenOffice.org1.1.4/</li> <li>Choose a default install or be sure to select the python-uno bridge for a custom install</li> <li>When asked by Setup/setup.py script, select /opt/OpenOffice.org1.1.4/program/ as the python-uno bridge location<br> </li> </ul> <h3><a class="mozTocH3" name="mozTocId825115"></a>Installing the pyuno bridge from <a href="http://bibus-biblio.sourceforge.net/">http://bibus-biblio.sourceforge.net/</a></h3> <ul> <li>Download pyuno-1.1.3-linux-py2.2.tgz</li> <li>uncompress it: <br> </li> <ul> <li>prompt> tar -zxf pyuno-1.1.3-linux-py2.2.tgz</li> </ul> <li>move the pyuno-1.1.3 directory to the desired location (for instance in /opt)<br> </li> <ul> <li>prompt> mv pyuno-1.1.3 /opt/</li> </ul> <li>Contrary to the python-uno bridge distributed with OpenOffice.org, the pyuno bridge from <a href="http://bibus-biblio.sourceforge.net/">http://bibus-biblio.sourceforge.net/</a> has been compiled with the system python and libraries. This means:</li> <ul> <li>You must install the libstlport package (libstlport_gcc.so). <br> </li> <ul> <li>In Debian apt-get libstlport</li> </ul> <li>The other needed libraries are presumably present but the name may be slightly different and you may have to make symbolic links.</li> <ul> <li>/usr/lib/libstdc++.so.5</li> <li>/lib/libgcc_s.so.1</li> </ul> </ul> <li>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:</li> <ul> <li>libpyuno.so</li> <li>pythonloader.py (and eventually pythonloader.pyc)</li> <li>pyunorc</li> <li>pyuno.so</li> <li>unohelper.py (and eventually unohelper.pyc)</li> <li>uno.py (and eventually uno.pyc)</li> <li>Try also to move away, because more recent versions of these library are presumably present in your system in /lib/ and /usr/lib/<br> </li> <ul> <li>libstdc++.so.*</li> <li>libgcc_s.so.*<br> </li> </ul> </ul> <li>When asked by Setup/setup.py script, select /opt/pyuno-1.1.3/ as the python-uno bridge location</li> </ul> <h2><a class="mozTocH2" name="mozTocId183447"></a>Checking if your<span style="font-weight: bold;"> </span>python2.3<span style="font-weight: bold;"></span> is compatible with<span style="font-weight: bold;"> </span>the python-uno bridge <br> </h2> 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.<br> <ul> <li>To know if you python is compiled with ucs2 or ucs4 do:</li> <li>prompt> python2.3</li> <li>prompt>>> import sys</li> <li>prompt>>> print sys.maxunicode</li> <li>if you get : 1114111, your python is UCS4</li> <li>if you get : 65535, your python is UCS2 and it should work with the python-uno bridge. To really test, see below.<br> </li> </ul> If you want to test if your python2.3 works with the python-uno bridge do the following:<br> <ul> <li>$PYUNO is the directory containg the python-uno bridge <br> </li> <ul> <li>$PYUNO = /opt/pyuno-1.1.3/ OR /usr/local/OpenOffice.org1.1.4/program OR /opt/OpenOffice.org1.1.4/program OR ...<br> </li> </ul> <li>$OOPATH is the program directory contained in the OpenOffice.org directory.</li> <ul> <li>$OOPATH = /usr/lib/openoffice/program OR /usr/local/OpenOffice.org1.1.4/program OR /opt/OpenOffice.org1.1.4/program OR ...</li> </ul> <li>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)</li> <li>prompt> export PYTHONPATH = $PYTHONPATH:$PYUNO</li> <li>prompt> export LD_LIBRARY_PATH = $PYTHONPATH:$OOPATH:$PYUNO</li> <li>prompt> python -c 'import uno'</li> <li>If you get an error (SystemError: dynamic module not initialized properly), it is not working presumably because python was configured with --enable-unicode=ucs4</li> <li>You can eventually get: <br> </li> </ul> <pre><>RuntimeWarning: Python C API version mismatch for module pyuno: This Python has API version 1012, module pyuno has version 1011. import pyuno<br></pre> 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 <a href="http://bibus-biblio.sourceforge.net/">http://bibus-biblio.sourceforge.net/</a>. This however does not solve the --enable-unicode=ucs4 problem used to compile most python2.3.<br> <h2><a class="mozTocH2" name="mozTocId734264"></a>Installing Python from source<br> </h2> The python-uno bridge included with OpenOffice.org works with python2.2.x and <a href="#mozTocId274681">sometimes</a> 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 <a href="#mozTocId303187">compile it from source</a>.<br> <h3><a class="mozTocH3" name="mozTocId303187"></a>Compiling Python2.2.x from source</h3> Download from www.python.org<span style="font-family: monospace;"> </span>Python-2.2.x.tgz <pre>> tar -zxf Python-2.2.3.tgz<br>> cd Python-2.2.3<br>> ./configure<br>> make<br>> su -c "make altinstall" # this will preserve your previous python install<br>> Password: <enter password><br><br><br>You should now be able to start python2.2 with:<br>> python2.2<br>Python 2.2.3+ (#1, Nov 11 2004, 22:28:26) <br>[GCC 3.3.5 (Debian 1:3.3.5-2)] on linux2<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>><br><br>If it is not the case, check your PATH variable or use the complete path ('/usr/local/bin/python2.2')<br></pre> <h3><a class="mozTocH3" name="mozTocId453858"></a>Compiling Python2.3.x from source <br> </h3> <pre>Download from www.python.org<span style="font-family: monospace;"> </span>Python-2.3.x.tgz</pre> <pre>> tar -zxf Python-2.3.x.tgz<br>> cd Python-2.3.x<br>> ./configure --enable-unicode=ucs2 --enable-shared<br>> make<br>> su -c "make altinstall" # this will preserve your previous python install<br>> Password: <enter password></pre> <h3><a class="mozTocH3" name="mozTocId549732"></a>Debian users</h3> The Debian python2.3 does not work with the python-uno bridge because it has been configured with the option --enable-unicode=ucs4.<br> Thanks to the debian team, you can install python2.2 using apt-get:<br> <pre>python2.2-xmlbase<br>python2.2-dev (needed to compile some additional modules)<br>python2.2<br></pre> <span style="font-family: monospace;"></span> <h2><a class="mozTocH2" name="mozTocId839387"></a>Installing wxPython</h2> 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. <br> <ul> <li>The stable wxPython is 2.4</li> <li>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).</li> </ul> If you are using python2.3, there is presumably a package in your distribution.<br> For python2.2 you may have to compile it from source. <pre>Download wxPythonSrc-2.4.2.4.tgz from http://www.wxpython.org<br><br>> export WXPREF=/opt/wxPython # or another place<br>> tar -zxf wxPythonSrc-2.4.2.4.tgz<br>> cd wxPythonSrc-2.4.2.4<br>> mkdir build # if it does not exist !<br>> cd build<br>> ../configure --with-gtk --prefix=$WXPREF --enable-rpath=$WXPREF/lib --with-opengl --enable-geometry --enable-optimise --enable-debug_flag --enable-gtk2 --enable-unicode<br>> make<br>> su # root access needed if you don't have write permission to WXPREF (/opt/wxPython)<br>> Password: <root password><br>> make install<br>> cd ../wxPython<br>> export WXPREF=/opt/wxPython<br>> python2.2 setup.py WX_CONFIG=$WXPREF/bin/wx-config WXPORT=gtk2 UNICODE=1 build install<br>> exit<br></pre> You should now have a working wxPython distribution included in your python2.2<br> <h2><a class="mozTocH2" name="mozTocId450461"></a>Installing a database engine</h2> Bibus can use both MySQL or SQLite.<br> 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<br> For a single user install, SQLite is easier to configure and does not require a deamon.<br> <h3><a class="mozTocH3" name="mozTocId131866"></a>Installing SQLite</h3> From http://pysqlite.sourceforge.net/. Download pysqlite-1.0.x.tgz or pysqlite-1.1.x.tgz<br> <ul> <li>pysqlite-1.0.x uses sqlite2 engine</li> <li>pysqlite-1.1.x uses sqlite3 engine</li> <li>both are compatible with Bibus, but are incompatible with each other. Make your choice and stick to it.</li> <li>You can convert a database between the two format using the sqlite utilities.<br> </li> <ul> <li>If sqlite is the command for sqlite2 and sqlite3 for sqlite3</li> <li>The following command will convert the sqlite2 database <sqlite2 db> to a sqlite3 database named <sqlite3 db></li> </ul> <ul> <li>sqlite <sqlite2 db> .dump | sqlite3 <sqlite3 db></li> </ul> </ul> <h4><a class="mozTocH4" name="mozTocId672674"></a>Compiling PySQlite</h4> <pre>> tar -zxf pysqlite-1.X.X.tgz<br>> cd pysqlite-1.X.X<br>> python2.2 setup.py build<br>> su -c "python2.2 setup.py install"<br>> Password: <root password><br></pre> <h4><a class="mozTocH4" name="mozTocId994206"></a>Debian users</h4> <pre>apt-get python2.2-sqlite</pre> 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.<br> <h3><a class="mozTocH3" name="mozTocId444507"></a>Installing MySQL-python</h3> <span style="color: rgb(255, 0, 0);">MySQL-python is NOT compatible with MySQL >= 4.1</span><br> <h4><a class="mozTocH4" name="mozTocId803351"></a>Compiling MySQL-python</h4> You need to have MySQL developement files installed<br> <pre>Download from http://sourceforge.net/projects/mysql-python, MySQL-python-1.x.tgz<br>> tar -zxf MySQL-python-1.x.tar.gz<br>> cd MySQL-python-1.x<br>> python2.2 setup.py build<br>> su -c "python2.2 setup.py install"<br>> Password: <root password><br></pre> <h4><a class="mozTocH4" name="mozTocId943320"></a>Debian users</h4> <pre>apt-get python2.2-mysqldb</pre> <h2><a class="mozTocH2" name="mozTocId405500"></a>Optional: ODBC</h2> If you want to be able to use the <a href="bibus_doc.html#mozTocId720200">classical OpenOffice.org</a> interface to insert references, you must install odbc.<br> <br> This is presumably available in your linux distribution. In debian you need to install <br> libmyodbc - MySQLodbc driver<br> odbcinst1 - Support library and helper program for accessing odbc ini files<br> unixodbc - ODBC tools libraries<br> If you use sqlite, you must install sqlite-odbc from http://www.ch-werner.de/sqliteodbc/<br> <br> For MySQL : http://dev.mysql.com/doc/mysql/en/ODBC.html<br> For SQLite : http://www.ch-werner.de/sqliteodbc/<br> <br> It is then easy to configure odbc using for instance gODBCConfig.<br> <br> On my system :<br> *******************<br> ** /etc/odbc.ini **<br> *******************<br> empty file<br> <br> ***********************<br> ** /etc/odbcinst.ini **<br> ***********************<br> [MySQL]<br> Description = MySQL driver<br> Driver = /usr/lib/odbc/libmyodbc.so<br> Setup = /usr/lib/odbc/libodbcmyS.so<br> CPTimeout = <br> CPReuse = <br> FileUsage = 1<br> <br> [SQLite]<br> Description=SQLite ODBC Driver<br> Driver=/usr/local/lib/libsqliteodbc.so<br> Setup=/usr/local/lib/libsqliteodbc.so<br> <br> *****************<br> ** ~/.odbc.ini **<br> *****************<br> [MySQL-Biblio]<br> Description = MySQL Bibliographic database<br> Driver = MySQL<br> Server = localhost<br> Database = Biblio<br> <br> [Test]<br> Description = SQLite<br> Driver = SQLite<br> Database = /home/pmartino/biblio.sqlite<br> Timeout = 2000<br> StepAPI = No<br> <br> <br> <br> <br> <br> </body> </html>