By sivakumar on Dec 15, 2008
Postbooks from xTuple is an open source edition of their ERP and Accounting software. They have their GUI client available for Linux, Windows and Mac. No Solaris though. With the required components for Postbook, namely Postgres and Trolltech Qt, is known to work in OpenSolaris, I took a plunge to get the GUI client working on my OpenSolaris 2008.11.
It was not very tough to get it going. We need to set up OS 0811 to get it going. First, install SunStudio and family by installing the 'ss-dev' pkg.
pfexec pkg install ss-dev
Next in line is Postgres. I decided on installing version 8.3, even though Postbooks will work with 8.2 also. There is a list of packages that is required for 8.3.
pfexec pkg install -v SUNWpostgr-83-server SUNWpostgr-83-libs SUNWpostgr-83-client \\
SUNWpostgr-jdbc SUNWpostgr-83-docs SUNWpostgr-83-contrib SUNWpostgr-83-devel \\
SUNWpostgr-83-pl SUNWpostgr-83-tcl SUNWpgbouncer-pg83
As for the Qt version 4, I took the easy way out by using spec-files-extra (SFE) to build Qt for me. Please see Building JDS on OpenSolaris for instructions to set up the build environment for building Qt out of SFE. The SFEqt4.spec file, has to be tweaked for building the required Postgres SQL driver plugin, that is required for Postbooks. In the spec files directory, there is a subdirectory called 'ext-sources'. Within that, edit the file 'qt4-solaris-cc-ss12' and change the QMAKE_CXXFLAGS and QMAKE_LIBS variables as follows.
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -library=stlport4 -I/usr/postgres/8.3/include
QMAKE_LIBS = -L/usr/postgres/8.3/lib -R/usr/postgres/8.3/lib
Now, build and install SFEqt4.spec.
/opt/jdsbld/bin/pkgtool -v --download --autodeps build SFEqt4.spec
This will install two packages SFEqt4 and SFEqt4-devel in your system. Now on to the next step of building Postbooks.
Postbooks GUI client requires the source code for OpenRPT, which is an open sourced SQL report writer. Download it from OpenRPT sourceforge site. Since, Qt4 is built using SunStudio, there is a small change required for OpenRPT to get it built on SunStudio. In the file OpenRPT/renderer/graph.cpp, change line 780 to look like these two lines.
When extracting OpenRPT source code, you will have a directory like 'openrpt-3.0.0Beta-source', or something like that. Create a symbolic link 'openrpt' for it.
ln -s openrpt-3.0.0Beta-source openrpt
This is required as the GUI client looks for 'openrpt' at some level above its source directory. Then build the client, by running 'qmake' followed by 'gmake'.
Next is GUI client itself. Download the source from Postbooks sourceforge site. Extract it at the same level as that of 'openrpt'. For building under SunStudio, one file needs to be changed. Edit the file 'xtuple/guiclient/postPurchaseOrdersByAgent.cpp', line 90, to replace '__PRETTY_FUNCTION__' with the name of the method itself (hardcode with ::sPost). The build procedure is the same as above: 'qmake' followed by 'gmake'.
Now the GUI client can be launched by 'bin/xtuple'. I encountered a missing 'libiconv.so.2' library. I overcame this by running
env LD_LIBRARY_PATH=/usr/gnu/lib bin/xtuple
I know, using LD_LIBRARY_PATH is unsafe. May be including '/usr/gnu/lib' in the spec file change might solve this problem.
Now you should see the login screen and you should be able to log in to the configured Postgres database. Here is the obligatory screenshot.
Hope this was helpful for you. Comments and feedback are most welcome.