1999-01-18 04:27:03 +00:00
# New ports collection makefile for: stunnel
# Date created: Mon Jan 11 11:53:54 EET 1999
# Whom: Martti Kuparinen <martti.kuparinen@ericsson.com>
#
1999-08-31 01:53:22 +00:00
# $FreeBSD$
1999-01-18 04:27:03 +00:00
#
2000-04-09 18:34:06 +00:00
PORTNAME = stunnel
2010-02-03 09:33:25 +00:00
PORTVERSION = 4.29
1999-01-18 04:27:03 +00:00
CATEGORIES = security
2001-08-02 19:04:01 +00:00
MASTER_SITES = http://www.stunnel.org/download/stunnel/src/ \
2005-11-01 00:18:03 +00:00
ftp://stunnel.mirt.net/stunnel/ \
2004-06-03 10:48:32 +00:00
ftp://stunnel.mirt.net/stunnel/OBSOLETE/ \
ftp://opensores.thebunker.net/pub/mirrors/stunnel/download/stunnel/src/
1999-01-18 04:27:03 +00:00
2002-09-20 09:29:11 +00:00
MAINTAINER = roam@FreeBSD.org
2004-06-03 11:38:01 +00:00
COMMENT = SSL encryption wrapper for standard network daemons
2003-03-23 10:35:14 +00:00
2009-08-02 19:36:34 +00:00
USE_AUTOTOOLS = libtool:22
2000-09-22 01:59:06 +00:00
USE_OPENSSL = YES
2008-01-26 14:13:43 +00:00
USE_RC_SUBR = stunnel
1999-01-18 04:27:03 +00:00
2001-11-01 08:28:38 +00:00
GNU_CONFIGURE = yes
2003-01-09 09:54:54 +00:00
CONFIGURE_ARGS = --localstatedir= /var/tmp --with-pem-dir= ${ PEM_DIR } \
2007-10-29 16:45:19 +00:00
--enable-static --disable-fips
2000-02-20 15:05:06 +00:00
2004-06-03 11:38:01 +00:00
. i f ! d e f i n e d ( N O P O R T D O C S )
MAN8 = stunnel.8 stunnel.fr.8 stunnel.pl.8
. e n d i f
1999-01-18 04:27:03 +00:00
2001-11-07 11:01:38 +00:00
PEM_DIR ?= ${ PREFIX } /etc
2005-06-14 09:07:12 +00:00
OPTIONS = FORK "use the fork(3) threading model" off \
PTHREAD "use the pthread(3) threading model (default)" on \
UCONTEXT "use the ucontext(3) threading model" off \
2009-11-13 10:58:57 +00:00
DH "use Diffie-Hellman key negotiation" off \
IPV6 "enable IPv6 support" off \
LIBWRAP "use TCP wrappers" on
2005-06-14 09:07:12 +00:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2009-11-13 10:58:57 +00:00
. i f d e f i n e d ( W I T H _ D H )
CONFIGURE_ARGS += --enable-dh
. e l s e
CONFIGURE_ARGS += --disable-dh
. e n d i f
2004-12-27 14:33:19 +00:00
. i f d e f i n e d ( W I T H _ I P V 6 )
CONFIGURE_ARGS += --enable-ipv6
2009-11-13 10:58:57 +00:00
. e l s e
CONFIGURE_ARGS += --disable-ipv6
. e n d i f
. i f d e f i n e d ( W I T H _ L I B W R A P )
CONFIGURE_ARGS += --enable-libwrap
LDFLAGS += -lwrap
. e l s e
CONFIGURE_ARGS += --disable-libwrap
2004-12-27 14:33:19 +00:00
. e n d i f
2005-06-14 08:58:47 +00:00
. i f d e f i n e d ( W I T H _ U C O N T E X T ) & & d e f i n e d ( W I T H _ F O R K ) | | d e f i n e d ( W I T H _ U C O N T E X T ) & & d e f i n e d ( W I T H _ P T H R E A D ) | | d e f i n e d ( W I T H _ F O R K ) & & d e f i n e d ( W I T H _ P T H R E A D )
BROKEN = 'The WITH_UCONTEXT, WITH_FORK and WITH_PTHREAD options are mutually exclusive - please specify at most one of them, the default is WITH_PTHREAD'
. e n d i f
. i f d e f i n e d ( W I T H _ U C O N T E X T )
2005-07-13 08:41:58 +00:00
CONFIGURE_ARGS += --with-threads= ucontext
CONFIGURE_ENV = CPPFLAGS = " ${ CPPFLAGS } ${ PTHREAD_CFLAGS } " LDFLAGS = " ${ LDFLAGS } ${ PTHREAD_LIBS } "
2005-06-14 08:58:47 +00:00
. e l i f d e f i n e d ( W I T H _ F O R K )
2005-07-13 08:41:58 +00:00
CONFIGURE_ARGS += --with-threads= fork
2005-06-14 08:58:47 +00:00
. e l s e
2005-07-13 08:41:58 +00:00
CONFIGURE_ARGS += --with-threads= pthread
CONFIGURE_ENV = CPPFLAGS = " ${ CPPFLAGS } ${ PTHREAD_CFLAGS } " LDFLAGS = " ${ LDFLAGS } ${ PTHREAD_LIBS } "
2005-06-14 08:58:47 +00:00
. e n d i f
2002-09-20 09:29:11 +00:00
post-patch :
2005-11-01 00:18:03 +00:00
# place files under /var/tmp so that this can be run by an unprivileged
2002-09-20 09:29:11 +00:00
# user stunnel and group stunnel
2006-04-21 10:51:49 +00:00
@${ REINPLACE_CMD } -E -e ' s| \@ prefix\@ /var/lib/stunnel/| /var/tmp/stunnel| ; \
2002-09-20 09:29:11 +00:00
s| nobody| stunnel| ; s| nogroup| stunnel| ' \
${ WRKSRC } /tools/stunnel.conf-sample.in
2006-04-21 10:51:49 +00:00
${ REINPLACE_CMD } -E -e 's|\$$\(prefix\)/var/run/stunnel/stunnel.pid|$$(localstatedir)/stunnel.pid|' \
${ WRKSRC } /src/Makefile.in
2002-09-20 19:55:07 +00:00
@${ FIND } ${ WRKSRC } -type f -name Makefile.in | ${ XARGS } ${ REINPLACE_CMD } -E -e 's,@(ACLOCAL|AUTO(MAKE|CONF|HEADER))@,/usr/bin/true,'
2002-09-20 09:29:11 +00:00
. i f d e f ( N O P O R T D O C S )
@${ REINPLACE_CMD } -E -e 's/ install-docDATA/ /; s/^(SUBDIRS.+)doc/\1/' \
${ WRKSRC } /Makefile.in
2006-11-15 11:32:51 +00:00
@${ REINPLACE_CMD } -E -e 's/([^n])install-examplesDATA/\1/' \
${ WRKSRC } /tools/Makefile.in
2002-09-20 09:29:11 +00:00
. e n d i f
2000-07-07 19:27:28 +00:00
post-install :
2002-09-20 09:29:11 +00:00
@${ SETENV } PKG_PREFIX = ${ PREFIX } ${ SH } \
${ PKGINSTALL } ${ PKGNAME } POST-INSTALL
1999-06-06 16:55:02 +00:00
@${ ECHO } ""
2000-07-07 19:27:28 +00:00
@${ ECHO } "**************************************************************************"
@${ ECHO } "To create and install a new certificate, type \"make cert\""
1999-06-06 16:55:02 +00:00
@${ ECHO } ""
2000-07-07 19:27:28 +00:00
@${ ECHO } "And don't forget to check out the FAQ at http://www.stunnel.org/"
@${ ECHO } "**************************************************************************"
1999-06-06 16:55:02 +00:00
@${ ECHO } ""
2004-12-30 15:37:50 +00:00
@${ ECHO } "*********************** WARNING! WARNING! WARNING! ***********************"
@${ ECHO } "The stunnel startup script has been converted to rc_subr"
@${ ECHO } "format now. You have to set at least the stunnel_enable"
@${ ECHO } "variable, and maybe also stunnel_config and stunnel_pidfile,"
@${ ECHO } "if you want stunnel to be started automatically at boot time!"
@${ ECHO } "**************************************************************************"
@${ ECHO } ""
1999-06-06 16:55:02 +00:00
2000-07-07 19:27:28 +00:00
cert :
1999-06-06 16:55:02 +00:00
@${ ECHO } ""
@${ ECHO } "**************************************************************************"
2008-01-24 00:36:42 +00:00
@${ ECHO } " The new certificate will be saved into ${ ETCDIR } /stunnel.pem "
1999-06-06 16:55:02 +00:00
@${ ECHO } "**************************************************************************"
@${ ECHO } ""
2006-01-31 09:11:38 +00:00
@( cd ${ WRKSRC } /tools/; make install-data-local)
1999-06-06 16:55:02 +00:00
Fix the bus error on startup in -CURRENT and 5.x-BETA. It turns out
that the OpenSSL ENGINE code is, well, somewhat less than stellar,
especially in combo with malloc's 'j' option. Even without it, though,
there are some problems that I don't have time to look into right now.
So, disable the OpenSSL ENGINE activation on FreeBSD 5.x, unless
the WITH_STUNNEL_SSL_ENGINE knob is turned on. Also, while I'm here,
fix the CONFIGURE_TARGET so the GNU configure script does not complain
quite so loudly. Bump PORTREVISION for the functionality change
(well, I guess you could say "not working" -> "working" is a functionality
change ;)
2004-09-02 15:46:15 +00:00
. i f ! d e f i n e d ( W I T H _ S T U N N E L _ S S L _ E N G I N E )
EXTRA_PATCHES = ${ FILESDIR } /ssl-noengine.patch
pre-patch :
@${ ECHO } "*************************************************************************"
@${ ECHO } "Note: you have to explicitly define WITH_STUNNEL_SSL_ENGINE to activate"
2004-12-27 14:33:19 +00:00
@${ ECHO } "the OpenSSL ENGINE code on FreeBSD 5.x or 6.x."
Fix the bus error on startup in -CURRENT and 5.x-BETA. It turns out
that the OpenSSL ENGINE code is, well, somewhat less than stellar,
especially in combo with malloc's 'j' option. Even without it, though,
there are some problems that I don't have time to look into right now.
So, disable the OpenSSL ENGINE activation on FreeBSD 5.x, unless
the WITH_STUNNEL_SSL_ENGINE knob is turned on. Also, while I'm here,
fix the CONFIGURE_TARGET so the GNU configure script does not complain
quite so loudly. Bump PORTREVISION for the functionality change
(well, I guess you could say "not working" -> "working" is a functionality
change ;)
2004-09-02 15:46:15 +00:00
@${ ECHO } "There are known reliability issues with stunnel and the OpenSSL ENGINE"
@${ ECHO } "code, so you are advised not to enable it."
@${ ECHO } "*************************************************************************"
. e l s e
pre-patch :
@${ ECHO } "*************************************************************************"
@${ ECHO } "Note: you have defined WITH_STUNNEL_SSL_ENGINE. Now stunnel will activate"
@${ ECHO } "the OpenSSL ENGINE code even on FreeBSD 5.x."
@${ ECHO } "There are known reliability issues with stunnel and the OpenSSL ENGINE"
@${ ECHO } "code. You have enabled it at your own risk."
@${ ECHO } "*************************************************************************"
. e n d i f
2004-06-11 16:37:56 +00:00
. i n c l u d e < b s d . p o r t . p o s t . m k >