Debian

From GnuCash
Revision as of 12:05, 22 September 2006 by Cortana (talk | contribs) (Enabling debugging symbols)
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, the specific details of these instructions will become outdated, so be prepared to search for newer packages (e.g., libaqbanking17-dev instead of libaqbanking-16.dev) or use higher version numbers (e.g., 2.0.2 instead of 2.0.1) as necessary.

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 make use of in the instructions 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

The source code will now be extracted to a directory named gnucash-2.0.1. Now, we enable HBCI support. To do this, edit the debian/rules file:

$ cd gnucash-2.0.1
$ editor debian/rules

This is a makefile that specifies how to build the gnucash packages. 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

Enabling debugging symbols

The procedure is similar to the one above:

# apt-get install build-essential fakeroot devscripts
# apt-get build-dep gnucash
$ mkdir gnucash
$ cd gnucash
$ apt-get source gnucash
$ cd gnucash-2.0.1
$ editor debian/rules

Now add the --enable-debug option to the arguments of the configure script.

$ debchange --nmu 'Enable debugging'
$ DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -b -us -uc -rfakeroot
$ cd ..
# dpkg --install gnucash_*.deb gnucash-common_*.deb