Patchwork gnupg patch

login
register
mail settings
Submitter Stijn Souffriau
Date May 1, 2012, 8:15 p.m.
Message ID <4FA04473.4070308@essensium.com>
Download mbox | patch
Permalink /patch/156218/
State Not Applicable
Headers show

Comments

Stijn Souffriau - May 1, 2012, 8:15 p.m.
Hello all,

I've attached a patch that adds packages for gnupg and some related 
libraries. I thought this might be useful for other people. Feel free to 
merge it or send me feedback.

Best Regards,
Thomas Petazzoni - May 2, 2012, 7:34 a.m.
Hello Stijn,

Le Tue, 01 May 2012 22:15:47 +0200,
Stijn Souffriau <stijn.souffriau@essensium.com> a écrit :

> I've attached a patch that adds packages for gnupg and some related 
> libraries. I thought this might be useful for other people. Feel free to 
> merge it or send me feedback.

Thanks, this looks generally quite good, though I have a number of
comments about your patch:

 *) It should be split in several patches, one patch per package you're
    adding.

 *) The patches should be sent inline and not as attachment, in order
    to ease the review process. See
    http://elinux.org/Buildroot_how_to_contribute for a few details on
    a suggested workflow to send Buildroot patches.

Now the comments themselves:

 *) In package/gnupg/Config.in, why do you need to depend on a GLIBC
 external toolchain? The indentation of this depends line is wrong, it
 should be one tab. The indentation of the help text is wrong, it
 should be one tab + two spaces, and there should be one empty line
 between the help text and the upstream URL.

 *) In package/gnupg/gnupg.mk, you should prefer '=' over ':='. The
 HOST_GNUPG_DEPENDENCIES line is useless, because the host dependencies
 are automatically derived from target dependencies (if they are
 equivalent, of course, which apparently is the case here). But in the
 first place, why do you need to build gnupg for the host here? What is
 the use case? In the same file, there is a small indentation problem
 in GNUPG_CONF_OPT (spaces instead of tabs on the first two lines)

 *) package/libassuan/Config.in lacks an upstream URL.

 *) package/libassuan/libassuan.mk. Copy/paste error in the comment at
 the beginning of the file. Same comment as gnupg for host dependencies
 derived automatically from target dependencies.

 *) libgcrypt/libgpg-error: you need to add the host variant for
 host-gnupg, but why do you need host-gnupg?

 *) package/libksba/COnfig.in: missing upstream URL

 *) package/libksba/libksba.mk: copy/paste error in comment. Same
 comment as before: do we really need the host variant?

 *) package/libpth/Config.in: the help text is missing.

 *) The second patch of package/libpth needs a bit more explanations.
 "Changed Makefile" is not an useful commit log :)

 *) In libpth.mk, same copy/paste error, and same question about the
 host variant.

Otherwise, looks like a really good starting point.

Apparently, you have only tested this against glibc (per your
dependency). In order to get these patches merged, you should also
build them against uClibc, which also to check whether locale support
is needed, or largefile support, or some other toolchain option that
Buildroot makes optional when building an uClibc toolchain.

Thanks again!

Thomas

Patch

From 83cd20c6425dbe6da853538c910fb1d438943918 Mon Sep 17 00:00:00 2001
From: Stijn Souffriau <stijn.souffriau@essensium.com>
Date: Tue, 1 May 2012 22:02:45 +0200
Subject: [PATCH] Added the gnupg package and prerequisite libraries

---
 package/Config.in                                  |    4 ++
 package/gnupg/Config.in                            |   13 +++++++
 package/gnupg/gnupg.mk                             |   33 +++++++++++++++++++
 package/libassuan/Config.in                        |    5 +++
 package/libassuan/libassuan.mk                     |   24 ++++++++++++++
 package/libgcrypt/libgcrypt.mk                     |    2 +
 package/libgpg-error/libgpg-error.mk               |    1 +
 package/libksba/Config.in                          |    4 ++
 package/libksba/libksba.mk                         |   21 ++++++++++++
 package/libpth/Config.in                           |    5 +++
 ...mmited-L-usr-lib-I-usr-include-from-paths.patch |   34 ++++++++++++++++++++
 package/libpth/libpth-0002-dependencyfix.patch     |   25 ++++++++++++++
 .../libpth-0003-fixed-install-depedency.patch      |   34 ++++++++++++++++++++
 package/libpth/libpth.mk                           |   20 +++++++++++
 14 files changed, 225 insertions(+), 0 deletions(-)
 create mode 100644 package/gnupg/Config.in
 create mode 100644 package/gnupg/gnupg.mk
 create mode 100644 package/libassuan/Config.in
 create mode 100644 package/libassuan/libassuan.mk
 create mode 100644 package/libksba/Config.in
 create mode 100644 package/libksba/libksba.mk
 create mode 100644 package/libpth/Config.in
 create mode 100644 package/libpth/libpth-0001-ommited-L-usr-lib-I-usr-include-from-paths.patch
 create mode 100644 package/libpth/libpth-0002-dependencyfix.patch
 create mode 100644 package/libpth/libpth-0003-fixed-install-depedency.patch
 create mode 100644 package/libpth/libpth.mk

diff --git a/package/Config.in b/package/Config.in
index ed66c05..bc9eaeb 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -280,6 +280,8 @@  source "package/libgpg-error/Config.in"
 source "package/libnss/Config.in"
 source "package/openssl/Config.in"
 source "package/polarssl/Config.in"
+source "package/libassuan/Config.in"
+source "package/libksba/Config.in"
 endmenu
 
 menu "Database"
@@ -402,6 +404,7 @@  source "package/orc/Config.in"
 source "package/poco/Config.in"
 source "package/protobuf/Config.in"
 source "package/startup-notification/Config.in"
+source "package/libpth/Config.in"
 endmenu
 
 menu "Text and terminal handling"
@@ -434,6 +437,7 @@  endmenu
 
 menu "Miscellaneous"
 source "package/shared-mime-info/Config.in"
+source "package/gnupg/Config.in"
 endmenu
 
 menu "Networking applications"
diff --git a/package/gnupg/Config.in b/package/gnupg/Config.in
new file mode 100644
index 0000000..81bedf4
--- /dev/null
+++ b/package/gnupg/Config.in
@@ -0,0 +1,13 @@ 
+config BR2_PACKAGE_GNUPG
+	bool "gnupg"
+        depends on BR2_TOOLCHAIN_EXTERNAL_GLIBC
+	select BR2_PACKAGE_LIBGPG_ERROR
+	select BR2_PACKAGE_LIBGCRYPT
+	select BR2_PACKAGE_LIBKSBA
+	select BR2_PACKAGE_LIBASSUAN
+	select BR2_PACKAGE_LIBPTH
+	select BR2_PACKAGE_ZLIB
+	help
+	GnuPG 2.0 is the new modularized version of GnuPG supporting OpenPGP and S/MIME
+	http://www.gnupg.org/
+
diff --git a/package/gnupg/gnupg.mk b/package/gnupg/gnupg.mk
new file mode 100644
index 0000000..24fd8b7
--- /dev/null
+++ b/package/gnupg/gnupg.mk
@@ -0,0 +1,33 @@ 
+#############################################################
+#
+# libgpg-error
+#
+#############################################################
+GNUPG_VERSION:=2.0.19
+GNUPG_SOURCE:=gnupg-$(GNUPG_VERSION).tar.bz2
+GNUPG_SITE:=ftp://ftp.gnupg.org/gcrypt/gnupg/
+GNUPG_DEPENDENCIES= libgpg-error libgcrypt libassuan libksba libpth zlib 
+HOST_GNUPG_DEPENDENCIES= host-libgpg-error host-libgcrypt host-libassuan host-libksba host-libpth host-zlib
+
+GNUPG_INSTALL_STAGING = YES
+
+GNUPG_CONF_OPT = \
+        --disable-optimization \
+        --with-gpg-error-prefix=$(STAGING_DIR)/usr \
+	--with-libgcrypt-prefix=$(STAGING_DIR)/usr \
+	--with-libassuan-prefix=$(STAGING_DIR)/usr \
+	--with-ksba-prefix=$(STAGING_DIR)/usr \
+	--with-pth-prefix=$(STAGING_DIR)/usr \
+	--with-zlib=$(STAGING_DIR)/usr/lib
+
+HOST_GNUPG_CONF_OPT = \
+        --disable-optimization \
+        --with-gpg-error-prefix=$(HOST_DIR)/usr \
+        --with-libgcrypt-prefix=$(HOST_DIR)/usr \
+        --with-libassuan-prefix=$(HOST_DIR)/usr \
+        --with-ksba-prefix=$(HOST_DIR)/usr \
+        --with-pth-prefix=$(HOST_DIR)/usr \
+	--with-zlib=$(HOST_DIR)/usr/lib
+
+$(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
diff --git a/package/libassuan/Config.in b/package/libassuan/Config.in
new file mode 100644
index 0000000..7483e48
--- /dev/null
+++ b/package/libassuan/Config.in
@@ -0,0 +1,5 @@ 
+config BR2_PACKAGE_LIBASSUAN
+	bool "libassuan"
+	help
+	  Libassuan is the IPC library used by some GnuPG related software.
+
diff --git a/package/libassuan/libassuan.mk b/package/libassuan/libassuan.mk
new file mode 100644
index 0000000..0545f36
--- /dev/null
+++ b/package/libassuan/libassuan.mk
@@ -0,0 +1,24 @@ 
+#############################################################
+#
+# libgcrypt
+#
+#############################################################
+
+LIBASSUAN_VERSION = 2.0.3
+LIBASSUAN_SOURCE = libassuan-$(LIBASSUAN_VERSION).tar.bz2
+LIBASSUAN_SITE = ftp://ftp.gnupg.org/gcrypt/libassuan/
+LIBASSUAN_INSTALL_STAGING = YES
+
+LIBASSUAN_CONF_OPT = \
+	--disable-optimization \
+	--with-gpg-error-prefix=$(STAGING_DIR)/usr
+
+HOST_LIBASSUAN_CONF_OPT = \
+	--disable-optimization \
+	--with-gpg-error-prefix=$(HOST_DIR)/usr
+
+LIBASSUAN_DEPENDENCIES = libgpg-error
+HOST_LIBASSUAN_DEPENDENCIES = host-libgpg-error
+
+$(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
diff --git a/package/libgcrypt/libgcrypt.mk b/package/libgcrypt/libgcrypt.mk
index 68c6c47..050f83f 100644
--- a/package/libgcrypt/libgcrypt.mk
+++ b/package/libgcrypt/libgcrypt.mk
@@ -16,5 +16,7 @@  LIBGCRYPT_CONF_OPT = \
 	--with-gpg-error-prefix=$(STAGING_DIR)/usr
 
 LIBGCRYPT_DEPENDENCIES = libgpg-error
+HOST_LIBGCRYPT_DEPENDENCIES = host-libgpg-error
 
 $(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
diff --git a/package/libgpg-error/libgpg-error.mk b/package/libgpg-error/libgpg-error.mk
index 1b78b17..2aa1da3 100644
--- a/package/libgpg-error/libgpg-error.mk
+++ b/package/libgpg-error/libgpg-error.mk
@@ -9,3 +9,4 @@  LIBGPG_ERROR_SITE = ftp://ftp.gnupg.org/gcrypt/libgpg-error
 LIBGPG_ERROR_INSTALL_STAGING = YES
 
 $(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
diff --git a/package/libksba/Config.in b/package/libksba/Config.in
new file mode 100644
index 0000000..0d333b2
--- /dev/null
+++ b/package/libksba/Config.in
@@ -0,0 +1,4 @@ 
+config BR2_PACKAGE_LIBKSBA
+	bool "libksba"
+	help
+	  Libksba is a CMS and X.509 access library under development.
diff --git a/package/libksba/libksba.mk b/package/libksba/libksba.mk
new file mode 100644
index 0000000..4f741a9
--- /dev/null
+++ b/package/libksba/libksba.mk
@@ -0,0 +1,21 @@ 
+#############################################################
+#
+# libgcrypt
+#
+#############################################################
+
+LIBKSBA_VERSION = 1.2.0
+LIBKSBA_SOURCE = libksba-$(LIBKSBA_VERSION).tar.bz2
+LIBKSBA_SITE = ftp://ftp.gnupg.org/gcrypt/libksba/
+LIBKSBA_INSTALL_STAGING = YES
+
+LIBKSBA_CONF_OPT = \
+	--disable-optimization \
+	--with-gpg-error-prefix=$(STAGING_DIR)/usr
+
+HOST_LIBKSBA_CONF_OPT = \
+	--disable-optimization \
+	--with-gpg-error-prefix=$(HOST_DIR)/usr
+
+$(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
diff --git a/package/libpth/Config.in b/package/libpth/Config.in
new file mode 100644
index 0000000..cec5acc
--- /dev/null
+++ b/package/libpth/Config.in
@@ -0,0 +1,5 @@ 
+config BR2_PACKAGE_LIBPTH
+	bool "libpth"
+	select BR2_PACKAGE_PTH_ERROR
+	help
+	  http://www.gnu.org/software/pth/
diff --git a/package/libpth/libpth-0001-ommited-L-usr-lib-I-usr-include-from-paths.patch b/package/libpth/libpth-0001-ommited-L-usr-lib-I-usr-include-from-paths.patch
new file mode 100644
index 0000000..3c3c69c
--- /dev/null
+++ b/package/libpth/libpth-0001-ommited-L-usr-lib-I-usr-include-from-paths.patch
@@ -0,0 +1,34 @@ 
+From 92f49db9b1c74691ac82b1f52429ca9b6f98d6f4 Mon Sep 17 00:00:00 2001
+From: Stijn Souffriau <stijn.souffriau@gmail.com>
+Date: Thu, 29 Mar 2012 19:55:02 +0200
+Subject: [PATCH] ommited -L/usr/lib -I/usr/include from paths
+
+---
+ pth-config.in |    8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/pth-config.in b/pth-config.in
+index 24a93d7..802770d 100644
+--- a/pth-config.in
++++ b/pth-config.in
+@@ -109,11 +109,15 @@ do
+             output="$output $pth_acdir"
+             ;;
+         --cflags)
+-            output="$output -I$pth_includedir"
++	    if [[ $pth_includedir != "/usr/include" ]]; then
++		output="$output -I$pth_includedir"
++	    fi
+             output_extra="$output_extra $pth_cflags"
+             ;;
+         --ldflags)
+-            output="$output -L$pth_libdir"
++	    if [[ $pth_libdir != "/usr/lib" ]]; then
++            	output="$output -L$pth_libdir"
++	    fi
+             output_extra="$output_extra $pth_ldflags"
+             ;;
+         --libs)
+-- 
+1.7.0.4
+
diff --git a/package/libpth/libpth-0002-dependencyfix.patch b/package/libpth/libpth-0002-dependencyfix.patch
new file mode 100644
index 0000000..5a9ad51
--- /dev/null
+++ b/package/libpth/libpth-0002-dependencyfix.patch
@@ -0,0 +1,25 @@ 
+From 92f862503bb934252e9df1d19d7184b5ed57d7aa Mon Sep 17 00:00:00 2001
+From: Stijn Souffriau <stijn.souffriau@gmail.com>
+Date: Mon, 2 Apr 2012 16:00:53 +0200
+Subject: [PATCH] changed Makefile
+
+---
+ Makefile.in |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 477ed81..750ec9f 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -162,6 +162,8 @@ all-normal: $(TARGET_ALL)
+ all-for-install: $(TARGET_ALL)
+ 	@touch .done-all >/dev/null 2>&1 || $(TRUE)
+ 
++$(HSRCS): pth_p.h
++
+ #   build the private shared header file
+ pth_p.h: $(S)pth_p.h.in
+ 	$(SHTOOL) scpp -o pth_p.h -t $(S)pth_p.h.in -Dcpp -Cintern -M '==#==' $(HSRCS)
+-- 
+1.7.0.4
+
diff --git a/package/libpth/libpth-0003-fixed-install-depedency.patch b/package/libpth/libpth-0003-fixed-install-depedency.patch
new file mode 100644
index 0000000..ff384f6
--- /dev/null
+++ b/package/libpth/libpth-0003-fixed-install-depedency.patch
@@ -0,0 +1,34 @@ 
+From f2079abd360d2f1c531927e8ff7aa034d51aac66 Mon Sep 17 00:00:00 2001
+From: Stijn Souffriau <stijn.souffriau@essensium.com>
+Date: Tue, 3 Apr 2012 13:49:38 +0200
+Subject: [PATCH] fixed install depedency
+
+---
+ Makefile.in |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 750ec9f..f5f3c9c 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -229,7 +229,7 @@ install-dirs:
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(datadir)/aclocal
+-install-pth:
++install-pth: install-dirs
+ 	$(SHTOOL) install -c -m 755 pth-config $(DESTDIR)$(bindir)/pth-config
+ 	$(SHTOOL) install -c -m 644 $(S)pth-config.1 $(DESTDIR)$(mandir)/man1/pth-config.1
+ 	$(SHTOOL) install -c -m 644 $(S)pth.3 $(DESTDIR)$(mandir)/man3/pth.3
+@@ -237,7 +237,7 @@ install-pth:
+ 	$(SHTOOL) install -c -m 644 pth.h $(DESTDIR)$(includedir)/pth.h
+ 	@umask 022; $(LIBTOOL) --mode=install \
+ 	$(SHTOOL) install -c libpth.la $(DESTDIR)$(libdir)/libpth.la
+-install-pthread:
++install-pthread: install-dirs
+ 	$(SHTOOL) install -c -m 755 pthread-config $(DESTDIR)$(bindir)/pthread-config
+ 	$(SHTOOL) install -c -m 644 $(S)pthread-config.1 $(DESTDIR)$(mandir)/man1/pthread-config.1
+ 	$(SHTOOL) install -c -m 644 pthread.h $(DESTDIR)$(includedir)/pthread.h
+-- 
+1.7.0.4
+
diff --git a/package/libpth/libpth.mk b/package/libpth/libpth.mk
new file mode 100644
index 0000000..e71b704
--- /dev/null
+++ b/package/libpth/libpth.mk
@@ -0,0 +1,20 @@ 
+#############################################################
+#
+# libgcrypt
+#
+#############################################################
+
+LIBPTH_VERSION = 2.0.6
+LIBPTH_SOURCE = pth-$(LIBPTH_VERSION).tar.gz
+LIBPTH_SITE = ftp://ftp.gnu.org/gnu/pth/
+LIBPTH_INSTALL_STAGING = YES
+
+LIBPTH_CONF_OPT = \
+	--disable-optimization
+
+HOST_LIBPTH_CONF_OPT = \
+	--disable-optimization
+
+
+$(eval $(call AUTOTARGETS))
+$(eval $(call AUTOTARGETS,host))
-- 
1.7.0.4