Difference between revisions of "Debian"

From GnuCash
Jump to: navigation, search
(recompile libaqbanking to enable aqofxconnect)
Line 3: Line 3:
 
The name of the GnuCash package in Debian and Ubuntu is [http://packages.debian.org/gnucash gnucash]. The easiest way to install it is to run <tt>apt-get install gnucash</tt>.
 
The name of the GnuCash package in Debian and Ubuntu is [http://packages.debian.org/gnucash gnucash]. The easiest way to install it is to run <tt>apt-get install gnucash</tt>.
  
== Creating a package with HBCI enabled ==
+
== Creating packages with HBCI and aqofxconnect enabled ==
  
 
In order to communicate with banks using the [[HBCI]] protocol, GnuCash uses the AqBanking library. Unfortunately, due to [http://www.gnome.org/~markmc/openssl-and-the-gpl.html licensing incompatibilities], the packages shipped by Debian are not allowed to make use of this library. The Debian bug tracking this issue is [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=303234 #303234].
 
In order to communicate with banks using the [[HBCI]] protocol, GnuCash uses the AqBanking library. Unfortunately, due to [http://www.gnome.org/~markmc/openssl-and-the-gpl.html licensing incompatibilities], the packages shipped by Debian are not allowed to make use of this library. The Debian bug tracking this issue is [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=303234 #303234].
Line 11: Line 11:
 
These instructions apply to version '''2.0.1-2''' of [http://packages.debian.org/src:gnucash Debian's gnucash package], running on '''Debian 4.0 ("etch")'''.  They also apply to '''Ubuntu Edgy''' gnucash version '''2.0.1-3ubuntu3'''. 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.
 
These instructions apply to version '''2.0.1-2''' of [http://packages.debian.org/src:gnucash Debian's gnucash package], running on '''Debian 4.0 ("etch")'''.  They also apply to '''Ubuntu Edgy''' gnucash version '''2.0.1-3ubuntu3'''. 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.
  
 +
Additionally you need to recompile libaqbanking.
  
 
=== Downloading prerequisites ===
 
=== Downloading prerequisites ===
Line 16: Line 17:
 
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:
 
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:
  
<pre># sudo apt-get install build-essential devscripts fakeroot libaqbanking16-dev
+
<pre># sudo apt-get install build-essential devscripts fakeroot libaqbanking16-dev aqbanking16-qt-wizard
# sudo apt-get build-dep gnucash</pre>
+
# sudo apt-get build-dep gnucash libaqbanking</pre>
  
 
If libaqbanking16-dev can not be found, try asking apt to install '''libaqbanking-dev'''. Apt should then tell you which package you really need.  Or try searching for libaqbanking on [http://packages.debian.org packages.debian.org] or [http://packages.ubuntu.com packages.ubuntu.com] to find the correct version.  Try [http://packages.debian.org/cgi-bin/search_packages.pl?keywords=libaqbanking&searchon=names&subword=1&version=all&release=all] or [http://packages.ubuntu.com/cgi-bin/search_packages.pl?searchon=names&subword=1&version=edgy&release=all&keywords=libaqbanking].
 
If libaqbanking16-dev can not be found, try asking apt to install '''libaqbanking-dev'''. Apt should then tell you which package you really need.  Or try searching for libaqbanking on [http://packages.debian.org packages.debian.org] or [http://packages.ubuntu.com packages.ubuntu.com] to find the correct version.  Try [http://packages.debian.org/cgi-bin/search_packages.pl?keywords=libaqbanking&searchon=names&subword=1&version=all&release=all] or [http://packages.ubuntu.com/cgi-bin/search_packages.pl?searchon=names&subword=1&version=edgy&release=all&keywords=libaqbanking].
Line 25: Line 26:
 
<pre>$ mkdir gnucash
 
<pre>$ mkdir gnucash
 
$ cd gnucash
 
$ cd gnucash
$ apt-get source gnucash</pre>
+
$ apt-get source gnucash libaqbanking</pre>
  
=== Configuring ===
+
=== Gnuash ===
 +
==== Configuring ====
  
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:
+
The source code for gnucash will now be extracted to a directory named '''gnucash-2.x.x'''. Now, we enable HBCI support. To do this, edit the '''debian/rules''' file:
  
<pre>$ cd gnucash-2.0.1
+
<pre>$ cd gnucash-2.*
 
$ editor debian/rules</pre>
 
$ editor debian/rules</pre>
  
Line 52: Line 54:
 
If this is not the desired result, you can apply a hold to the gnucash package.  See below for more information.
 
If this is not the desired result, you can apply a hold to the gnucash package.  See below for more information.
  
=== Building ===
+
==== Building ====
  
 
Now we are ready to build the package.
 
Now we are ready to build the package.
Line 80: Line 82:
 
   Optional components....: ofx hbci mt940</pre>
 
   Optional components....: ofx hbci mt940</pre>
  
=== Completing the install ===
+
==== Completing the install ====
  
 
<pre>$ cd ..
 
<pre>$ cd ..
Line 94: Line 96:
  
 
More information about this can be found at [http://www.debian-administration.org/articles/332 debian-administration.org] and [http://www.debian.org/doc/manuals/apt-howto/ The APT Howto]
 
More information about this can be found at [http://www.debian-administration.org/articles/332 debian-administration.org] and [http://www.debian.org/doc/manuals/apt-howto/ The APT Howto]
 +
 +
=== libaqbanking ===
 +
 +
==== Configuring ====
 +
 +
The source code for libaqbanking will now be extracted to a directory named '''libaqbanking-2.x.x'''. Now, we enable aqofxconnect support. To do this, edit the '''debian/rules''' file:
 +
 +
<pre>$ cd libaqbanking-2.*
 +
$ editor debian/rules</pre>
 +
 +
And add aqofxconnect to the list of backends.
 +
 +
i.e. from:
 +
 +
<pre>DEB_CONFIGURE_EXTRA_FLAGS := --disable-static --with-backends="aqhbci aqdtaus aqgeldkarte" --with-frontends="cbanking g2banking qbanking kbanking"</pre>
 +
 +
to:
 +
 +
<pre>DEB_CONFIGURE_EXTRA_FLAGS := --disable-static --with-backends="aqhbci aqdtaus aqgeldkarte aqofxconnect" --with-frontends="cbanking g2banking qbanking kbanking"</pre>
 +
 +
<pre>debchange --nmu 'Enable aqofxconnect'</pre>
 +
 +
==== Building ====
 +
 +
<pre>$ debuild</pre>
 +
 +
Look for aqofxconnect:
 +
 +
<pre>Summary
 +
----------------------------------------------------
 +
AqBanking version  : 2.2.3.0-stable
 +
Supported backends : aqhbci aqdtaus aqgeldkarte aqofxconnect
 +
Supported frontends: cbanking g2banking qbanking kbanking</pre>
 +
 +
==== Installing ====
 +
 +
<pre>$ cd ..
 +
# sudo dpkg --install libaqbanking16-dev_*.deb libaqhbci10_*.deb  libaqdtaus3_*.deb  libqbanking4_*.deb  libaqbanking16_*.deb libg2banking2_*.deb  libkbanking1_*.deb  libaqgeldkarte4_*.deb  libaqbanking-data_*.deb  libcbanking16_*.deb</pre>
 +
 +
Optional:
 +
 +
<pre>$ rm -r libaqbanking-2.*</pre>
 +
 +
<pre>$ echo "libaqbanking16-dev hold" | sudo dpkg --set-selections</pre>
  
 
== Enabling debugging symbols ==
 
== Enabling debugging symbols ==

Revision as of 06:22, 27 December 2006

Installing GnuCash on Debian

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

Creating packages with HBCI and aqofxconnect enabled

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.

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

Additionally you need to recompile libaqbanking.

Downloading prerequisites

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:

# sudo apt-get install build-essential devscripts fakeroot libaqbanking16-dev aqbanking16-qt-wizard
# sudo apt-get build-dep gnucash libaqbanking

If libaqbanking16-dev can not be found, try asking apt to install libaqbanking-dev. Apt should then tell you which package you really need. Or try searching for libaqbanking on packages.debian.org or packages.ubuntu.com to find the correct version. Try [1] or [2].

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

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

Gnuash

Configuring

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

$ cd gnucash-2.*
$ 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 strongly recommended: make a note of the changes you have made in the package's changelog. The devscripts package contains a utility to automate the process:

$ debchange --nmu 'Enable HBCI support'

This enables a few nice behaviors for your package.

  1. 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.
  2. The version of the package you are building will be slightly higher than the version of the packages in the Debian or Ubuntu archive. This will prevent apt from overwriting the new package with the old package from the archives. If a new version of gnucash is packaged by the Debian or Ubuntu package maintainers, it will be installed over the package we are building here. (You would then have to repeat these instructions.)

If this is not the desired result, you can apply a hold to the gnucash package. See below for more information.

Building

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). If you want to verify that you did everything correctly, the command will output a bunch of "checking for ..." lines right at the beginning. Look for the lines

checking whether to use OFX... yes -- failure is fatal
checking for libofx version >= 0.7.0... found 0.8.0
checking for libofx/libofx.h... yes
checking for libofx... yes
configure: WARNING: MT940 importing support is enabled but is totally experimental!
checking for aqbanking >= "1.3.0"... yes
checking HBCI_CFLAGS...  
checking HBCI_LIBS... -laqbanking  
checking for aqbanking >= "1.0.0"... yes
checking HBCI_CFLAGS...  
checking HBCI_LIBS... -laqbanking

Also, at the end of all the checking, configure will output a summary report. Notice the ofx, hbci, and mt940 in the Optional Components line.

Options detected/selected
  -------------------------
  gnucash version ...... : 2.0.1
  Build for host ....... : i686-pc-linux-gnu
  Optional components....: ofx hbci mt940

Completing the install

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

Finally, free up a few hundred MB of disk space (after verifying that gnucash works as expected) by removing the directory where the package was built:

$ rm -r gnucash-2.0.1

If you want to hold the package at the current version and prevent new upstream package versions from being installed, apt allows you to apply a hold to a package. This will prevent apt from doing anything with the package. One way to apply a hold (it can also be done in the various package manager guis) is by running:

$ echo "gnucash hold" | sudo dpkg --set-selections

More information about this can be found at debian-administration.org and The APT Howto

libaqbanking

Configuring

The source code for libaqbanking will now be extracted to a directory named libaqbanking-2.x.x. Now, we enable aqofxconnect support. To do this, edit the debian/rules file:

$ cd libaqbanking-2.*
$ editor debian/rules

And add aqofxconnect to the list of backends.

i.e. from:

DEB_CONFIGURE_EXTRA_FLAGS := --disable-static --with-backends="aqhbci aqdtaus aqgeldkarte" --with-frontends="cbanking g2banking qbanking kbanking"

to:

DEB_CONFIGURE_EXTRA_FLAGS := --disable-static --with-backends="aqhbci aqdtaus aqgeldkarte aqofxconnect" --with-frontends="cbanking g2banking qbanking kbanking"
debchange --nmu 'Enable aqofxconnect'

Building

$ debuild

Look for aqofxconnect:

Summary
----------------------------------------------------
AqBanking version  : 2.2.3.0-stable
Supported backends : aqhbci aqdtaus aqgeldkarte aqofxconnect
Supported frontends: cbanking g2banking qbanking kbanking

Installing

$ cd ..
# sudo dpkg --install libaqbanking16-dev_*.deb libaqhbci10_*.deb  libaqdtaus3_*.deb  libqbanking4_*.deb  libaqbanking16_*.deb libg2banking2_*.deb  libkbanking1_*.deb  libaqgeldkarte4_*.deb  libaqbanking-data_*.deb  libcbanking16_*.deb

Optional:

$ rm -r libaqbanking-2.*
$ echo "libaqbanking16-dev hold" | sudo dpkg --set-selections

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