All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/4] vpnc: update and fix musl build
@ 2016-02-10 23:03 Thomas Petazzoni
  2016-02-10 23:03 ` [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site Thomas Petazzoni
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2016-02-10 23:03 UTC (permalink / raw)
  To: buildroot

Hello,

The starting point of this series was the patch from Bernd fixing the
vpnc package to build with musl:

  http://patchwork.ozlabs.org/patch/572246/

However, I was not very happy with the patches directly imported from
Alpine Linux, with no real commit log, no explanation, etc.

So instead, I went ahead and updated the vpnc package to use a more
recent upstream version, to reformat all the patches using Git, to
re-organize the existing patches into cleaner ones, and rework the
musl fixes into clean patches as well.

All patches have been submitted upstream:

  https://github.com/ndpgroup/vpnc/pull/6

It isn't entirely clear how this Github repository gets maintained
compared to the Subversion repository mentioned on the official vpnc
homepage, but it seems to be kept reasonably up-to-date.

Thanks,

Thomas

Thomas Petazzoni (4):
  vpnc: switch to github as the new site
  vpnc: simplify patch 0001
  vpnc: bump to newer upstream version
  vpnc: add patches to fix build with the musl C library

 ...ile-allow-to-override-the-PREFIX-variable.patch | 32 ++++++++++
 package/vpnc/0001-fix-build.patch                  | 71 ----------------------
 ...02-Makefile-allow-to-override-the-version.patch | 42 +++++++++++++
 package/vpnc/0002-nomanual.patch                   | 15 -----
 ...file-allow-passing-custom-CFLAGS-CPPFLAGS.patch | 46 ++++++++++++++
 package/vpnc/0003-susv3-legacy.patch               | 12 ----
 ...e-provide-an-option-to-not-build-manpages.patch | 58 ++++++++++++++++++
 ...low-passing-a-custom-path-to-libgcrypt-co.patch | 41 +++++++++++++
 ...place-deprecated-SUSv3-functions-with-POS.patch | 37 +++++++++++
 ...n-t-assume-error.h-is-available-on-all-Li.patch | 54 ++++++++++++++++
 ...p.c-don-t-include-linux-if_tun.h-on-Linux.patch | 56 +++++++++++++++++
 ...g.c-add-missing-sys-ttydefaults.h-include.patch | 38 ++++++++++++
 package/vpnc/Config.in                             |  6 ++
 package/vpnc/vpnc.hash                             |  2 +-
 package/vpnc/vpnc.mk                               | 19 +++---
 15 files changed, 420 insertions(+), 109 deletions(-)
 create mode 100644 package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch
 delete mode 100644 package/vpnc/0001-fix-build.patch
 create mode 100644 package/vpnc/0002-Makefile-allow-to-override-the-version.patch
 delete mode 100644 package/vpnc/0002-nomanual.patch
 create mode 100644 package/vpnc/0003-Makefile-allow-passing-custom-CFLAGS-CPPFLAGS.patch
 delete mode 100644 package/vpnc/0003-susv3-legacy.patch
 create mode 100644 package/vpnc/0004-Makefile-provide-an-option-to-not-build-manpages.patch
 create mode 100644 package/vpnc/0005-Makefile-allow-passing-a-custom-path-to-libgcrypt-co.patch
 create mode 100644 package/vpnc/0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch
 create mode 100644 package/vpnc/0007-sysdep.h-don-t-assume-error.h-is-available-on-all-Li.patch
 create mode 100644 package/vpnc/0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch
 create mode 100644 package/vpnc/0009-config.c-add-missing-sys-ttydefaults.h-include.patch

-- 
2.6.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site
  2016-02-10 23:03 [Buildroot] [PATCH 0/4] vpnc: update and fix musl build Thomas Petazzoni
@ 2016-02-10 23:03 ` Thomas Petazzoni
  2016-04-19 22:04   ` Yann E. MORIN
  2016-02-10 23:03 ` [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001 Thomas Petazzoni
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-02-10 23:03 UTC (permalink / raw)
  To: buildroot

The vpnc upstream project has not made any tarball release since many
years, but they have continued to update their Subversion
repository.

A Github repository synced with the Subversion repository now exists
at https://github.com/ndpgroup/vpnc, which is more practical to
generate patches and submit pull requests. For this reason, we move to
using this Github repository as the new source for the vpnc
package. The specific commit that we use corresponds to version 0.5.3
exactly.

All patches are re-formatted using Git.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...le-cleanup-and-fix-the-VERSION-definitio.patch} | 24 +++++++++++-----
 package/vpnc/0002-Don-t-build-manpages.patch       | 31 +++++++++++++++++++++
 package/vpnc/0002-nomanual.patch                   | 15 ----------
 ...recated-SUSv3-functions-with-POSIX-equiva.patch | 32 ++++++++++++++++++++++
 package/vpnc/0003-susv3-legacy.patch               | 12 --------
 package/vpnc/vpnc.hash                             |  2 +-
 package/vpnc/vpnc.mk                               |  4 +--
 7 files changed, 83 insertions(+), 37 deletions(-)
 rename package/vpnc/{0001-fix-build.patch => 0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch} (78%)
 create mode 100644 package/vpnc/0002-Don-t-build-manpages.patch
 delete mode 100644 package/vpnc/0002-nomanual.patch
 create mode 100644 package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
 delete mode 100644 package/vpnc/0003-susv3-legacy.patch

diff --git a/package/vpnc/0001-fix-build.patch b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
similarity index 78%
rename from package/vpnc/0001-fix-build.patch
rename to package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
index e21348b..d091dde 100644
--- a/package/vpnc/0001-fix-build.patch
+++ b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
@@ -1,14 +1,21 @@
-Misc. Makefile cleanup and fix the VERSION definition.
+From fd7e584bd28bd541464f8cb6cc72e76de2347640 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Mon, 8 Feb 2016 23:02:45 +0100
+Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
 
 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
-
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 ---
-diff -purN vpnc-0.5.3.orig/Makefile vpnc-0.5.3/Makefile
---- vpnc-0.5.3.orig/Makefile	2012-08-06 00:03:22.677914146 +0200
-+++ vpnc-0.5.3/Makefile	2012-08-06 00:06:58.506744901 +0200
+ Makefile | 40 +++++++++++++++++++---------------------
+ 1 file changed, 19 insertions(+), 21 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 9b96d83..1ca6459 100644
+--- a/Makefile
++++ b/Makefile
 @@ -19,21 +19,19 @@
  #
- # $Id: Makefile 312 2008-06-15 18:09:42Z Joerg Mayer $
+ # $Id$
  
 -DESTDIR=
 -PREFIX=/usr/local
@@ -60,7 +67,7 @@ diff -purN vpnc-0.5.3.orig/Makefile vpnc-0.5.3/Makefile
  
  ifeq ($(shell uname -s), SunOS)
  LDFLAGS += -lnsl -lresolv -lsocket
-@@ -84,7 +82,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-
+@@ -81,7 +79,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-utils.o
  	$(CC) -o $@ $^ $(LDFLAGS)
  
  .depend: $(SRCS) $(BINSRCS)
@@ -69,3 +76,6 @@ diff -purN vpnc-0.5.3.orig/Makefile vpnc-0.5.3/Makefile
  
  vpnc-debug.c vpnc-debug.h : isakmp.h enum2debug.pl
  	LC_ALL=C perl -w ./enum2debug.pl isakmp.h >vpnc-debug.c 2>vpnc-debug.h
+-- 
+2.6.4
+
diff --git a/package/vpnc/0002-Don-t-build-manpages.patch b/package/vpnc/0002-Don-t-build-manpages.patch
new file mode 100644
index 0000000..be4414e
--- /dev/null
+++ b/package/vpnc/0002-Don-t-build-manpages.patch
@@ -0,0 +1,31 @@
+From 6bbd03ec8928fd2a3056fc55ee48900fc88d3061 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Mon, 8 Feb 2016 23:03:48 +0100
+Subject: [PATCH] Don't build manpages
+
+Patch originally from Ulf Samuelsson <ulf.samuelsson@atmel.com>.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 1ca6459..857bf8d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -70,7 +70,10 @@ vpnc : $(OBJS) vpnc.o
+ 	$(CC) -o $@ $^ $(LDFLAGS)
+ 
+ vpnc.8 : vpnc.8.template makeman.pl vpnc
+-	./makeman.pl
++	@echo "Cannot make manual when cross compiling"
++	touch $@
++
++#	./makeman.pl
+ 
+ vpnc-script : vpnc-script.in
+ 	sed -e 's,@''PREFIX''@,$(PREFIX),g' $< > $@ && chmod 755 $@
+-- 
+2.6.4
+
diff --git a/package/vpnc/0002-nomanual.patch b/package/vpnc/0002-nomanual.patch
deleted file mode 100644
index 7f2ea53..0000000
--- a/package/vpnc/0002-nomanual.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -urN vpnc-0.5.3-0rig/Makefile vpnc-0.5.3/Makefile
---- vpnc-0.5.3-0rig/Makefile	2008-11-19 21:36:12.000000000 +0100
-+++ vpnc-0.5.3/Makefile	2009-01-15 00:38:36.000000000 +0100
-@@ -72,7 +72,10 @@
- 	$(CC) -o $@ $^ $(LDFLAGS)
- 
- vpnc.8 : vpnc.8.template makeman.pl vpnc
--	./makeman.pl
-+	@echo "Cannot make manual when cross compiling"
-+	touch $@
-+
-+#	./makeman.pl
- 
- vpnc-script : vpnc-script.in
- 	sed -e 's,@''PREFIX''@,$(PREFIX),g' $< > $@ && chmod 755 $@
diff --git a/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch b/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
new file mode 100644
index 0000000..4b8446f
--- /dev/null
+++ b/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
@@ -0,0 +1,32 @@
+From ca1a9ad59ae07345720e315b928bb014a8aeea4c Mon Sep 17 00:00:00 2001
+From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Date: Mon, 8 Feb 2016 23:05:23 +0100
+Subject: [PATCH] Replace deprecated SUSv3 functions with POSIX equivalents
+
+Replace the deprecated SUSv3 function index() by its POSIX equivalent
+strchr().
+
+Patch originally from Bernhard Reutner-Fischer
+<rep.dot.nop@gmail.com>.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ config.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config.c b/config.c
+index bdd0833..d1750ca 100644
+--- a/config.c
++++ b/config.c
+@@ -456,7 +456,7 @@ static char *get_config_filename(const char *name, int add_dot_conf)
+ {
+ 	char *realname;
+ 	
+-	asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
++	asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
+ 	return realname;
+ }
+ 
+-- 
+2.6.4
+
diff --git a/package/vpnc/0003-susv3-legacy.patch b/package/vpnc/0003-susv3-legacy.patch
deleted file mode 100644
index 2e577e3..0000000
--- a/package/vpnc/0003-susv3-legacy.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -rdup vpnc-0.5.1.oorig/config.c vpnc-0.5.1/config.c
---- vpnc-0.5.1.oorig/config.c	2007-09-10 22:39:48.000000000 +0200
-+++ vpnc-0.5.1/config.c	2007-09-19 14:19:46.000000000 +0200
-@@ -538,7 +538,7 @@ static char *get_config_filename(const c
- {
- 	char *realname;
- 	
--	asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
-+	asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
- 	return realname;
- }
- 
diff --git a/package/vpnc/vpnc.hash b/package/vpnc/vpnc.hash
index a79df8f..3474057 100644
--- a/package/vpnc/vpnc.hash
+++ b/package/vpnc/vpnc.hash
@@ -1,2 +1,2 @@
 # locally computed hash
-sha256 46cea3bd02f207c62c7c6f2f22133382602baeda1dc320747809e94881414884 vpnc-0.5.3.tar.gz
+sha256 925c8e879f78f1d575b69ee3868b886a0139926ea84c2138a89b9b7d8696f50a vpnc-70f1211f6f26e87e374d66f9a986e855215b8e3e.tar.gz
diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk
index f5ab5fc..5dfc2ba 100644
--- a/package/vpnc/vpnc.mk
+++ b/package/vpnc/vpnc.mk
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-VPNC_VERSION = 0.5.3
-VPNC_SITE = http://www.unix-ag.uni-kl.de/~massar/vpnc
+VPNC_VERSION = 70f1211f6f26e87e374d66f9a986e855215b8e3e
+VPNC_SITE = $(call github,ndpgroup,vpnc,$(VPNC_VERSION))
 VPNC_LICENSE = GPLv2+
 VPNC_LICENSE_FILES = COPYING
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001
  2016-02-10 23:03 [Buildroot] [PATCH 0/4] vpnc: update and fix musl build Thomas Petazzoni
  2016-02-10 23:03 ` [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site Thomas Petazzoni
@ 2016-02-10 23:03 ` Thomas Petazzoni
  2016-04-19 22:05   ` Yann E. MORIN
  2016-02-10 23:03 ` [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version Thomas Petazzoni
  2016-02-10 23:03 ` [Buildroot] [PATCH 4/4] vpnc: add patches to fix build with the musl C library Thomas Petazzoni
  3 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-02-10 23:03 UTC (permalink / raw)
  To: buildroot

Patch 0001 that adjusts the Makefile to solve cross-compilation issues
does a lot of whitespace changes that are unnecessary. We remove all
those noisy changes to keep only the really interesting ones.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...ile-cleanup-and-fix-the-VERSION-definitio.patch | 60 +++++++---------------
 1 file changed, 19 insertions(+), 41 deletions(-)

diff --git a/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
index d091dde..cad3e1a 100644
--- a/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
+++ b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
@@ -1,4 +1,4 @@
-From fd7e584bd28bd541464f8cb6cc72e76de2347640 Mon Sep 17 00:00:00 2001
+From 40b35a82ea581f5dfb1b0b20c4ba3e9f01f35107 Mon Sep 17 00:00:00 2001
 From: Samuel Martin <s.martin49@gmail.com>
 Date: Mon, 8 Feb 2016 23:02:45 +0100
 Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
@@ -6,39 +6,24 @@ Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 ---
- Makefile | 40 +++++++++++++++++++---------------------
- 1 file changed, 19 insertions(+), 21 deletions(-)
+ Makefile | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
 
 diff --git a/Makefile b/Makefile
-index 9b96d83..1ca6459 100644
+index 9b96d83..62742d0 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -19,21 +19,19 @@
- #
+@@ -20,7 +20,7 @@
  # $Id$
  
--DESTDIR=
+ DESTDIR=
 -PREFIX=/usr/local
--ETCDIR=/etc/vpnc
--BINDIR=$(PREFIX)/bin
--SBINDIR=$(PREFIX)/sbin
--MANDIR=$(PREFIX)/share/man
--DOCDIR=$(PREFIX)/share/doc/vpnc
--
--SRCS = sysdep.c vpnc-debug.c isakmp-pkt.c tunip.c config.c dh.c math_group.c supp.c decrypt-utils.c
--BINS = vpnc cisco-decrypt
--OBJS = $(addsuffix .o,$(basename $(SRCS)))
-+DESTDIR =
-+PREFIX ?= /usr/local
-+ETCDIR  = /etc/vpnc
-+BINDIR  = $(PREFIX)/bin
-+SBINDIR = $(PREFIX)/sbin
-+MANDIR  = $(PREFIX)/share/man
-+DOCDIR  = $(PREFIX)/share/doc/vpnc
-+
-+SRCS    = sysdep.c vpnc-debug.c isakmp-pkt.c tunip.c config.c dh.c math_group.c supp.c decrypt-utils.c
-+BINS    = vpnc cisco-decrypt
-+OBJS    = $(addsuffix .o,$(basename $(SRCS)))
++PREFIX?=/usr/local
+ ETCDIR=/etc/vpnc
+ BINDIR=$(PREFIX)/bin
+ SBINDIR=$(PREFIX)/sbin
+@@ -32,8 +32,6 @@ BINS = vpnc cisco-decrypt
+ OBJS = $(addsuffix .o,$(basename $(SRCS)))
  BINOBJS = $(addsuffix .o,$(BINS))
  BINSRCS = $(addsuffix .c,$(BINS))
 -VERSION := $(shell sh mk-version)
@@ -46,27 +31,20 @@ index 9b96d83..1ca6459 100644
  
  # The license of vpnc (Gpl >= 2) is quite likely incompatible with the
  # openssl license. Openssl is currently used to provide certificate
-@@ -50,13 +48,13 @@ RELEASE_VERSION := $(shell cat VERSION)
+@@ -50,11 +48,11 @@ RELEASE_VERSION := $(shell cat VERSION)
  #OPENSSL_GPL_VIOLATION = -DOPENSSL_GPL_VIOLATION
  #OPENSSLLIBS = -lcrypto
  
 -CC=gcc
--CFLAGS ?= -O3 -g
--CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
--CFLAGS +=  $(shell libgcrypt-config --cflags)
++CC ?= gcc
+ CFLAGS ?= -O3 -g
+ CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
+ CFLAGS +=  $(shell libgcrypt-config --cflags)
 -CPPFLAGS += -DVERSION=\"$(VERSION)\" $(OPENSSL_GPL_VIOLATION)
--LDFLAGS ?= -g
--LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
-+CC       ?= gcc
-+CFLAGS   ?= -O3 -g
-+CFLAGS   += -W -Wall -Wmissing-declarations -Wwrite-strings
-+CFLAGS   += $(shell libgcrypt-config --cflags)
 +CPPFLAGS += $(OPENSSL_GPL_VIOLATION)
-+LDFLAGS  ?= -g
-+LDFLAGS  += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
+ LDFLAGS ?= -g
+ LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
  
- ifeq ($(shell uname -s), SunOS)
- LDFLAGS += -lnsl -lresolv -lsocket
 @@ -81,7 +79,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-utils.o
  	$(CC) -o $@ $^ $(LDFLAGS)
  
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version
  2016-02-10 23:03 [Buildroot] [PATCH 0/4] vpnc: update and fix musl build Thomas Petazzoni
  2016-02-10 23:03 ` [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site Thomas Petazzoni
  2016-02-10 23:03 ` [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001 Thomas Petazzoni
@ 2016-02-10 23:03 ` Thomas Petazzoni
  2016-04-19 22:16   ` Yann E. MORIN
  2016-02-10 23:03 ` [Buildroot] [PATCH 4/4] vpnc: add patches to fix build with the musl C library Thomas Petazzoni
  3 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-02-10 23:03 UTC (permalink / raw)
  To: buildroot

While the official upstream has not published any new tarball, they
have continued to update their Subversion repository with additional
changes. This commit therefore updates the vpnc package to a newer
version, using the Github repository that replicates the original
Subversion repository.

Since the update required some updates to the patches, we took this
opportunity to split them in more fine-grained changes, and document
them more properly. Consequently:

 - The patch 0001 that fixes the Makefile gets split into 3 patches,
   0001, 0002 and 0003, each for one specific issue.

 - Patch 0002 to disable building the manpages gets changed into a
   solution that is potentially upstreamable, and is now patch 0004.

 - A new patch 0005 is added to specify a custom libgcrypt-config
   path, since this tool is now used to know how to link with
   libgcrypt.

 - The SUSv3 function removal patch is now patch 0006, and gains a
   better commit log.

Also, this vpnc version now depends on gnutls, which basically is a
better replacement for OpenSSL, whose support was not enabled by
default due to licensing issues (vpnc is under the GPL, which isn't
compatible with the OpenSSL license).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...ile-allow-to-override-the-PREFIX-variable.patch | 32 ++++++++++++
 ...ile-cleanup-and-fix-the-VERSION-definitio.patch | 59 ----------------------
 package/vpnc/0002-Don-t-build-manpages.patch       | 31 ------------
 ...02-Makefile-allow-to-override-the-version.patch | 42 +++++++++++++++
 ...file-allow-passing-custom-CFLAGS-CPPFLAGS.patch | 46 +++++++++++++++++
 ...e-provide-an-option-to-not-build-manpages.patch | 58 +++++++++++++++++++++
 ...low-passing-a-custom-path-to-libgcrypt-co.patch | 41 +++++++++++++++
 ...lace-deprecated-SUSv3-functions-with-POS.patch} | 21 +++++---
 package/vpnc/Config.in                             |  6 +++
 package/vpnc/vpnc.hash                             |  2 +-
 package/vpnc/vpnc.mk                               | 17 +++----
 11 files changed, 247 insertions(+), 108 deletions(-)
 create mode 100644 package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch
 delete mode 100644 package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
 delete mode 100644 package/vpnc/0002-Don-t-build-manpages.patch
 create mode 100644 package/vpnc/0002-Makefile-allow-to-override-the-version.patch
 create mode 100644 package/vpnc/0003-Makefile-allow-passing-custom-CFLAGS-CPPFLAGS.patch
 create mode 100644 package/vpnc/0004-Makefile-provide-an-option-to-not-build-manpages.patch
 create mode 100644 package/vpnc/0005-Makefile-allow-passing-a-custom-path-to-libgcrypt-co.patch
 rename package/vpnc/{0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch => 0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch} (53%)

diff --git a/package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch b/package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch
new file mode 100644
index 0000000..5b6df68
--- /dev/null
+++ b/package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch
@@ -0,0 +1,32 @@
+From 7314d232f8e85879d8f4c311ced44ee5b21fb239 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 10 Feb 2016 23:26:27 +0100
+Subject: [PATCH] Makefile: allow to override the PREFIX variable
+
+Some people may not want to install in /usr/local, so this commit
+makes it possible to override the PREFIX variable from the make
+command line.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 69f5aca..f9a6781 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,7 +20,7 @@
+ # $Id$
+ 
+ DESTDIR=
+-PREFIX=/usr/local
++PREFIX?=/usr/local
+ ETCDIR=/etc/vpnc
+ BINDIR=$(PREFIX)/bin
+ SBINDIR=$(PREFIX)/sbin
+-- 
+2.6.4
+
diff --git a/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
deleted file mode 100644
index cad3e1a..0000000
--- a/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 40b35a82ea581f5dfb1b0b20c4ba3e9f01f35107 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <s.martin49@gmail.com>
-Date: Mon, 8 Feb 2016 23:02:45 +0100
-Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
-
-Signed-off-by: Samuel Martin <s.martin49@gmail.com>
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- Makefile | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 9b96d83..62742d0 100644
---- a/Makefile
-+++ b/Makefile
-@@ -20,7 +20,7 @@
- # $Id$
- 
- DESTDIR=
--PREFIX=/usr/local
-+PREFIX?=/usr/local
- ETCDIR=/etc/vpnc
- BINDIR=$(PREFIX)/bin
- SBINDIR=$(PREFIX)/sbin
-@@ -32,8 +32,6 @@ BINS = vpnc cisco-decrypt
- OBJS = $(addsuffix .o,$(basename $(SRCS)))
- BINOBJS = $(addsuffix .o,$(BINS))
- BINSRCS = $(addsuffix .c,$(BINS))
--VERSION := $(shell sh mk-version)
--RELEASE_VERSION := $(shell cat VERSION)
- 
- # The license of vpnc (Gpl >= 2) is quite likely incompatible with the
- # openssl license. Openssl is currently used to provide certificate
-@@ -50,11 +48,11 @@ RELEASE_VERSION := $(shell cat VERSION)
- #OPENSSL_GPL_VIOLATION = -DOPENSSL_GPL_VIOLATION
- #OPENSSLLIBS = -lcrypto
- 
--CC=gcc
-+CC ?= gcc
- CFLAGS ?= -O3 -g
- CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
- CFLAGS +=  $(shell libgcrypt-config --cflags)
--CPPFLAGS += -DVERSION=\"$(VERSION)\" $(OPENSSL_GPL_VIOLATION)
-+CPPFLAGS += $(OPENSSL_GPL_VIOLATION)
- LDFLAGS ?= -g
- LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
- 
-@@ -81,7 +79,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-utils.o
- 	$(CC) -o $@ $^ $(LDFLAGS)
- 
- .depend: $(SRCS) $(BINSRCS)
--	$(CC) -MM $(SRCS) $(BINSRCS) $(CFLAGS) $(CPPFLAGS) > $@
-+	$(CC) -MM $(SRCS) $(BINSRCS) $(CPPFLAGS) $(CFLAGS) > $@
- 
- vpnc-debug.c vpnc-debug.h : isakmp.h enum2debug.pl
- 	LC_ALL=C perl -w ./enum2debug.pl isakmp.h >vpnc-debug.c 2>vpnc-debug.h
--- 
-2.6.4
-
diff --git a/package/vpnc/0002-Don-t-build-manpages.patch b/package/vpnc/0002-Don-t-build-manpages.patch
deleted file mode 100644
index be4414e..0000000
--- a/package/vpnc/0002-Don-t-build-manpages.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 6bbd03ec8928fd2a3056fc55ee48900fc88d3061 Mon Sep 17 00:00:00 2001
-From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
-Date: Mon, 8 Feb 2016 23:03:48 +0100
-Subject: [PATCH] Don't build manpages
-
-Patch originally from Ulf Samuelsson <ulf.samuelsson@atmel.com>.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- Makefile | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 1ca6459..857bf8d 100644
---- a/Makefile
-+++ b/Makefile
-@@ -70,7 +70,10 @@ vpnc : $(OBJS) vpnc.o
- 	$(CC) -o $@ $^ $(LDFLAGS)
- 
- vpnc.8 : vpnc.8.template makeman.pl vpnc
--	./makeman.pl
-+	@echo "Cannot make manual when cross compiling"
-+	touch $@
-+
-+#	./makeman.pl
- 
- vpnc-script : vpnc-script.in
- 	sed -e 's,@''PREFIX''@,$(PREFIX),g' $< > $@ && chmod 755 $@
--- 
-2.6.4
-
diff --git a/package/vpnc/0002-Makefile-allow-to-override-the-version.patch b/package/vpnc/0002-Makefile-allow-to-override-the-version.patch
new file mode 100644
index 0000000..8be8847
--- /dev/null
+++ b/package/vpnc/0002-Makefile-allow-to-override-the-version.patch
@@ -0,0 +1,42 @@
+From 8b035de4867db4fb8da41298224d92bf5b18e86f Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 10 Feb 2016 23:27:30 +0100
+Subject: [PATCH] Makefile: allow to override the version
+
+The mk-version script makes the assumption that the build process runs
+from a SVN checkout or a Git clone of the vpnc source code. However,
+this is not always the case, for example when you are building from a
+tarball, but inside a larger project that is versioned with Git.
+
+This is typically the case when building vpnc under a tool like
+Buildroot, or potentially other embedded Linux build system: the build
+system tool itself is versioned in Git, downloads tarballs of software
+components and builds them.
+
+In order to support such situations, this commit adjusts the Makefile
+to allow the VERSION variable to be overriden from the make command
+line.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index f9a6781..e80ef17 100644
+--- a/Makefile
++++ b/Makefile
+@@ -57,7 +57,7 @@ OBJS = $(addsuffix .o,$(basename $(SRCS)))
+ CRYPTO_OBJS = $(addsuffix .o,$(basename $(CRYPTO_SRCS)))
+ BINOBJS = $(addsuffix .o,$(BINS))
+ BINSRCS = $(addsuffix .c,$(BINS))
+-VERSION := $(shell sh mk-version)
++VERSION ?= $(shell sh mk-version)
+ RELEASE_VERSION := $(shell cat VERSION)
+ 
+ CC ?= gcc
+-- 
+2.6.4
+
diff --git a/package/vpnc/0003-Makefile-allow-passing-custom-CFLAGS-CPPFLAGS.patch b/package/vpnc/0003-Makefile-allow-passing-custom-CFLAGS-CPPFLAGS.patch
new file mode 100644
index 0000000..f688f70
--- /dev/null
+++ b/package/vpnc/0003-Makefile-allow-passing-custom-CFLAGS-CPPFLAGS.patch
@@ -0,0 +1,46 @@
+From 014a8e04a0fa775b2ade78e5f7655a1453375884 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 10 Feb 2016 23:31:12 +0100
+Subject: [PATCH] Makefile: allow passing custom CFLAGS/CPPFLAGS
+
+vpnc's Makefile specifies some CFLAGS and CPPFLAGS value, but it may
+be needed to pass additional custom flags on the make command line. To
+make this possible, we switch from a plain += operator to the
+"override ... +=" operator.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ Makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e80ef17..7ac225a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -62,9 +62,9 @@ RELEASE_VERSION := $(shell cat VERSION)
+ 
+ CC ?= gcc
+ CFLAGS ?= -O3 -g
+-CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
+-CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
+-CPPFLAGS += -DVERSION=\"$(VERSION)\"
++override CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
++override CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
++override CPPFLAGS += -DVERSION=\"$(VERSION)\"
+ LDFLAGS ?= -g
+ LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
+ 
+@@ -73,7 +73,7 @@ LIBS += -lnsl -lresolv -lsocket
+ endif
+ ifneq (,$(findstring Apple,$(shell $(CC) --version)))
+ # enabled in FSF GCC, disabled by default in Apple GCC
+-CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
++override CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
+ endif
+ 
+ all : $(BINS) vpnc.8
+-- 
+2.6.4
+
diff --git a/package/vpnc/0004-Makefile-provide-an-option-to-not-build-manpages.patch b/package/vpnc/0004-Makefile-provide-an-option-to-not-build-manpages.patch
new file mode 100644
index 0000000..7f71cdd
--- /dev/null
+++ b/package/vpnc/0004-Makefile-provide-an-option-to-not-build-manpages.patch
@@ -0,0 +1,58 @@
+From 3c16d0b7bf809a56affd6e1a4c0998027968b91a Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Mon, 8 Feb 2016 23:03:48 +0100
+Subject: [PATCH] Makefile: provide an option to not build manpages
+
+The process of generating the vpnc.8 man page consists in running the
+vpnc tool itself, and parse its --long-help output. While this is
+perfectly fine when building natively, it fails completely when
+cross-compiling: the vpnc binary that was built cannot be executed on
+the build machine.
+
+In order to support such situations with minimal changes, this patch
+adjusts the Makefile to make it understand a MANS variable. By
+default, it's defined to "vpnc.8", which means the manpage continues
+to be built as usual. However, if it's overriden to be empty, then no
+manpage is built.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 7ac225a..ea2cd41 100644
+--- a/Makefile
++++ b/Makefile
+@@ -54,6 +54,7 @@ endif
+ SRCS = sysdep.c vpnc-debug.c isakmp-pkt.c tunip.c config.c dh.c math_group.c supp.c decrypt-utils.c crypto.c $(CRYPTO_SRCS)
+ BINS = vpnc cisco-decrypt test-crypto
+ OBJS = $(addsuffix .o,$(basename $(SRCS)))
++MANS ?= vpnc.8
+ CRYPTO_OBJS = $(addsuffix .o,$(basename $(CRYPTO_SRCS)))
+ BINOBJS = $(addsuffix .o,$(BINS))
+ BINSRCS = $(addsuffix .c,$(BINS))
+@@ -76,7 +77,7 @@ ifneq (,$(findstring Apple,$(shell $(CC) --version)))
+ override CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
+ endif
+ 
+-all : $(BINS) vpnc.8
++all : $(BINS) $(MANS)
+ 
+ vpnc : $(OBJS) vpnc.o
+ 	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+@@ -136,7 +137,9 @@ install-common: all
+ 	install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
+ 	install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
+ 	install -m755 pcf2vpnc $(DESTDIR)$(BINDIR)
++ifneq ($(MANS),)
+ 	install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
++endif
+ 	install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
+ 	install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
+ 	install -m644 COPYING $(DESTDIR)$(DOCDIR)
+-- 
+2.6.4
+
diff --git a/package/vpnc/0005-Makefile-allow-passing-a-custom-path-to-libgcrypt-co.patch b/package/vpnc/0005-Makefile-allow-passing-a-custom-path-to-libgcrypt-co.patch
new file mode 100644
index 0000000..3148980
--- /dev/null
+++ b/package/vpnc/0005-Makefile-allow-passing-a-custom-path-to-libgcrypt-co.patch
@@ -0,0 +1,41 @@
+From 6180ca780e3a792bd632d8899c2b35991822c93d Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 8 Feb 2016 23:32:57 +0100
+Subject: [PATCH] Makefile: allow passing a custom path to libgcrypt-config
+
+The libgcrypt-config program may not be in the PATH, so this patch
+adjusts the Makefile so that it understands a LIBGCRYPT_CONFIG
+variable. By default, its value is libgcrypt-config so that the
+behavior is unchanged.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ Makefile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index ea2cd41..649ddfb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -61,13 +61,14 @@ BINSRCS = $(addsuffix .c,$(BINS))
+ VERSION ?= $(shell sh mk-version)
+ RELEASE_VERSION := $(shell cat VERSION)
+ 
++LIBGCRYPT_CONFIG ?= libgcrypt-config
+ CC ?= gcc
+ CFLAGS ?= -O3 -g
+ override CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
+-override CFLAGS +=  $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
++override CFLAGS +=  $(shell $(LIBGCRYPT_CONFIG) --cflags) $(CRYPTO_CFLAGS)
+ override CPPFLAGS += -DVERSION=\"$(VERSION)\"
+ LDFLAGS ?= -g
+-LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
++LIBS += $(shell $(LIBGCRYPT_CONFIG) --libs) $(CRYPTO_LDADD)
+ 
+ ifeq ($(shell uname -s), SunOS)
+ LIBS += -lnsl -lresolv -lsocket
+-- 
+2.6.4
+
diff --git a/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch b/package/vpnc/0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch
similarity index 53%
rename from package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
rename to package/vpnc/0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch
index 4b8446f..bad8118 100644
--- a/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
+++ b/package/vpnc/0006-config.c-Replace-deprecated-SUSv3-functions-with-POS.patch
@@ -1,27 +1,32 @@
-From ca1a9ad59ae07345720e315b928bb014a8aeea4c Mon Sep 17 00:00:00 2001
+From 627a45d88acf236cb36326919e4a2fa975c688bd Mon Sep 17 00:00:00 2001
 From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
 Date: Mon, 8 Feb 2016 23:05:23 +0100
-Subject: [PATCH] Replace deprecated SUSv3 functions with POSIX equivalents
+Subject: [PATCH] config.c: Replace deprecated SUSv3 functions with POSIX
+ equivalents
 
 Replace the deprecated SUSv3 function index() by its POSIX equivalent
-strchr().
+strchr(). This is necessary to successfully build vpnc with uClibc,
+when SUSv3 compatibility functions are not compiled in.
 
 Patch originally from Bernhard Reutner-Fischer
 <rep.dot.nop@gmail.com>.
 
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 ---
- config.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ config.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/config.c b/config.c
-index bdd0833..d1750ca 100644
+index 57778e3..11b363b 100644
 --- a/config.c
 +++ b/config.c
-@@ -456,7 +456,7 @@ static char *get_config_filename(const char *name, int add_dot_conf)
+@@ -657,8 +657,7 @@ static const struct config_names_s {
+ static char *get_config_filename(const char *name, int add_dot_conf)
  {
  	char *realname;
- 	
+-
 -	asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
 +	asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
  	return realname;
diff --git a/package/vpnc/Config.in b/package/vpnc/Config.in
index bc27331..caf8c20 100644
--- a/package/vpnc/Config.in
+++ b/package/vpnc/Config.in
@@ -1,8 +1,10 @@
 config BR2_PACKAGE_VPNC
 	bool "vpnc"
 	depends on BR2_USE_MMU # fork()
+	depends on BR2_USE_WCHAR
 	select BR2_PACKAGE_LIBGCRYPT
 	select BR2_PACKAGE_LIBGPG_ERROR
+	select BR2_PACKAGE_GNUTLS
 	help
 	  Client for Cisco VPN concentrator
 	  3000 Series VPN Concentrator
@@ -11,3 +13,7 @@ config BR2_PACKAGE_VPNC
 	  Juniper/Netscreen
 
 	  http://www.unix-ag.uni-kl.de/~massar/vpnc
+
+commit "vpnc needs a toolchain w/ wchar"
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR
diff --git a/package/vpnc/vpnc.hash b/package/vpnc/vpnc.hash
index 3474057..c35f0d5 100644
--- a/package/vpnc/vpnc.hash
+++ b/package/vpnc/vpnc.hash
@@ -1,2 +1,2 @@
 # locally computed hash
-sha256 925c8e879f78f1d575b69ee3868b886a0139926ea84c2138a89b9b7d8696f50a vpnc-70f1211f6f26e87e374d66f9a986e855215b8e3e.tar.gz
+sha256 d71ae6a6c2801c6c21490227d29896ea75deade05fc38153de9ae07b25a6a60d  vpnc-024aa17a0a86716cac0db185b44bf07ba4f8c135.tar.gz
diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk
index 5dfc2ba..62dedc6 100644
--- a/package/vpnc/vpnc.mk
+++ b/package/vpnc/vpnc.mk
@@ -4,24 +4,23 @@
 #
 ################################################################################
 
-VPNC_VERSION = 70f1211f6f26e87e374d66f9a986e855215b8e3e
+VPNC_VERSION = 024aa17a0a86716cac0db185b44bf07ba4f8c135
 VPNC_SITE = $(call github,ndpgroup,vpnc,$(VPNC_VERSION))
 VPNC_LICENSE = GPLv2+
 VPNC_LICENSE_FILES = COPYING
 
-VPNC_DEPENDENCIES = libgcrypt libgpg-error
-
-VPNC_LDFLAGS = $(TARGET_LDFLAGS) -lgcrypt -lgpg-error
-VPNC_CPPFLAGS = -DVERSION=\\\"$(VPNC_VERSION)\\\"
+VPNC_DEPENDENCIES = libgcrypt libgpg-error gnutls host-pkgconf
 
 define VPNC_BUILD_CMDS
-	$(MAKE)	-C $(@D) $(TARGET_CONFIGURE_OPTS) \
-		CPPFLAGS="$(VPNC_CPPFLAGS)" LDFLAGS="$(VPNC_LDFLAGS)"
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(TARGET_CONFIGURE_OPTS) \
+		LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config \
+		VERSION=$(VPNC_VERSION) MANS=
 endef
 
 define VPNC_INSTALL_TARGET_CMDS
-	$(MAKE) -C $(@D) install $(TARGET_CONFIGURE_OPTS) \
-		CPPFLAGS="$(VPNC_CPPFLAGS)" LDFLAGS="$(VPNC_LDFLAGS)" \
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install $(TARGET_CONFIGURE_OPTS) \
+		VERSION=$(VPNC_VERSION) MANS= \
 		DESTDIR="$(TARGET_DIR)" PREFIX=/usr
 endef
 
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 4/4] vpnc: add patches to fix build with the musl C library
  2016-02-10 23:03 [Buildroot] [PATCH 0/4] vpnc: update and fix musl build Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2016-02-10 23:03 ` [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version Thomas Petazzoni
@ 2016-02-10 23:03 ` Thomas Petazzoni
  2016-06-03 14:14   ` Thomas Petazzoni
  3 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2016-02-10 23:03 UTC (permalink / raw)
  To: buildroot

This commit adds hree patches that are needed to fix build issues on
musl:

 - <error.h> not available on musl
 - structure redefinitions due to direct inclusion of kernel headers
 - missing <sys/ttydefaults.h> inclusion

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...n-t-assume-error.h-is-available-on-all-Li.patch | 54 +++++++++++++++++++++
 ...p.c-don-t-include-linux-if_tun.h-on-Linux.patch | 56 ++++++++++++++++++++++
 ...g.c-add-missing-sys-ttydefaults.h-include.patch | 38 +++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 package/vpnc/0007-sysdep.h-don-t-assume-error.h-is-available-on-all-Li.patch
 create mode 100644 package/vpnc/0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch
 create mode 100644 package/vpnc/0009-config.c-add-missing-sys-ttydefaults.h-include.patch

diff --git a/package/vpnc/0007-sysdep.h-don-t-assume-error.h-is-available-on-all-Li.patch b/package/vpnc/0007-sysdep.h-don-t-assume-error.h-is-available-on-all-Li.patch
new file mode 100644
index 0000000..b08eedc
--- /dev/null
+++ b/package/vpnc/0007-sysdep.h-don-t-assume-error.h-is-available-on-all-Li.patch
@@ -0,0 +1,54 @@
+From 7f41ef32c8c887ee23ca83da4dfd7a4f27e01186 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 10 Feb 2016 23:09:51 +0100
+Subject: [PATCH] sysdep.h: don't assume <error.h> is available on all Linux
+ platforms
+
+The current logic in sysdep.h assumes that whenever you have __linux__
+or __GLIBC__ defined, then <error.h> functionality is
+available. However, the <error.h> functionality is a glibc-ism, not
+available in more standard-conformant C libraries such as the musl C
+library. With musl, __linux__ is defined (but of course not
+__GLIBC__). With the current logic, sysdep.h assumes that <error.h> is
+available, which isn't the case.
+
+This patch therefore changes the logic to only use <error.h> when
+__GLIBC__ is defined. It fixes the following build error:
+
+In file included from tunip.c:87:0:
+sysdep.h:41:19: fatal error: error.h: No such file or directory
+ #include <error.h>
+
+Original patch from
+http://git.alpinelinux.org/cgit/aports/tree/testing/vpnc/working.patch.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ sysdep.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index 137bf6d..fb65b31 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -38,11 +38,14 @@ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+ 
+ /***************************************************************************/
+ #if defined(__linux__) || defined(__GLIBC__)
++
++#ifdef __GLIBC__
+ #include <error.h>
++#define HAVE_ERROR     1
++#endif
+ 
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF  1
+-#define HAVE_ERROR     1
+ #define HAVE_UNSETENV  1
+ #define HAVE_SETENV    1
+ #endif
+-- 
+2.6.4
+
diff --git a/package/vpnc/0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch b/package/vpnc/0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch
new file mode 100644
index 0000000..a8b9e04
--- /dev/null
+++ b/package/vpnc/0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch
@@ -0,0 +1,56 @@
+From 2e2eab070384834036c1458c669070ed17d81dbe Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 10 Feb 2016 23:15:36 +0100
+Subject: [PATCH] sysdep.c: don't include <linux/if_tun.h> on Linux
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Including <linux/if_tun.h> in sysdep.c is not necessary since sysdep.h
+already includes <netinet/if_ether.h>. And this is actually
+potentially harmful since both files redefine the same 'struct
+ethhdr', causing the following build failure with the musl C library:
+
+In file included from sysdep.h:28:0,
+                 from sysdep.c:71:
+.../buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/netinet/if_ether.h:96:8: error: redefinition of ?struct ethhdr?
+ struct ethhdr {
+        ^
+In file included from .../buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/if_tun.h:20:0,
+                 from sysdep.c:62:
+.../buildroot/output/host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/if_ether.h:138:8: note: originally defined here
+ struct ethhdr {
+        ^
+
+Original patch from:
+http://git.alpinelinux.org/cgit/aports/tree/testing/vpnc/working.patch
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ sysdep.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/sysdep.c b/sysdep.c
+index d8f181d..f83543d 100644
+--- a/sysdep.c
++++ b/sysdep.c
+@@ -58,13 +58,11 @@
+ 
+ #if defined(__DragonFly__)
+ #include <net/tun/if_tun.h>
+-#elif defined(__linux__)
+-#include <linux/if_tun.h>
+ #elif defined(__APPLE__)
+ /* no header for tun */
+ #elif defined(__CYGWIN__)
+ #include "tap-win32.h"
+-#else
++#elif !defined(__linux__)
+ #include <net/if_tun.h>
+ #endif
+ 
+-- 
+2.6.4
+
diff --git a/package/vpnc/0009-config.c-add-missing-sys-ttydefaults.h-include.patch b/package/vpnc/0009-config.c-add-missing-sys-ttydefaults.h-include.patch
new file mode 100644
index 0000000..2b87c9a
--- /dev/null
+++ b/package/vpnc/0009-config.c-add-missing-sys-ttydefaults.h-include.patch
@@ -0,0 +1,38 @@
+From 17277915af703a4767de791916621d8f59aef516 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 10 Feb 2016 23:21:26 +0100
+Subject: [PATCH] config.c: add missing <sys/ttydefaults.h> include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This include is needed to get the definition of CEOT, otherwise the
+build fails with:
+
+config.c: In function ?vpnc_getline?:
+config.c:145:25: error: ?CEOT? undeclared (first use in this function)
+   if (llen == 0 && c == CEOT)
+                         ^
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6
+
+ config.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/config.c b/config.c
+index 11b363b..f47a534 100644
+--- a/config.c
++++ b/config.c
+@@ -31,6 +31,7 @@
+ #include <sys/types.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
++#include <sys/ttydefaults.h>
+ 
+ #include <gcrypt.h>
+ 
+-- 
+2.6.4
+
-- 
2.6.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site
  2016-02-10 23:03 ` [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site Thomas Petazzoni
@ 2016-04-19 22:04   ` Yann E. MORIN
  2016-04-20 21:12     ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Yann E. MORIN @ 2016-04-19 22:04 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-02-11 00:03 +0100, Thomas Petazzoni spake thusly:
> The vpnc upstream project has not made any tarball release since many
> years, but they have continued to update their Subversion
> repository.
> 
> A Github repository synced with the Subversion repository now exists
> at https://github.com/ndpgroup/vpnc, which is more practical to
> generate patches and submit pull requests. For this reason, we move to
> using this Github repository as the new source for the vpnc
> package. The specific commit that we use corresponds to version 0.5.3
> exactly.
> 
> All patches are re-formatted using Git.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

70f1211f6f26e87e374d66f9a986e855215b8e3e is indeed 0.5.3

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  ...le-cleanup-and-fix-the-VERSION-definitio.patch} | 24 +++++++++++-----
>  package/vpnc/0002-Don-t-build-manpages.patch       | 31 +++++++++++++++++++++
>  package/vpnc/0002-nomanual.patch                   | 15 ----------
>  ...recated-SUSv3-functions-with-POSIX-equiva.patch | 32 ++++++++++++++++++++++
>  package/vpnc/0003-susv3-legacy.patch               | 12 --------
>  package/vpnc/vpnc.hash                             |  2 +-
>  package/vpnc/vpnc.mk                               |  4 +--
>  7 files changed, 83 insertions(+), 37 deletions(-)
>  rename package/vpnc/{0001-fix-build.patch => 0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch} (78%)
>  create mode 100644 package/vpnc/0002-Don-t-build-manpages.patch
>  delete mode 100644 package/vpnc/0002-nomanual.patch
>  create mode 100644 package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
>  delete mode 100644 package/vpnc/0003-susv3-legacy.patch
> 
> diff --git a/package/vpnc/0001-fix-build.patch b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
> similarity index 78%
> rename from package/vpnc/0001-fix-build.patch
> rename to package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
> index e21348b..d091dde 100644
> --- a/package/vpnc/0001-fix-build.patch
> +++ b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
> @@ -1,14 +1,21 @@
> -Misc. Makefile cleanup and fix the VERSION definition.
> +From fd7e584bd28bd541464f8cb6cc72e76de2347640 Mon Sep 17 00:00:00 2001
> +From: Samuel Martin <s.martin49@gmail.com>
> +Date: Mon, 8 Feb 2016 23:02:45 +0100
> +Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
>  
>  Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> -
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>  ---
> -diff -purN vpnc-0.5.3.orig/Makefile vpnc-0.5.3/Makefile
> ---- vpnc-0.5.3.orig/Makefile	2012-08-06 00:03:22.677914146 +0200
> -+++ vpnc-0.5.3/Makefile	2012-08-06 00:06:58.506744901 +0200
> + Makefile | 40 +++++++++++++++++++---------------------
> + 1 file changed, 19 insertions(+), 21 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 9b96d83..1ca6459 100644
> +--- a/Makefile
> ++++ b/Makefile
>  @@ -19,21 +19,19 @@
>   #
> - # $Id: Makefile 312 2008-06-15 18:09:42Z Joerg Mayer $
> + # $Id$
>   
>  -DESTDIR=
>  -PREFIX=/usr/local
> @@ -60,7 +67,7 @@ diff -purN vpnc-0.5.3.orig/Makefile vpnc-0.5.3/Makefile
>   
>   ifeq ($(shell uname -s), SunOS)
>   LDFLAGS += -lnsl -lresolv -lsocket
> -@@ -84,7 +82,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-
> +@@ -81,7 +79,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-utils.o
>   	$(CC) -o $@ $^ $(LDFLAGS)
>   
>   .depend: $(SRCS) $(BINSRCS)
> @@ -69,3 +76,6 @@ diff -purN vpnc-0.5.3.orig/Makefile vpnc-0.5.3/Makefile
>   
>   vpnc-debug.c vpnc-debug.h : isakmp.h enum2debug.pl
>   	LC_ALL=C perl -w ./enum2debug.pl isakmp.h >vpnc-debug.c 2>vpnc-debug.h
> +-- 
> +2.6.4
> +
> diff --git a/package/vpnc/0002-Don-t-build-manpages.patch b/package/vpnc/0002-Don-t-build-manpages.patch
> new file mode 100644
> index 0000000..be4414e
> --- /dev/null
> +++ b/package/vpnc/0002-Don-t-build-manpages.patch
> @@ -0,0 +1,31 @@
> +From 6bbd03ec8928fd2a3056fc55ee48900fc88d3061 Mon Sep 17 00:00:00 2001
> +From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
> +Date: Mon, 8 Feb 2016 23:03:48 +0100
> +Subject: [PATCH] Don't build manpages
> +
> +Patch originally from Ulf Samuelsson <ulf.samuelsson@atmel.com>.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +---
> + Makefile | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 1ca6459..857bf8d 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -70,7 +70,10 @@ vpnc : $(OBJS) vpnc.o
> + 	$(CC) -o $@ $^ $(LDFLAGS)
> + 
> + vpnc.8 : vpnc.8.template makeman.pl vpnc
> +-	./makeman.pl
> ++	@echo "Cannot make manual when cross compiling"
> ++	touch $@
> ++
> ++#	./makeman.pl
> + 
> + vpnc-script : vpnc-script.in
> + 	sed -e 's,@''PREFIX''@,$(PREFIX),g' $< > $@ && chmod 755 $@
> +-- 
> +2.6.4
> +
> diff --git a/package/vpnc/0002-nomanual.patch b/package/vpnc/0002-nomanual.patch
> deleted file mode 100644
> index 7f2ea53..0000000
> --- a/package/vpnc/0002-nomanual.patch
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -diff -urN vpnc-0.5.3-0rig/Makefile vpnc-0.5.3/Makefile
> ---- vpnc-0.5.3-0rig/Makefile	2008-11-19 21:36:12.000000000 +0100
> -+++ vpnc-0.5.3/Makefile	2009-01-15 00:38:36.000000000 +0100
> -@@ -72,7 +72,10 @@
> - 	$(CC) -o $@ $^ $(LDFLAGS)
> - 
> - vpnc.8 : vpnc.8.template makeman.pl vpnc
> --	./makeman.pl
> -+	@echo "Cannot make manual when cross compiling"
> -+	touch $@
> -+
> -+#	./makeman.pl
> - 
> - vpnc-script : vpnc-script.in
> - 	sed -e 's,@''PREFIX''@,$(PREFIX),g' $< > $@ && chmod 755 $@
> diff --git a/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch b/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
> new file mode 100644
> index 0000000..4b8446f
> --- /dev/null
> +++ b/package/vpnc/0003-Replace-deprecated-SUSv3-functions-with-POSIX-equiva.patch
> @@ -0,0 +1,32 @@
> +From ca1a9ad59ae07345720e315b928bb014a8aeea4c Mon Sep 17 00:00:00 2001
> +From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
> +Date: Mon, 8 Feb 2016 23:05:23 +0100
> +Subject: [PATCH] Replace deprecated SUSv3 functions with POSIX equivalents
> +
> +Replace the deprecated SUSv3 function index() by its POSIX equivalent
> +strchr().
> +
> +Patch originally from Bernhard Reutner-Fischer
> +<rep.dot.nop@gmail.com>.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +---
> + config.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/config.c b/config.c
> +index bdd0833..d1750ca 100644
> +--- a/config.c
> ++++ b/config.c
> +@@ -456,7 +456,7 @@ static char *get_config_filename(const char *name, int add_dot_conf)
> + {
> + 	char *realname;
> + 	
> +-	asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
> ++	asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
> + 	return realname;
> + }
> + 
> +-- 
> +2.6.4
> +
> diff --git a/package/vpnc/0003-susv3-legacy.patch b/package/vpnc/0003-susv3-legacy.patch
> deleted file mode 100644
> index 2e577e3..0000000
> --- a/package/vpnc/0003-susv3-legacy.patch
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -diff -rdup vpnc-0.5.1.oorig/config.c vpnc-0.5.1/config.c
> ---- vpnc-0.5.1.oorig/config.c	2007-09-10 22:39:48.000000000 +0200
> -+++ vpnc-0.5.1/config.c	2007-09-19 14:19:46.000000000 +0200
> -@@ -538,7 +538,7 @@ static char *get_config_filename(const c
> - {
> - 	char *realname;
> - 	
> --	asprintf(&realname, "%s%s%s", index(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
> -+	asprintf(&realname, "%s%s%s", strchr(name, '/') ? "" : "/etc/vpnc/", name, add_dot_conf ? ".conf" : "");
> - 	return realname;
> - }
> - 
> diff --git a/package/vpnc/vpnc.hash b/package/vpnc/vpnc.hash
> index a79df8f..3474057 100644
> --- a/package/vpnc/vpnc.hash
> +++ b/package/vpnc/vpnc.hash
> @@ -1,2 +1,2 @@
>  # locally computed hash
> -sha256 46cea3bd02f207c62c7c6f2f22133382602baeda1dc320747809e94881414884 vpnc-0.5.3.tar.gz
> +sha256 925c8e879f78f1d575b69ee3868b886a0139926ea84c2138a89b9b7d8696f50a vpnc-70f1211f6f26e87e374d66f9a986e855215b8e3e.tar.gz
> diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk
> index f5ab5fc..5dfc2ba 100644
> --- a/package/vpnc/vpnc.mk
> +++ b/package/vpnc/vpnc.mk
> @@ -4,8 +4,8 @@
>  #
>  ################################################################################
>  
> -VPNC_VERSION = 0.5.3
> -VPNC_SITE = http://www.unix-ag.uni-kl.de/~massar/vpnc
> +VPNC_VERSION = 70f1211f6f26e87e374d66f9a986e855215b8e3e
> +VPNC_SITE = $(call github,ndpgroup,vpnc,$(VPNC_VERSION))
>  VPNC_LICENSE = GPLv2+
>  VPNC_LICENSE_FILES = COPYING
>  
> -- 
> 2.6.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001
  2016-02-10 23:03 ` [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001 Thomas Petazzoni
@ 2016-04-19 22:05   ` Yann E. MORIN
  2016-04-20 21:12     ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Yann E. MORIN @ 2016-04-19 22:05 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-02-11 00:03 +0100, Thomas Petazzoni spake thusly:
> Patch 0001 that adjusts the Makefile to solve cross-compilation issues
> does a lot of whitespace changes that are unnecessary. We remove all
> those noisy changes to keep only the really interesting ones.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  ...ile-cleanup-and-fix-the-VERSION-definitio.patch | 60 +++++++---------------
>  1 file changed, 19 insertions(+), 41 deletions(-)
> 
> diff --git a/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
> index d091dde..cad3e1a 100644
> --- a/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
> +++ b/package/vpnc/0001-Misc.-Makefile-cleanup-and-fix-the-VERSION-definitio.patch
> @@ -1,4 +1,4 @@
> -From fd7e584bd28bd541464f8cb6cc72e76de2347640 Mon Sep 17 00:00:00 2001
> +From 40b35a82ea581f5dfb1b0b20c4ba3e9f01f35107 Mon Sep 17 00:00:00 2001
>  From: Samuel Martin <s.martin49@gmail.com>
>  Date: Mon, 8 Feb 2016 23:02:45 +0100
>  Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
> @@ -6,39 +6,24 @@ Subject: [PATCH] Misc. Makefile cleanup and fix the VERSION definition.
>  Signed-off-by: Samuel Martin <s.martin49@gmail.com>
>  Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>  ---
> - Makefile | 40 +++++++++++++++++++---------------------
> - 1 file changed, 19 insertions(+), 21 deletions(-)
> + Makefile | 10 ++++------
> + 1 file changed, 4 insertions(+), 6 deletions(-)
>  
>  diff --git a/Makefile b/Makefile
> -index 9b96d83..1ca6459 100644
> +index 9b96d83..62742d0 100644
>  --- a/Makefile
>  +++ b/Makefile
> -@@ -19,21 +19,19 @@
> - #
> +@@ -20,7 +20,7 @@
>   # $Id$
>   
> --DESTDIR=
> + DESTDIR=
>  -PREFIX=/usr/local
> --ETCDIR=/etc/vpnc
> --BINDIR=$(PREFIX)/bin
> --SBINDIR=$(PREFIX)/sbin
> --MANDIR=$(PREFIX)/share/man
> --DOCDIR=$(PREFIX)/share/doc/vpnc
> --
> --SRCS = sysdep.c vpnc-debug.c isakmp-pkt.c tunip.c config.c dh.c math_group.c supp.c decrypt-utils.c
> --BINS = vpnc cisco-decrypt
> --OBJS = $(addsuffix .o,$(basename $(SRCS)))
> -+DESTDIR =
> -+PREFIX ?= /usr/local
> -+ETCDIR  = /etc/vpnc
> -+BINDIR  = $(PREFIX)/bin
> -+SBINDIR = $(PREFIX)/sbin
> -+MANDIR  = $(PREFIX)/share/man
> -+DOCDIR  = $(PREFIX)/share/doc/vpnc
> -+
> -+SRCS    = sysdep.c vpnc-debug.c isakmp-pkt.c tunip.c config.c dh.c math_group.c supp.c decrypt-utils.c
> -+BINS    = vpnc cisco-decrypt
> -+OBJS    = $(addsuffix .o,$(basename $(SRCS)))
> ++PREFIX?=/usr/local
> + ETCDIR=/etc/vpnc
> + BINDIR=$(PREFIX)/bin
> + SBINDIR=$(PREFIX)/sbin
> +@@ -32,8 +32,6 @@ BINS = vpnc cisco-decrypt
> + OBJS = $(addsuffix .o,$(basename $(SRCS)))
>   BINOBJS = $(addsuffix .o,$(BINS))
>   BINSRCS = $(addsuffix .c,$(BINS))
>  -VERSION := $(shell sh mk-version)
> @@ -46,27 +31,20 @@ index 9b96d83..1ca6459 100644
>   
>   # The license of vpnc (Gpl >= 2) is quite likely incompatible with the
>   # openssl license. Openssl is currently used to provide certificate
> -@@ -50,13 +48,13 @@ RELEASE_VERSION := $(shell cat VERSION)
> +@@ -50,11 +48,11 @@ RELEASE_VERSION := $(shell cat VERSION)
>   #OPENSSL_GPL_VIOLATION = -DOPENSSL_GPL_VIOLATION
>   #OPENSSLLIBS = -lcrypto
>   
>  -CC=gcc
> --CFLAGS ?= -O3 -g
> --CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
> --CFLAGS +=  $(shell libgcrypt-config --cflags)
> ++CC ?= gcc
> + CFLAGS ?= -O3 -g
> + CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
> + CFLAGS +=  $(shell libgcrypt-config --cflags)
>  -CPPFLAGS += -DVERSION=\"$(VERSION)\" $(OPENSSL_GPL_VIOLATION)
> --LDFLAGS ?= -g
> --LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
> -+CC       ?= gcc
> -+CFLAGS   ?= -O3 -g
> -+CFLAGS   += -W -Wall -Wmissing-declarations -Wwrite-strings
> -+CFLAGS   += $(shell libgcrypt-config --cflags)
>  +CPPFLAGS += $(OPENSSL_GPL_VIOLATION)
> -+LDFLAGS  ?= -g
> -+LDFLAGS  += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
> + LDFLAGS ?= -g
> + LDFLAGS += $(shell libgcrypt-config --libs) $(OPENSSLLIBS)
>   
> - ifeq ($(shell uname -s), SunOS)
> - LDFLAGS += -lnsl -lresolv -lsocket
>  @@ -81,7 +79,7 @@ cisco-decrypt : cisco-decrypt.o decrypt-utils.o
>   	$(CC) -o $@ $^ $(LDFLAGS)
>   
> -- 
> 2.6.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version
  2016-02-10 23:03 ` [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version Thomas Petazzoni
@ 2016-04-19 22:16   ` Yann E. MORIN
  2016-06-03 14:14     ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Yann E. MORIN @ 2016-04-19 22:16 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2016-02-11 00:03 +0100, Thomas Petazzoni spake thusly:
> While the official upstream has not published any new tarball, they
> have continued to update their Subversion repository with additional
> changes. This commit therefore updates the vpnc package to a newer
> version, using the Github repository that replicates the original
> Subversion repository.
> 
> Since the update required some updates to the patches, we took this
> opportunity to split them in more fine-grained changes, and document
> them more properly. Consequently:
> 
>  - The patch 0001 that fixes the Makefile gets split into 3 patches,
>    0001, 0002 and 0003, each for one specific issue.
> 
>  - Patch 0002 to disable building the manpages gets changed into a
>    solution that is potentially upstreamable, and is now patch 0004.
> 
>  - A new patch 0005 is added to specify a custom libgcrypt-config
>    path, since this tool is now used to know how to link with
>    libgcrypt.
> 
>  - The SUSv3 function removal patch is now patch 0006, and gains a
>    better commit log.
> 
> Also, this vpnc version now depends on gnutls, which basically is a
> better replacement for OpenSSL, whose support was not enabled by
> default due to licensing issues (vpnc is under the GPL, which isn't
> compatible with the OpenSSL license).
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
[--SNIP--]
> diff --git a/package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch b/package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch
> new file mode 100644
> index 0000000..5b6df68
> --- /dev/null
> +++ b/package/vpnc/0001-Makefile-allow-to-override-the-PREFIX-variable.patch
> @@ -0,0 +1,32 @@
> +From 7314d232f8e85879d8f4c311ced44ee5b21fb239 Mon Sep 17 00:00:00 2001
> +From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +Date: Wed, 10 Feb 2016 23:26:27 +0100
> +Subject: [PATCH] Makefile: allow to override the PREFIX variable
> +
> +Some people may not want to install in /usr/local, so this commit
> +makes it possible to override the PREFIX variable from the make
> +command line.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +---
> +Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6

There has been a comment to request the patches be mailed to the "real"
upstream, and the PR was closed.

[--SNIP--]
> diff --git a/package/vpnc/Config.in b/package/vpnc/Config.in
> index bc27331..caf8c20 100644
> --- a/package/vpnc/Config.in
> +++ b/package/vpnc/Config.in
> @@ -1,8 +1,10 @@
>  config BR2_PACKAGE_VPNC
>  	bool "vpnc"
>  	depends on BR2_USE_MMU # fork()
> +	depends on BR2_USE_WCHAR

Is it because of gnutls, or does vpnc requires it for itself?
If the former, you forgot the associated comment:

    depends on BR2_USE_WCHAR # gnutls

>  	select BR2_PACKAGE_LIBGCRYPT
>  	select BR2_PACKAGE_LIBGPG_ERROR
> +	select BR2_PACKAGE_GNUTLS
>  	help
>  	  Client for Cisco VPN concentrator
>  	  3000 Series VPN Concentrator
> @@ -11,3 +13,7 @@ config BR2_PACKAGE_VPNC
>  	  Juniper/Netscreen
>  
>  	  http://www.unix-ag.uni-kl.de/~massar/vpnc
> +
> +commit "vpnc needs a toolchain w/ wchar"

Nope, this is not a commit; this is a comment. ;-)

Regards,
Yann E. MORIN.

> +	depends on BR2_USE_MMU
> +	depends on !BR2_USE_WCHAR
> diff --git a/package/vpnc/vpnc.hash b/package/vpnc/vpnc.hash
> index 3474057..c35f0d5 100644
> --- a/package/vpnc/vpnc.hash
> +++ b/package/vpnc/vpnc.hash
> @@ -1,2 +1,2 @@
>  # locally computed hash
> -sha256 925c8e879f78f1d575b69ee3868b886a0139926ea84c2138a89b9b7d8696f50a vpnc-70f1211f6f26e87e374d66f9a986e855215b8e3e.tar.gz
> +sha256 d71ae6a6c2801c6c21490227d29896ea75deade05fc38153de9ae07b25a6a60d  vpnc-024aa17a0a86716cac0db185b44bf07ba4f8c135.tar.gz
> diff --git a/package/vpnc/vpnc.mk b/package/vpnc/vpnc.mk
> index 5dfc2ba..62dedc6 100644
> --- a/package/vpnc/vpnc.mk
> +++ b/package/vpnc/vpnc.mk
> @@ -4,24 +4,23 @@
>  #
>  ################################################################################
>  
> -VPNC_VERSION = 70f1211f6f26e87e374d66f9a986e855215b8e3e
> +VPNC_VERSION = 024aa17a0a86716cac0db185b44bf07ba4f8c135
>  VPNC_SITE = $(call github,ndpgroup,vpnc,$(VPNC_VERSION))
>  VPNC_LICENSE = GPLv2+
>  VPNC_LICENSE_FILES = COPYING
>  
> -VPNC_DEPENDENCIES = libgcrypt libgpg-error
> -
> -VPNC_LDFLAGS = $(TARGET_LDFLAGS) -lgcrypt -lgpg-error
> -VPNC_CPPFLAGS = -DVERSION=\\\"$(VPNC_VERSION)\\\"
> +VPNC_DEPENDENCIES = libgcrypt libgpg-error gnutls host-pkgconf
>  
>  define VPNC_BUILD_CMDS
> -	$(MAKE)	-C $(@D) $(TARGET_CONFIGURE_OPTS) \
> -		CPPFLAGS="$(VPNC_CPPFLAGS)" LDFLAGS="$(VPNC_LDFLAGS)"
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
> +		$(TARGET_CONFIGURE_OPTS) \
> +		LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config \
> +		VERSION=$(VPNC_VERSION) MANS=
>  endef
>  
>  define VPNC_INSTALL_TARGET_CMDS
> -	$(MAKE) -C $(@D) install $(TARGET_CONFIGURE_OPTS) \
> -		CPPFLAGS="$(VPNC_CPPFLAGS)" LDFLAGS="$(VPNC_LDFLAGS)" \
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install $(TARGET_CONFIGURE_OPTS) \
> +		VERSION=$(VPNC_VERSION) MANS= \
>  		DESTDIR="$(TARGET_DIR)" PREFIX=/usr
>  endef
>  
> -- 
> 2.6.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site
  2016-04-19 22:04   ` Yann E. MORIN
@ 2016-04-20 21:12     ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2016-04-20 21:12 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 20 Apr 2016 00:04:00 +0200, Yann E. MORIN wrote:
> Thomas, All,
> 
> On 2016-02-11 00:03 +0100, Thomas Petazzoni spake thusly:
> > The vpnc upstream project has not made any tarball release since many
> > years, but they have continued to update their Subversion
> > repository.
> > 
> > A Github repository synced with the Subversion repository now exists
> > at https://github.com/ndpgroup/vpnc, which is more practical to
> > generate patches and submit pull requests. For this reason, we move to
> > using this Github repository as the new source for the vpnc
> > package. The specific commit that we use corresponds to version 0.5.3
> > exactly.
> > 
> > All patches are re-formatted using Git.
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> 70f1211f6f26e87e374d66f9a986e855215b8e3e is indeed 0.5.3
> 
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Thanks, I've applied the patch!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001
  2016-04-19 22:05   ` Yann E. MORIN
@ 2016-04-20 21:12     ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2016-04-20 21:12 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 20 Apr 2016 00:05:34 +0200, Yann E. MORIN wrote:
> Thomas, All,
> 
> On 2016-02-11 00:03 +0100, Thomas Petazzoni spake thusly:
> > Patch 0001 that adjusts the Makefile to solve cross-compilation issues
> > does a lot of whitespace changes that are unnecessary. We remove all
> > those noisy changes to keep only the really interesting ones.
> > 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Thanks, I've applied the patch!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version
  2016-04-19 22:16   ` Yann E. MORIN
@ 2016-06-03 14:14     ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2016-06-03 14:14 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 20 Apr 2016 00:16:37 +0200, Yann E. MORIN wrote:

> > +Submitted upstream at https://github.com/ndpgroup/vpnc/pull/6  
> 
> There has been a comment to request the patches be mailed to the "real"
> upstream, and the PR was closed.

I submitted upstream:
http://lists.unix-ag.uni-kl.de/pipermail/vpnc-devel/2016-June/004186.html.

> >  	depends on BR2_USE_MMU # fork()
> > +	depends on BR2_USE_WCHAR  
> 
> Is it because of gnutls, or does vpnc requires it for itself?
> If the former, you forgot the associated comment:

Because of gnutls, so I've added the comment.

> > +commit "vpnc needs a toolchain w/ wchar"  
> 
> Nope, this is not a commit; this is a comment. ;-)

Fixed. I've applied with those changes.

Thanks for the review!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH 4/4] vpnc: add patches to fix build with the musl C library
  2016-02-10 23:03 ` [Buildroot] [PATCH 4/4] vpnc: add patches to fix build with the musl C library Thomas Petazzoni
@ 2016-06-03 14:14   ` Thomas Petazzoni
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2016-06-03 14:14 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 11 Feb 2016 00:03:12 +0100, Thomas Petazzoni wrote:
> This commit adds hree patches that are needed to fix build issues on
> musl:
> 
>  - <error.h> not available on musl
>  - structure redefinitions due to direct inclusion of kernel headers
>  - missing <sys/ttydefaults.h> inclusion
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  ...n-t-assume-error.h-is-available-on-all-Li.patch | 54 +++++++++++++++++++++
>  ...p.c-don-t-include-linux-if_tun.h-on-Linux.patch | 56 ++++++++++++++++++++++
>  ...g.c-add-missing-sys-ttydefaults.h-include.patch | 38 +++++++++++++++
>  3 files changed, 148 insertions(+)
>  create mode 100644 package/vpnc/0007-sysdep.h-don-t-assume-error.h-is-available-on-all-Li.patch
>  create mode 100644 package/vpnc/0008-sysdep.c-don-t-include-linux-if_tun.h-on-Linux.patch
>  create mode 100644 package/vpnc/0009-config.c-add-missing-sys-ttydefaults.h-include.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-06-03 14:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10 23:03 [Buildroot] [PATCH 0/4] vpnc: update and fix musl build Thomas Petazzoni
2016-02-10 23:03 ` [Buildroot] [PATCH 1/4] vpnc: switch to github as the new site Thomas Petazzoni
2016-04-19 22:04   ` Yann E. MORIN
2016-04-20 21:12     ` Thomas Petazzoni
2016-02-10 23:03 ` [Buildroot] [PATCH 2/4] vpnc: simplify patch 0001 Thomas Petazzoni
2016-04-19 22:05   ` Yann E. MORIN
2016-04-20 21:12     ` Thomas Petazzoni
2016-02-10 23:03 ` [Buildroot] [PATCH 3/4] vpnc: bump to newer upstream version Thomas Petazzoni
2016-04-19 22:16   ` Yann E. MORIN
2016-06-03 14:14     ` Thomas Petazzoni
2016-02-10 23:03 ` [Buildroot] [PATCH 4/4] vpnc: add patches to fix build with the musl C library Thomas Petazzoni
2016-06-03 14:14   ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.