hosted by sflogo.jpg

Installation for mac users

From Bibus

Contents

Mac OS < 10.5

This this the procedure to install bibus under macOS. This procedure is not complete and should be updated

  1. Install:
    • python >=3D 2.3 (the same version that the version in OOo. Normally 2.3)
    • wxpython with unicode support for the correct python version
    • pysqlite version 1.0; 1.1 or 2.0. The best is 2.0
  2. Download bibus.tar.gz and unpack
  3. Open a terminal:
    • cd "bibus installation directory"
    • python bibus.py
  4. Now we have to setup OOo communication
    • Start OOo
    • open in OOo: "bibus_installation_directory"/Setup/UnoConnectionListener.odg (In OOo2.3 you first have to change in the option the macro rights to "Ask for macro from non-certified source")
  5. Starting bibus with OOo communication: Under linux you must set the LD_LIBRARY_PATH variable. I have no idea of what is the equivalent under MacOS. This variable add library to the path when the libs are not in the standard places. What are the standard places for libs under macOSX ?

Installing Bibus on a Mac OS10.5 (Leopard) and MySQL

It seems that with Mac OS 10.5 things have become a bit easier. Python, SQLite and pySQLite are already shipping with the system (They might be on the developer tools only which come on the DVD and which I have installed. I don't use SQLite, however, but need MySQL connection to work with remote servers).

I managed to get at least to start the application, it is not functional yet. Maybe somebody can correct this and help Mac Users to get Bibus running.

Here is what I did:

MySQL

I did not install a "native" MySQL server but used the MAMP system as a backend: http://www.mamp.info/en/index.php

Here is Apple's Info on how to load the mysql client binaries: http://docs.info.apple.com/article.html?artnum=306782

  1. Download the file at http://www.opensource.apple.com/darwinsource/other/MySQL-43.binaries.tar.gz and unpack it
  2. In a terminal, go into the folder
  3. execute "

sudo tar -xzvf MySQL-43.root.tar.gz -C /"

Python MySQL bindings

There are some problems with the MySQLdb bindings of the Python version shipped with the Mac, see http://www.arnebrodowski.de/blog/472-MySQLdb-unter-Mac-OS-10.5-installieren.html

  1. Get mysql-python from https://sourceforge.net/projects/mysql-python
  2. Unzip and open the folder. In the file "site.cfg", you need to configure the "mysql_config" variable like so: "mysql_config = /usr/bin/mysql_config". Or course, uncomment the ligns that you modified.
  3. There is a problem with Python's default enconding (ascii). In python >= 2.5, sitecustomize no longer exists. To turn python's default encoding into 'UTF-8', you have to change (as root)
    /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site.pyFind the ligne "def setencoding():". For lignes after, turn , turn encoding ='ascii' into encoding = "UTF-8".
  4. In the file "_mysql.c", you need to delete the three following lines:
 #ifndef uint 
 #define uint unsigned int
 #endif
  1. Contrary to the how-to mentioned above, creating a symlink seems not necessary
  2. execute "sudo python setup.py install"

Creating Databases

Somehow Bibus did not create the databases for me, so I did it manually:

  1. In your MySQL installation, manually create database "Biblio"
  2. Create tables by executing the sql in db_models/mysql.sql

Configuring Bibus

Create a file Makefile.MacOSX in the Setup folder with a text editor (vim or Emacs). Insert the following text:

# you presumably will only have to change the three first lines below
DESTDIR = /Applications/Bibus.app/Contents
python = /usr/bin/python
oopath = /Applications/OpenOffice.org.app/Contents/MacOS,~/Applications/OpenOffice.org.app
/Contents/MacOS,/Applications/NeoOffice.app/Contents/MacOS,~/Applications/NeoOffice.app/Co
ntents/MacOS
#
prefix = $(DESTDIR)
exec_prefix = $(prefix)/MacOS
bindir = $(exec_prefix)
datadir = $(prefix)/Resources
sysconfdir = $(datadir)
mandir = $(datadir)/man
man1dir = $(mandir)/man1
define install-files
        install -d $(bindir) $(datadir) $(sysconfdir) $(mandir) $(man1dir) $(datadir)/Bibu
s\ Help 
        install *.py MySQL_Bibus.ini $(bindir)
        for dir in bibMSW Data db_models Export FirstStart Format Import MySQL_Setup Style
Editor FirstStart bibOOo db_models Pixmaps Setup StyleEditor wxg ; do \
                find -d $$dir ! -path '*CVS*' -a -type d -exec install -d $(bindir)/'{}' '
;' ; \
        done
        for dir in bibMSW Data db_models Export FirstStart Format Import MySQL_Setup Style
Editor FirstStart bibOOo db_models Pixmaps Setup StyleEditor wxg ; do \
                find -d $$dir ! -path '*CVS*' -a -type f -exec install '{}' $(bindir)/'{}'
 ';' ; \
        done

        # locale files. We look for all the directory in locale/
        for dir in $(wildcard locale/*); do \
                if [ $$dir ] && [ $$dir != "locale/CVS" ] && [ $$dir != "bibus.pot" ] ; th
en \
                        install -d -m664 $(datadir)/$$dir/LC_MESSAGES/ ; \
                        install -m664 $$dir/LC_MESSAGES/bibus.mo $(datadir)/$$dir/LC_MESSA
GES/ ; \
                fi; \
        done
        ln -s $(datadir)/locale $(bindir)/

        # bibus.config
        install bibus.config $(sysconfdir)/
        # Create PkgInfo file.
        echo "APPL????" > $(DESTDIR)/PkgInfo
        # Create information property list file (Info.plist).
        touch $(DESTDIR)/Info.plist
        chmod 755 $(DESTDIR)/Info.plist
        echo '<?xml version="1.0" encoding="UTF-8"?>' >> $(DESTDIR)/Info.plist
        echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.ap
ple.com/DTDs/PropertyList-1.0.dtd">' >> $(DESTDIR)/Info.plist
        echo '<plist version=\"1.0\">' >> $(DESTDIR)/Info.plist
        echo '<dict>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleDevelopmentRegion</key>' >> $(DESTDIR)/Info.plist
        echo '  <string>English</string>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleExecutable</key>' >> $(DESTDIR)/Info.plist
        echo '  <string>'bibus.sh'</string>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleInfoDictionaryVersion</key>' >> $(DESTDIR)/Info.plist
        echo '  <string>6.0</string>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundlePackageType</key>' >> $(DESTDIR)/Info.plist
        echo '  <string>APPL</string>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleSignature</key>' >> $(DESTDIR)/Info.plist
        echo '  <string>????</string>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleVersion</key>' >> $(DESTDIR)/Info.plist
        echo '  <string>1.0</string>' >> $(DESTDIR)/Info.plist
        echo '  <key>CSResourcesFileMapped</key>' >> $(DESTDIR)/Info.plist
        echo '  <true/>' >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleGetInfoString</key>'  >> $(DESTDIR)/Info.plist
        echo '  <string>Bibus 1.2.11 GNU – GNU-FDL</string>'  >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleHelpBookFolder</key>'  >> $(DESTDIR)/Info.plist
        echo '  <string>Bibus Help</string>'  >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleName</key>'  >> $(DESTDIR)/Info.plist
        echo '  <string>Bibus</string>'  >> $(DESTDIR)/Info.plist
        echo '  <key>CFBundleShortVersionString</key>'  >> $(DESTDIR)/Info.plist
        echo '  <string>1.2.11</string>'  >> $(DESTDIR)/Info.plist
        echo '</dict>' >> $(DESTDIR)/Info.plist
        echo '</plist>'  >> $(DESTDIR)/Info.plist

        # man page
        install -m644 Setup/bibus.1 $(mandir)/

        # freedesktop icon and shortcut
        install -m664 Pixmaps/bibus.png Setup/bibus.desktop $(datadir)/
        echo 'Exec=$(bindir)/bibus' >> $(datadir)/bibus.desktop
        echo 'Icon=$(datadir)/bibus.png' >> $(datadir)/bibus.desktop

        # bibus command
        install Setup/UnoConnectionListener.odg *.py MySQL_Bibus.ini $(bindir)/
        ln -sf $(datadir)/bibusStart.py $(bindir)/bibus
        chmod 755 $(bindir)/bibus
        touch $(bindir)/bibus.sh
        echo '#!/bin/sh' > $(bindir)/bibus.sh
        echo 'export DYLD_LIBRARY_PATH="/Applications/OpenOffice.org.app/Contents/MacOS:/u
sr/lib:$DYLD_LIBRARY_PATH"'
        echo 'exec /usr/bin/python /Applications/Bibus.app/Contents/MacOS/bibus.py' >> $(b
indir)/bibus.sh
        chmod 775 $(bindir)/bibus.sh

        # copying doc files
        install -d $(datadir)/Bibus\ Help
        cp -R Docs/html/* $(datadir)/Bibus\ Help/
        ln -s $(datadir)/Bibus\ Help $(bindir)/Docs

        # generating bibus.cfg file
        echo '[PATH]' > $(datadir)/bibus.cfg
        echo 'python = $(python)' >> $(datadir)/bibus.cfg
        echo 'oopath = $(oopath)' >> $(datadir)/bibus.cfg
        echo 'docdir = $(datadir)/Bibus\ Help' >> $(datadir)/bibus.cfg
        echo 'licence = $(datadir)/Bibus\ Help/copying' >> $(datadir)/bibus.cfg
        echo 'localedir = $(datadir)/locale' >> $(datadir)/bibus.cfg
        echo 'systemconf = $(sysconfdir)/bibus.config' >> $(datadir)/bibus.cfg
        ln -s $(datadir)/bibus.cfg $(bindir)
endef

define compile
        # compile recursively all the python files located in $(bindir)/
        $(python) -c "import compileall ; compileall.compile_dir('$(bindir)/')"
        $(python) -O -c "import compileall ; compileall.compile_dir('$(bindir)/')"
endef

install-files:
        $(install-files)

install:
        $(install-files)
        $(compile)

        # write uninstaller in $(datadir)/Setup/uninstall.sh
                echo "#!/bin/sh" > $(bindir)/uninstall.sh
                echo "rm -rf $(DESTDIR)" >> $(bindir)/uninstall.sh
        chmod 744 $(bindir)/uninstall.sh
        # end uninstaller

You can change the bibus settings in bibus.cfg:

 oopath = /Applications/OpenOffice.org.app/Contents/MacOS</tt> or /Applications/NeoOffice.app/Contents/MacOS/
 BIBbase.DB_STARTUP = 1		    # 0 = last used db used at startup. 1 = default db
 BIBbase.DB_TYPE ='MySQL'         # type of database used 'MySQL','SQlite', etc... => modules dbBibMySQL,dbBibSQLite, etc...
 

Since I use a MAMP MySQL server, the socket entry is

 BIBbase.SOCKET = '/Applications/MAMP/tmp/mysql/mysql.sock' 

See http://sfbloggr.blogspot.com/2007/10/nachtrag-vorbereitungen-fr-os-x-105.html for other cases.

I created a user bibus with password bibus who had access to the "Biblio" database and entered the following configuration values:

 BIBbase.PORT = 3306
 BIBbase.HOST = 'localhost'
 BIBbase.USER = u'bibus'
 BIBbase.PASSWORD = u'bibus'

However, it would still connect with my system user name and ask the password, so I had to create a user in the database that corresponded with my system user name.

If you have OpenOffice3.org Aqua installed, this path becomes : /Applications/OpenOffice.org.app/Contents/MacOS/ In order to configure bibus to interact with Neo/ OpenOffice3.org Aqua, you will need later to acces his program directory. Make a symlink as root in the console, e.g. by typing $: ln -s /Applications/OpenOffice.org.app/Contents/MacOS /Volumes/Your-HD-Name/program

Go to the bibus folder and run as root: make -f Setup/Makefile.MacOSX. A MacOS-like application will be created in the Applications folder. So now, you may remove the bibus source folder. Double-click on the Bibus Application and Bibus starts.

Connecting Bibus to your database

If your settings doesn't allow you to access to your database from Bibus, you can change these into Bibus. Edition > Preferences. Click on "Préférences avancées" below left. Choose "Base" to change your database settings. Menu File > Connect ("Fichier > Se connecter"). You can now insert new references.

Import worked with the Medline format (Sqlite -> medline. Menu File > Import > Medline) but the Identifier Field was corrupted.

Connecting to your database with NeoOffice or OpenOffice

You have two ways to do it : ODBC or JDBC. The mysql-connector-odbc doesn't work very well yet. You can better choose the mysql-connector-jdbc.

Connecting to your data base with ODBC

You have to install an ODBC driver for your database.

Before to open the ODBC administrator (/Applications/Utlities/ODBC Administrator), a few steps are needed.

  • $: chmod 664 /Library/ODBC/odbc*) in order to make possible to create a system DSN. You can revert it by typing $: chmod 644 /Library/ODBC/odbc*. Don't worry, ODBC Administrator fails very often. If you changed the permissions, it will still fail but after saving your modifications.

Open the ODBC Administrator application. You have first to declare what driver are available. If you have mysql-connector-odbc, you can skip to the next step. For SQLite, click on Driver > Add… In the driver file field, type /usr/local/lib/libsqlite3odbc.so. In the configuration file field, type the same (/usr/local/lib/libsqlite3odbc.so). Define it as "system" (available for the entier system).

Declare your datasources in DSN users or DNS system, e.g. DSN system > Add… Choose the driver for your database type (in my case "MySQL ODBC 5.1 Driver" becaus MySQL ODBC 3 fails). Configure the acces to your database. If your using MAMP :

Data Source Name : Biblio
Server : localhost                            #default
User : Biblio
Password : ••••
Database : Biblio

In the Connect options,

Port : 8889 #(depending on MAMP. MySQL default port : 3306)
Socket : /Applications/MAMP/tmp/mysql/mysql.sock
Character Set : utf8

You can test the connection. If it works, the your database will be available for OpenOffice.org or NeoOffice.

For SQLite : you just have to give a name of your DNS. DNS Users/System > Add… Type any name (you will chose your database file later).

Connecting to your database with JDBC

Unpack it and remember the location of the driver file (e.g. mysql-connector-java-<version>-bin.jar or sqlitejdbc-v43-native.jar).

Connecting NeoOffice/OpenOffice.org to your database

ODBC users, skip this step. JDBC Users choose in OpenOffice or NeoOffice in the menu Tools > Options… > OpenOffice.org/NeoOffice > Java > Class path… and select your JDBC driver.

In OpenOffice.org/NeoOffice, create a new database. Choose to connect to an existing database. Select MySQL, ODBC or JDBC.

  • JDBC
URL of the database Driver class
mysql://localhost/Biblio org.gjt.mm.mysql.Driver
mysql://localhost/Biblio com.sun.star.sdbc.JDBCDriver (doesn't work)
sqlite:///Path-to-your-database org.sqlite.JDBC



  • MySQL
    • JDBC: Type the informations about the server of your database as in the DSN declaration
    • ODBC : Type the DSN name
  • ODBC : type the DSN name

Current Status

  • The application starts, and new references can be inserted with Bibus. These references can be inserted in Neo/OpenOffice.org but not with Bibus.
  • Importing fails, message is "Table tmp_import does not exist
  • OpenOffice in Bibus menu doesn't work yet

Please edit this how-to if you know what has do be done differently.

Personal tools