Debian

From GnuCash
Revision as of 23:07, 20 September 2006 by Cortana (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Enabling HBCI on Debian

Gnucash uses the AqBanking library talk to banks with HBCI. Unfortunately, due to licensing incompatibilities, the packages shipped by Debian are not allowed to make use of the AqBanking library.

The Debian bug tracking this specific issue is #303234. General information as suchabout why the OpenSSL license (used by OpenSSL which AqBanking makes use of) is incompatible with the GNU General Public License (used by Gnucash) can be found at The OpenSSL License and the GPL.

Fortunately, it is easy to rebuild the gnucash package on your own machine so that it uses libaqbanking, and so gains HBCI support.

Instructions

These instructions apply to version 2.0.1-2 of Debian's gnucash package. As time marches on and the package is updated, it will diverge from the specific details of the instructions. The steps will continue to be broadly similar, however, and in fact can be applied to any Debian package that you may wish to alter.

Install packages required to build Debian packages, packages required to build the gnucash package, and the AqBanking development library.

# apt-get install build-essential devscripts fakeroot libaqbanking16-dev
# apt-get build-dep gnucash

If libaqbanking16-dev can not be found, try asking apt to install libaqbanking-dev--apt should then tell you which package you really need.

Make a directory to work in and download the gnucash source code:

$ mkdir gnucash
$ cd gnucash
$ apt-get source gnucash

Now, you must edit the debian/rules file to enable HBCI support.

$ cd gnucash-2.0.1
$ editor debian/rules

Find where gnucash's configure script is invoked, and add --enable-hbci --enable-mt940 to the configure script's arguments. When I did this I found it on line 24. I changed the line to read:

env LDFLAGS="-L/usr/X11R6/lib" GUILE=/usr/bin/guile-1.6 CFLAGS="$(CFLAGS)" ./configure 
--disable-static --sysconfdir=/etc --prefix=/ usr --mandir=/usr/share/man 
--infodir=/usr/share/info --libexecdir=/usr/lib -- libdir=/usr/lib/gnucash --enable-ofx 
--disable-error-on-warning --enable-hbci --enable-mt940 || cat config.log

Optional, but recommended: make a node of the changes you have made in the package's changelog. You can edit debian/changelog manually, but the devscripts package contains a utility to automate the process:

$ debchange --nmu 'Enable HBCI support'

It is a good idea to do this for two reasons. First of all, it will cause the package's version to be higher than the package in the Debian archive; this will prevent apt from installing Debian's own packages when you next upgrade; second, when you wonder in six months time "what changes did I make to that package?" you can check by examining the /usr/share/doc/gnucash/changelog.Debian.gz file.

Now we are ready to build the package.

$ dpkg-buildpackage -b -us -uc -rfakeroot

This is where you make a cup of tea (or go and watch the Lord of the Rings trilogy if you have a slow computer). Once the process is complete:

$ cd ..
$ dpkg --install gnucash_*.deb gnucash-common_*.deb

Finally, free up a few hundred MB of disk space by removing the directory where the package was built:

$ rm -r gnucash-2.0,1