Browse Source

Merge pull request #1416 from jow-/vpnc-musl-compat

vpnc: fix musl compatibility
Jo-Philipp Wich 9 years ago
parent
commit
23bd12a89a
3 changed files with 46 additions and 4 deletions
  1. 1
    1
      net/vpnc/Makefile
  2. 3
    3
      net/vpnc/patches/001-cross.patch
  3. 42
    0
      net/vpnc/patches/100-musl-compat.patch

+ 1
- 1
net/vpnc/Makefile View File

@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
10 10
 PKG_NAME:=vpnc
11 11
 PKG_REV:=550
12 12
 PKG_VERSION:=0.5.3.r$(PKG_REV)
13
-PKG_RELEASE:=1
13
+PKG_RELEASE:=2
14 14
 
15 15
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 16
 PKG_SOURCE_URL:=http://svn.unix-ag.uni-kl.de/vpnc/trunk/

+ 3
- 3
net/vpnc/patches/001-cross.patch View File

@@ -1,7 +1,7 @@
1 1
 --- a/Makefile
2 2
 +++ b/Makefile
3 3
 @@ -20,7 +20,7 @@
4
- # $Id$
4
+ # $Id: Makefile 539 2013-12-04 13:41:04Z Antonio Borneo $
5 5
  
6 6
  DESTDIR=
7 7
 -PREFIX=/usr/local
@@ -9,7 +9,7 @@
9 9
  ETCDIR=/etc/vpnc
10 10
  BINDIR=$(PREFIX)/bin
11 11
  SBINDIR=$(PREFIX)/sbin
12
-@@ -57,18 +57,15 @@
12
+@@ -57,18 +57,15 @@ OBJS = $(addsuffix .o,$(basename $(SRCS)
13 13
  CRYPTO_OBJS = $(addsuffix .o,$(basename $(CRYPTO_SRCS)))
14 14
  BINOBJS = $(addsuffix .o,$(BINS))
15 15
  BINSRCS = $(addsuffix .c,$(BINS))
@@ -31,7 +31,7 @@
31 31
  LIBS += -lnsl -lresolv -lsocket
32 32
  endif
33 33
  ifneq (,$(findstring Apple,$(shell $(CC) --version)))
34
-@@ -82,7 +79,7 @@
34
+@@ -82,7 +79,7 @@ vpnc : $(OBJS) vpnc.o
35 35
  	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
36 36
  
37 37
  vpnc.8 : vpnc.8.template makeman.pl vpnc

+ 42
- 0
net/vpnc/patches/100-musl-compat.patch View File

@@ -0,0 +1,42 @@
1
+--- a/sysdep.h
2
++++ b/sysdep.h
3
+@@ -37,12 +37,14 @@ int tun_read(int fd, unsigned char *buf,
4
+ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
5
+ 
6
+ /***************************************************************************/
7
+-#if defined(__linux__) || defined(__GLIBC__)
8
++#if defined(__GLIBC__) || defined(__UCLIBC__)
9
+ #include <error.h>
10
++#define HAVE_ERROR     1
11
++#endif
12
+ 
13
++#if defined(__linux__) || defined(__GLIBC__)
14
+ #define HAVE_VASPRINTF 1
15
+ #define HAVE_ASPRINTF  1
16
+-#define HAVE_ERROR     1
17
+ #define HAVE_UNSETENV  1
18
+ #define HAVE_SETENV    1
19
+ #endif
20
+--- a/sysdep.c
21
++++ b/sysdep.c
22
+@@ -59,7 +59,9 @@
23
+ #if defined(__DragonFly__)
24
+ #include <net/tun/if_tun.h>
25
+ #elif defined(__linux__)
26
+-#include <linux/if_tun.h>
27
++# if defined(__GLIBC__) || defined(__UCLIBC__)
28
++#  include <linux/if_tun.h>
29
++# endif
30
+ #elif defined(__APPLE__)
31
+ /* no header for tun */
32
+ #elif defined(__CYGWIN__)
33
+--- a/config.c
34
++++ b/config.c
35
+@@ -28,6 +28,7 @@
36
+ #include <unistd.h>
37
+ #include <string.h>
38
+ #include <errno.h>
39
++#include <sys/ttydefaults.h>
40
+ #include <sys/types.h>
41
+ #include <sys/utsname.h>
42
+ #include <sys/wait.h>