Debian

From GnuCash
Revision as of 23:42, 20 September 2006 by Cortana (talk | contribs)
Jump to: navigation, search

Installing GnuCash on Debian

The name of the GnuCash package in Debian is gnucash. The easiest way to install it is to run apt-get install gnucash.

Enabling HBCI on Debian

In order to communicate with banks using the HBCI protocol, GnuCash uses the AqBanking library. Unfortunately, due to licensing incompatibilities, the packages shipped by Debian are not allowed to make use of this library. The Debian bug tracking this issue is #303234.

Fortunately, support for HBCI can easily by re-enabled. This is done by rebuilding the gnucash package on your own machine, enabling the use of AqBanking in the process.

Build instructions

These instructions apply to version 2.0.1-2 of Debian's gnucash package, running on Debian 4.0 ("etch"). 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.

To begin with, install the packages that are required to build any Debian package, the packages that are required to build the gnucash package, the package for the AqBanking development library and a couple of other packages that we will use below.

# 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 and extract 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:

  1. The version of your packages will be higher than the version of the packages in the Debian archive. This will prevent apt from installing Debian's own packages when you next upgrade.
  2. 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, if you have a slow computer, go and watch the Lord of the Rings trilogy). 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