Change prefix in gpgconf

Paeglis Gatis Gatis.Paeglis at theqtcompany.com
Wed Nov 11 17:49:16 CET 2015


I know all that. I will try to explain with another example:

1) Company A builds a toolchain with some custom tools and provides this toolchain for installation. The same toolchain contains gpgconf with some hardcoded path (provided with the --prefix
    when building the toolchain).

2) Each user can install this toolchain in any path they want. 

If the hardcoded location was /opt/toolchain

But user installs in

/home/username/board-x/toolchain  <----- gpgconf won't be able to find binaries.

Does this clarify the problem? 

________________________________________
From: Werner Koch <wk at gnupg.org>
Sent: Wednesday, November 11, 2015 5:27 PM
To: Paeglis Gatis
Cc: gnupg-devel at gnupg.org
Subject: Re: Change prefix in gpgconf

On Wed, 11 Nov 2015 14:56, Gatis.Paeglis at theqtcompany.com said:
> I know about the --prefix from GNU std.
> The problem here is that gpgconf can not be reallocated.

I doubt that.  Let's see:

  $ /home/wk/s/gnupg/configure \
        --sysconfdir=/etc --enable-maintainer-mode --disable-ntbtls \
        --enable-g13 --prefix=/home/wk/fooroot

  $ make

  $ tools/gpgconf
  gpg:GPG for OpenPGP:/home/wk/fooroot/bin/gpg2
  gpg-agent:GPG Agent:/home/wk/fooroot/bin/gpg-agent
[...]

  $ tools/gpgconf --list-dirs
  sysconfdir:/etc/gnupg
  bindir:/home/wk/fooroot/bin
  libexecdir:/home/wk/fooroot/libexec
  libdir:/home/wk/fooroot/lib/gnupg
[...]


Thus gpg knows very well where to find its comrades.  (The --sysconfdir
option is just a standard one of mine, you would not use it.)  I have
not installed the software but using DESTDIR does not rebuild the
binaries.

The code to retrieve for example the bin dir is in common/homedir.c and
pretty simple for Unix:

  const char *
  gnupg_bindir (void)
  {
  [...]
  #else /*!HAVE_W32_SYSTEM*/
    return GNUPG_BINDIR;
  #endif /*!HAVE_W32_SYSTEM*/
  }

and GNUPG_BINDIR is set directly from the configure options.  Via
$(bindir) and the @bindir@ AC_SUBST.



Salam-Shalom,

   Werner


--
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list