diff -urN stunnel.orig/Makefile stunnel/Makefile --- stunnel.orig/Makefile Fri May 13 02:23:55 2005 +++ stunnel/Makefile Fri May 20 08:34:08 2005 @@ -7,6 +7,7 @@ PORTNAME= stunnel PORTVERSION= 4.10 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= http://www.stunnel.org/download/stunnel/src/ \ ftp://stunnel.mirt.net/stunnel/OBSOLETE/ \ @@ -35,6 +36,22 @@ CONFIGURE_ARGS+= --enable-ipv6 .endif +.if defined(WITH_UCONTEXT) +EXTRA_PATCHES+= ${FILESDIR}/common.h-ucontext.patch +.elif defined(WITH_FORK) +EXTRA_PATCHES+= ${FILESDIR}/common.h-fork.patch +.else +EXTRA_PATCHES+= ${FILESDIR}/common.h-pthread.patch +.endif + +pre-everything:: + @${ECHO} + @${ECHO} "You can build ${PORTNAME} with the following options:" + @${ECHO} "WITH_UCONTEXT use ucontext(3) model. Currently has known problems" + @${ECHO} "WITH_FORK use fork(2) model" + @${ECHO} "default is to use pthread(3) model" + @${ECHO} + post-patch: # place files under /var/tmp so that this can be run by an unprivileged user # user stunnel and group stunnel @@ -83,7 +100,7 @@ .if ${OSVERSION} > 500000 .if !defined(WITH_STUNNEL_SSL_ENGINE) -EXTRA_PATCHES= ${FILESDIR}/ssl-noengine.patch +EXTRA_PATCHES+= ${FILESDIR}/ssl-noengine.patch pre-patch: @${ECHO} "*************************************************************************" @${ECHO} "Note: you have to explicitly define WITH_STUNNEL_SSL_ENGINE to activate" diff -urN stunnel.orig/files/common.h-fork.patch stunnel/files/common.h-fork.patch --- stunnel.orig/files/common.h-fork.patch Thu Jan 1 02:00:00 1970 +++ stunnel/files/common.h-fork.patch Mon May 16 19:53:09 2005 @@ -0,0 +1,21 @@ +--- src/common.h.orig Mon May 16 19:50:46 2005 ++++ src/common.h Mon May 16 19:53:05 2005 +@@ -38,18 +38,7 @@ + #endif + + /* threads model */ +-#if HAVE_UCONTEXT_H && HAVE_GETCONTEXT && HAVE_POLL +-#define USE_UCONTEXT +-#include +-#elif HAVE_PTHREAD_H && HAVE_LIBPTHREAD +-#define USE_PTHREAD +-#include +-#define THREADS +-#define _REENTRANT +-#define _THREAD_SAFE +-#else + #define USE_FORK +-#endif + + /* TCP wrapper */ + #if HAVE_TCPD_H && HAVE_LIBWRAP diff -urN stunnel.orig/files/common.h-pthread.patch stunnel/files/common.h-pthread.patch --- stunnel.orig/files/common.h-pthread.patch Thu Jan 1 02:00:00 1970 +++ stunnel/files/common.h-pthread.patch Mon May 16 19:52:51 2005 @@ -0,0 +1,21 @@ +--- src/common.h.orig Mon May 16 19:50:46 2005 ++++ src/common.h Mon May 16 19:52:45 2005 +@@ -38,18 +38,11 @@ + #endif + + /* threads model */ +-#if HAVE_UCONTEXT_H && HAVE_GETCONTEXT && HAVE_POLL +-#define USE_UCONTEXT +-#include +-#elif HAVE_PTHREAD_H && HAVE_LIBPTHREAD + #define USE_PTHREAD + #include + #define THREADS + #define _REENTRANT + #define _THREAD_SAFE +-#else +-#define USE_FORK +-#endif + + /* TCP wrapper */ + #if HAVE_TCPD_H && HAVE_LIBWRAP diff -urN stunnel.orig/files/common.h-ucontext.patch stunnel/files/common.h-ucontext.patch --- stunnel.orig/files/common.h-ucontext.patch Thu Jan 1 02:00:00 1970 +++ stunnel/files/common.h-ucontext.patch Mon May 16 19:52:19 2005 @@ -0,0 +1,21 @@ +--- src/common.h.orig Mon May 16 19:50:46 2005 ++++ src/common.h Mon May 16 19:51:49 2005 +@@ -38,18 +38,8 @@ + #endif + + /* threads model */ +-#if HAVE_UCONTEXT_H && HAVE_GETCONTEXT && HAVE_POLL + #define USE_UCONTEXT + #include +-#elif HAVE_PTHREAD_H && HAVE_LIBPTHREAD +-#define USE_PTHREAD +-#include +-#define THREADS +-#define _REENTRANT +-#define _THREAD_SAFE +-#else +-#define USE_FORK +-#endif + + /* TCP wrapper */ + #if HAVE_TCPD_H && HAVE_LIBWRAP