diff mbox

[3/5] gnupg2: new package

Message ID 1402062269-57018-4-git-send-email-Vincent.Riera@imgtec.com
State Accepted
Headers show

Commit Message

Vicente Olivert Riera June 6, 2014, 1:44 p.m. UTC
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Reviewed-by: Markos Chandras <Markos.Chandras@imgtec.com>
---
 package/Config.in        |    1 +
 package/gnupg2/Config.in |   39 +++++++++++++++++++++++++++++++++++++++
 package/gnupg2/gnupg2.mk |   27 +++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100644 package/gnupg2/Config.in
 create mode 100644 package/gnupg2/gnupg2.mk

Comments

Bernd Kuhls June 6, 2014, 2:33 p.m. UTC | #1
Vicente Olivert Riera
<Vincent.Riera@imgtec.com> wrote in
news:1402062269-57018-4-git-send-email-Vincent.Riera@imgtec.com: 

> +     select BR2_PACKAGE_PTH
> +     depends on !BR2_TOOLCHAIN_USES_UCLIBC # pth

Hi,

afaik gnupg2 is compatible with uclibc if you use the existing libpthsem 
package instead of your new pth package.

Regards, Bernd
Vicente Olivert Riera June 6, 2014, 4:34 p.m. UTC | #2
On 06/06/2014 03:33 PM, Bernd Kuhls wrote:
> Vicente Olivert Riera
> <Vincent.Riera@imgtec.com> wrote in
> news:1402062269-57018-4-git-send-email-Vincent.Riera@imgtec.com:
>
>> +     select BR2_PACKAGE_PTH
>> +     depends on !BR2_TOOLCHAIN_USES_UCLIBC # pth
>
> Hi,

Hello Bernd, all,

> afaik gnupg2 is compatible with uclibc if you use the existing libpthsem
> package instead of your new pth package.

no, it doesn't build (as is) using libpthsem. Here is why:

First, because it looks for pth-config, which is installed by pth. 
libpthsem installs pthsem-config.

Second, although you try to make a pth-config symlink pointing to 
pthsem-config, it will fail again because "pthsem-config --version" 
outputs the version in a different format than pth-config, so the pth 
version check in gnupg2's configure script will fail.

Third, although you make a copy of pthsem-config calling it pth-config, 
and you modify it to output the version in the same way as the original 
pth-config does, it will fail again because it also looks for pth.h 
which is installed by pth. pthsem installs pthsem.h.

Now, if you make a pth.h symlink pointing to pthsem.h, then it builds fine.

To summarize: if you want to build gnupg2 using libpthsem instead of 
pth, you will need to patch libpthsem package to install a compatibility 
pth-config script (just a copy with the --version modification) and a 
compatibility pth.h symlink.

So, we have three options here and we need to decide one of them:

Option 1: add the new pth package
   pros: -there is no need to patch libpthsem
   cons: -gnupg2 will not work with uclibc

Option 2: patch the libpthsem package
   pros: -no need to add pth package
         -gnupg2 will work with uclibc
   cons: -we need to patch libpthsem to install compatibility stuff

Option 3: patch gnupg2 to use libpthsem in case of pth is missing
   pros: -no need to add pth package
         -gnupg2 will work with uclibc
         -gnupg2 will work with both libpthsem and pth
   cons: -patching gnupg2 source code should be accepted upstream

Let's vote! :)

> Regards, Bernd
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Yann E. MORIN June 6, 2014, 5:06 p.m. UTC | #3
Vincente, All,

On 2014-06-06 17:34 +0100, Vicente Olivert Riera spake thusly:
> On 06/06/2014 03:33 PM, Bernd Kuhls wrote:
> >afaik gnupg2 is compatible with uclibc if you use the existing libpthsem
> >package instead of your new pth package.
> 
> no, it doesn't build (as is) using libpthsem. Here is why:
[--SNIP--]
> So, we have three options here and we need to decide one of them:
> 
> Option 1: add the new pth package
>   pros: -there is no need to patch libpthsem
>   cons: -gnupg2 will not work with uclibc
> 
> Option 2: patch the libpthsem package
>   pros: -no need to add pth package
>         -gnupg2 will work with uclibc
>   cons: -we need to patch libpthsem to install compatibility stuff
> 
> Option 3: patch gnupg2 to use libpthsem in case of pth is missing
>   pros: -no need to add pth package
>         -gnupg2 will work with uclibc
>         -gnupg2 will work with both libpthsem and pth
>   cons: -patching gnupg2 source code should be accepted upstream

I think option 1 is the best for now.

If Bernd (or anyone else) is interested in making gnupg2 work on uClibc,
it will be possible for him to apply either option 2 or option 3 later
on. Adding support for uClibc can (and should) be done in a separate
patch, anyway.

And whatever the package we patch (pthsem or gnupg2 or both), the patch
should be submitted upstream, of course! ;-)

Regards,
Yann E. MORIN.
Thomas Petazzoni July 23, 2014, 9:35 p.m. UTC | #4
Dear Vicente Olivert Riera,

On Fri, 6 Jun 2014 17:34:53 +0100, Vicente Olivert Riera wrote:

> So, we have three options here and we need to decide one of them:
> 
> Option 1: add the new pth package
>    pros: -there is no need to patch libpthsem
>    cons: -gnupg2 will not work with uclibc
> 
> Option 2: patch the libpthsem package
>    pros: -no need to add pth package
>          -gnupg2 will work with uclibc
>    cons: -we need to patch libpthsem to install compatibility stuff
> 
> Option 3: patch gnupg2 to use libpthsem in case of pth is missing
>    pros: -no need to add pth package
>          -gnupg2 will work with uclibc
>          -gnupg2 will work with both libpthsem and pth
>    cons: -patching gnupg2 source code should be accepted upstream
> 
> Let's vote! :)

Option 4: use the --enable-compat option of pthsem, which was precisely
designed to offer compatibility with pth, by installing pth.h and
pth-config. The only issue was the version check in gnupg2 not
accepting the not-completely-compatible behavior of pth-config from
pthsem. A one byte patch in gnupg2 solved the problem.

Therefore, this patch (gnupg2) has been applied, after changing the
dependency from pth to pthsem, removing the !uclibc dependency, and
fixing minor formatting issues in the .mk file.

Thanks!

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 56ef7ea..03d6670 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1073,6 +1073,7 @@  source "package/dialog/Config.in"
 source "package/dtach/Config.in"
 source "package/file/Config.in"
 source "package/gnupg/Config.in"
+source "package/gnupg2/Config.in"
 source "package/inotify-tools/Config.in"
 source "package/lockfile-progs/Config.in"
 source "package/logrotate/Config.in"
diff --git a/package/gnupg2/Config.in b/package/gnupg2/Config.in
new file mode 100644
index 0000000..ac2974d
--- /dev/null
+++ b/package/gnupg2/Config.in
@@ -0,0 +1,39 @@ 
+config BR2_PACKAGE_GNUPG2
+	bool "gnupg2"
+	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_LIBGPG_ERROR
+	select BR2_PACKAGE_LIBGCRYPT
+	select BR2_PACKAGE_LIBASSUAN
+	select BR2_PACKAGE_LIBKSBA
+	select BR2_PACKAGE_PTH
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC # pth
+	depends on BR2_USE_MMU # libassuan
+	help
+	  GnuPG is the GNU project's complete and free implementation
+	  of the OpenPGP standard as defined by RFC4880. GnuPG allows
+	  to encrypt and sign your data and communication, features a
+	  versatile key management system as well as access modules
+	  for all kinds of public key directories. GnuPG, also known
+	  as GPG, is a command line tool with features for easy
+	  integration with other applications.
+
+	  http://gnupg.org/
+
+if BR2_PACKAGE_GNUPG2
+
+config BR2_PACKAGE_GNUPG2_GPGV2
+	bool "gpgv2"
+	help
+	  gpgv2 is an OpenPGP signature verification tool.
+
+	  This program is actually a stripped-down version of gpg
+	  which is only able to check signatures. It is somewhat
+	  smaller than the fully-blown gpg and uses a different (and
+	  simpler) way to check that the public keys used to make the
+	  signature are valid. There are no configuration files and
+	  only a few options are implemented.
+
+endif
+
+comment "gnupg2 depends on pth which doesn't work with uClibc"
+	depends on BR2_TOOLCHAIN_USES_UCLIBC
diff --git a/package/gnupg2/gnupg2.mk b/package/gnupg2/gnupg2.mk
new file mode 100644
index 0000000..ff694e2
--- /dev/null
+++ b/package/gnupg2/gnupg2.mk
@@ -0,0 +1,27 @@ 
+################################################################################
+#
+# gnupg2
+#
+################################################################################
+
+GNUPG2_VERSION = 2.0.23
+GNUPG2_SOURCE = gnupg-$(GNUPG2_VERSION).tar.bz2
+GNUPG2_SITE = ftp://ftp.gnupg.org/gcrypt/gnupg
+GNUPG2_LICENSE = GPLv3+
+GNUPG2_LICENSE_FILES = COPYING
+GNUPG2_DEPENDENCIES = zlib libgpg-error libgcrypt libassuan libksba pth
+GNUPG2_CONF_OPT = --disable-rpath --disable-regex --disable-doc
+GNUPG2_CONF_OPT += --with-libgpg-error-prefix=$(STAGING_DIR)/usr
+GNUPG2_CONF_OPT += --with-libgcrypt-prefix=$(STAGING_DIR)/usr
+GNUPG2_CONF_OPT += --with-libassuan-prefix=$(STAGING_DIR)/usr
+GNUPG2_CONF_OPT += --with-ksba-prefix=$(STAGING_DIR)/usr
+GNUPG2_CONF_OPT += --with-pth-prefix=$(STAGING_DIR)/usr
+
+ifneq ($(BR2_PACKAGE_GNUPG2_GPGV2),y)
+define GNUPG2_REMOVE_GPGV2
+	rm -f $(TARGET_DIR)/usr/bin/gpgv2
+endef
+GNUPG2_POST_INSTALL_TARGET_HOOKS += GNUPG2_REMOVE_GPGV2
+endif
+
+$(eval $(autotools-package))