What I did to make a portable calibre on my usb drive is the following:
Create a bat file with the following contents
@echo off
set CALIBRE_CONFIG_DIRECTORY=%cd%\config
cd calibre
calibre.exe --with-library ..\calibre-db
exit
In the same folder, make the following folders: calibre, calibre-db, config.
Copy calibre into the "calibre" folder.
Your book database will be in the calibre-db folder and config files in calibre-db.
You can start calibre from the bat file and it should just work.
I still need to make a unix script for this but it should be very similar.