Bug 84970 - gpgme compile error message is unclear
Summary: gpgme compile error message is unclear
Status: RESOLVED DUPLICATE of bug 83086
Alias: None
Product: kmail
Classification: Unmaintained
Component: general (show other bugs)
Version: 1.6.82
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-11 23:41 UTC by Tom Albers
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch for /kdepim/configure (736 bytes, patch)
2004-07-11 23:42 UTC, Tom Albers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Albers 2004-07-11 23:41:15 UTC
Version:           1.6.82 (using KDE 3.2.91 (3.3 beta1), compiled sources)
Compiler:          gcc version 3.3.4 (Debian 1:3.3.4-3)
OS:                Linux (i686) release 2.6.5-1-k7

Hi,

When compiling ./configure gave the warning:
----------------
Consider downloading gpgme >= 0.4.5 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
or use the --with-gpgme-prefix=/path/where/gpgme/is/installed option.
----------------

Wel, took your advice and downloaded and installed it. It gave me the message:
-------
GPGME v0.4.7 has been configured as follows:

        GnuPG version: min. 1.2.2
        GnuPG path:    /usr/local/bin/gpg

        GpgSM version: min. 1.9.6
        GpgSM path:    no
---

Well, I just took the path here and put it in the --with-gpgme-prefix thing. That did not work. /usr/local/bin did not work, it seems you have to use /usr/local/ as a path.

Could you make the error as in:
---
Consider downloading gpgme >= 0.4.5 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
if you have installed it, please give the base path, for example if gpg is located at /usr/local/bin/gpg please use the --with-gpgme-prefix=/usr/local/ option.
--

I'll add a patch for /kdepim/configure against beta 1 sources.
Comment 1 Tom Albers 2004-07-11 23:42:08 UTC
Created attachment 6631 [details]
patch for /kdepim/configure
Comment 2 David Faure 2004-07-12 13:32:20 UTC
On Sunday 11 July 2004 23:41, Tom Albers wrote:
> Well, I just took the path here and put it in the --with-gpgme-prefix thing. That did not work. /usr/local/bin did not work, it seems you have to use /usr/local/ as a path.
> 
> Could you make the error as in:
> ---
> Consider downloading gpgme >= 0.4.5 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
> if you have installed it, please give the base path, for example if gpg is located at /usr/local/bin/gpg please use the --with-gpgme-prefix=/usr/local/ option.

You're confusing gpg and gpgme.
gpg is the binary
gpgme is a library.
gpgme looks for gpg on configure (as you saw). You can tell it where to find it if needed.

kdepim's configure looks for gpgme (the library) and ships its own if you don't have it.
So when you install gpgme into some prefix, you have to give that prefix to --with-gpgme-prefix.
By default the prefix is /usr/local, just like most other free software source packages out there.
This has nothing to do with where gpg itself is located.

Note also that the warning from configure said "A or B" but you did A _and_ B :)
Wasn't gpgme found in /usr/local automatically, without passing any --with-gpgme-prefix option?
If not, then that would be the bug, I guess.

Comment 3 Tom Albers 2004-07-12 14:08:41 UTC
Ok. I'm totally confused, that's right ;-). I don't understand all the different options in the settings/security and the options in the composer.

Updating from kde 3.2.x to beta 1 resulted in not being able to sign (broken pipe and 'unable to sign for unknow reason') and I'm unsure how to solve those, but there are some BR about it, so I'm going to try those options, that's why I'm recompiling anyway. 

The warning was given without the --with-gpgme-prefix=/usr/local/ and was not given when I passed --with-gpgme-prefix=/usr/local/ I did not try --with-gpgme-prefix without anything.

Tom
Comment 4 David Faure 2004-07-12 15:11:37 UTC
> Updating from kde 3.2.x to beta 1 resulted in not being able to sign (broken pipe and 'unable to sign for unknow reason') and I'm unsure how to solve those, but there are some BR about it, so I'm going to try those options, that's why I'm recompiling anyway. 
Make sure you're running gpg-agent before kmail.
For instance add
`eval gpg-agent`
in your startkde.

We're still working on a solution that won't require manual configuration, but
for the moment this is necessary.

> The warning was given without the --with-gpgme-prefix=/usr/local/
Ah so it doesn't look there by default for you. That's because /usr/local/bin isn't in your PATH...
Easily fixed.

Index: configure.in.in
===================================================================
RCS file: /home/kde/kdepim/libkdenetwork/gpgmepp/configure.in.in,v
retrieving revision 1.18
diff -u -p -r1.18 configure.in.in
--- configure.in.in     13 Jun 2004 22:54:03 -0000      1.18
+++ configure.in.in     12 Jul 2004 13:09:17 -0000
@@ -13,7 +13,7 @@ AC_DEFUN([_KDEPIM_PATH_GPGME_CONFIG],
   if test "x$gpgme_config_prefix" != x ; then
      gpgme_config_path="$gpgme_config_prefix/bin"
   else
-     gpgme_config_path="$PATH"
+     gpgme_config_path="$PATH:/usr/local"
   fi
   AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no, $gpgme_config_path)


Comment 5 David Faure 2004-07-12 15:15:47 UTC
On Monday 12 July 2004 15:11, David Faure wrote:
> +     gpgme_config_path="$PATH:/usr/local"
Ooops I meant /usr/local/bin of course. Committed to CVS.

Comment 6 Tom Albers 2004-07-12 15:29:02 UTC
I was searching for gpg-agent, but Debian does not have a package with that binary. I[1] think I need pinentry-qt, but I'll have to check if this works.

[1] http://groups.google.nl/groups?hl=nl&lr=&ie=UTF-8&threadm=2392w-8ai-17%40gated-at.bofh.it&rnum=10&prev=/groups%3Fq%3Dgpg-agent%2Bdebian%26hl%3Dnl%26lr%3D%26ie%3DUTF-8%26sa%3DN%26scoring%3Dd
Comment 7 David Faure 2004-07-12 15:50:23 UTC
> I was searching for gpg-agent

Hmm, either you have gnupg-1.9.x and you have gpg-agent as part of it,
or you have gnupg-1.2.x and maybe(?) there's no gpg-agent needed?
Then the problem isn't the lack of gpg-agent, but something else...

Comment 8 Tom Albers 2004-07-13 00:21:28 UTC
Well I've been working on this for the whole evening and I can't get it to work. While compiling I've written down what I've done in a sort of howto for other users, maybe you can make remove some errors and place it on the site, because I can't get it to work. It's still giving me the broken pipe when signing even when applying the patch. I realise this is probably a gnupg and a gpgme bug...
----
To get KMail to sign messages, please follow these steps:

1)
You need to have a good version of GnuPG. We advise to download to download 
from GnuPG 1.9.9 from 
ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-1.9.9.tar.gz 
Extract the archive 

2)
Download this patch: http://bugs.kde.org/attachment.cgi?id=6428&action=view
and apply it (patch < /path/filename)

3) run ./configure; 
It should return:
------------
    GnuPG v1.9.9 has been configured as follows:

        Platform:  GNU/Linux (i686-pc-linux-gnu)

        OpenPGP:   yes
        S/MIME:    yes
        Agent:     yes
        Smartcard: yes (no pkcs#15)

        Protect tool:     (default)
        Default agent:    (default)
        Default pinentry: (default)
        Default scdaemon: (default)
        Default dirmngr:  (default)
-----------
run make and make install to install GnuPG

2) Download gpgme-0.4.7 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
After extracting and running ./configure it shoudl return:
-----------
        GPGME v0.4.7 has been configured as follows:

        GnuPG version: min. 1.2.2
        GnuPG path:    /usr/local/bin/gpg

        GpgSM version: min. 1.9.6
        GpgSM path:    /usr/local/bin/gpgsm
-----------

Run make and make install to install

3. In kdepim, please run:
./configure
This should end without warning. If there is a warning about gpgme at the end, 
there is something wrong. If you have installed kde in a different directory, 
please make sure that there is no pgpme-config file in that three. If there 
is, you should remove it and make a link to /usr/local/bin/gpgme-config and 
run ./configure again. An other option is to use  --with-gpgme-prefix or 
--with-gpgme-prefix =/usr/local/bin if you have used a different directory.

Run make, close all kdepim applications and run make install.

4. Start the gpg-agent with eval `gpg-agent --daemon`, put it in your  
startkde. You have to have the environment variables within KDE, I think you 
should reboot... Ah well, I warned you....
[This does not work for me at all. I'm unable to run this as a user and the environment isn't ok wherever I put it, I've seen the thread on  https://intevation.de/roundup/aegypten/issue88 and I'm one of those users who can't get it right. I fire it up as root and copy the variable to a user terminal and use that to start kmail as a work around]

5. Start KGPG and go to the settings, in the GnuPG-settings, please activate 
the option 'use GnuPG-agent'. Restart KGPG. If you get a warning that the 
agent is not running the environment variable is probably not known or the 
agent is not running. 

6. Start KMail and go to the settings. In the security section go to the 
crypto-backend tab, let KMail scan. It should return ok. Select OpenPGP. Now 
you should be able to sign messages.
------------
Comment 9 David Faure 2004-07-13 00:46:10 UTC
On Tuesday 13 July 2004 00:21, Tom Albers wrote:
> 4. Start the gpg-agent with eval `gpg-agent --daemon`, put it in your  
> startkde. You have to have the environment variables within KDE, I think you 
> should reboot... Ah well, I warned you....
Not reboot, just logout and login again.

> [This does not work for me at all. I'm unable to run this as a user and the environment isn't ok wherever I put it, I've seen the thread on  https://intevation.de/roundup/aegypten/issue88 and I'm one of those users who can't get it right. I fire it up as root and copy the variable to a user terminal and use that to start kmail as a work around]
I think you didn't edit startkde correctly then...
If you're using kdebase from CVS (or 3.3-beta1), you can simply put
the gpg-agent command in ~/.kde/env/agents.sh
Otherwise, editing startkde is the only solution. Make sure it's relatively at the top,
in particular before the kdeinit call.

You still get the broken pipe although you applied the patch to gnupg-1.9.9 correctly
and gpg-agent is running !!??! That's the setup I have here and it definitely works...
Hmm, maybe you need to configure more things, I'm not sure what the default are:

In ~/.gnupg/gpg.conf make sure a line says "use-agent".
In ~/.gnupg/gpg-agent.conf make sure it says:

pinentry-program /usr/local/bin/pinentry-qt
no-grab
default-cache-ttl 1800

If any of that helps, I'll try to find where to set some better defaults so that 
no manual intervention is needed....

Comment 10 David Faure 2004-07-13 13:51:51 UTC
On Tuesday 13 July 2004 00:21, Tom Albers wrote:
> 1)
> You need to have a good version of GnuPG. We advise to download to download 
> from GnuPG 1.9.9 from 
> ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-1.9.9.tar.gz 

It turns out that I gave wrong advice.
gnupg-1.9.9 is required for S/MIME support (provided by the gpgsm binary).

But for OpenPGP support, you need the gpg binary from gnupg-1.3.x (the latest seems to be 1.3.6)
http://lists.gnupg.org/pipermail/gnupg-announce/2004q2/000168.html

The gnupg developers are about to release a 1.2.5 version soon, to provide 
the needed support in the stable 1.2 branch.

Comment 11 Tom Albers 2004-07-13 17:25:15 UTC
I'll join that thread, it's basically the same problem. If you need more info from my side, let me know.

*** This bug has been marked as a duplicate of 83086 ***