1999-01-18 05:27:03 +01: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 03:53:22 +02:00
# $FreeBSD$
1999-01-18 05:27:03 +01:00
#
2000-04-09 20:34:06 +02:00
PORTNAME = stunnel
2005-11-03 12:51:10 +01:00
PORTVERSION = 4.14
2006-02-23 11:40:44 +01:00
PORTREVISION = 2
1999-01-18 05:27:03 +01:00
CATEGORIES = security
2001-08-02 21:04:01 +02:00
MASTER_SITES = http://www.stunnel.org/download/stunnel/src/ \
2005-11-01 01:18:03 +01:00
ftp://stunnel.mirt.net/stunnel/ \
2004-06-03 12:48:32 +02:00
ftp://stunnel.mirt.net/stunnel/OBSOLETE/ \
ftp://opensores.thebunker.net/pub/mirrors/stunnel/download/stunnel/src/
1999-01-18 05:27:03 +01:00
2002-09-20 11:29:11 +02:00
MAINTAINER = roam@FreeBSD.org
2004-06-03 13:38:01 +02:00
COMMENT = SSL encryption wrapper for standard network daemons
2003-03-23 11:35:14 +01:00
2000-09-22 03:59:06 +02:00
USE_OPENSSL = YES
2004-12-30 16:37:50 +01:00
USE_RC_SUBR = YES
1999-01-18 05:27:03 +01:00
2001-11-01 09:28:38 +01:00
GNU_CONFIGURE = yes
2005-04-12 05:26:56 +02:00
CONFIGURE_TARGET = --target= ${ MACHINE_ARCH } -portbld-freebsd${ OSREL }
2003-01-09 10:54:54 +01:00
CONFIGURE_ARGS = --localstatedir= /var/tmp --with-pem-dir= ${ PEM_DIR } \
--enable-static
2000-02-20 16:05:06 +01:00
2004-06-03 13:38:01 +02: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 05:27:03 +01:00
2001-11-07 12:01:38 +01:00
PEM_DIR ?= ${ PREFIX } /etc
2005-06-14 11:07:12 +02: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 \
IPV6 "enable IPv6 support" off
. i n c l u d e < b s d . p o r t . p r e . m k >
2004-12-27 15:33:19 +01:00
. i f d e f i n e d ( W I T H _ I P V 6 )
CONFIGURE_ARGS += --enable-ipv6
. e n d i f
2005-06-14 10:58:47 +02: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 10:41:58 +02:00
. i f $ { O S V E R S I O N } < 5 0 0 1 1 2
BROKEN = 'The ucontext model is only supported on FreeBSD 5.x and 6.x'
. e n d i f
CONFIGURE_ARGS += --with-threads= ucontext
CONFIGURE_ENV = CPPFLAGS = " ${ CPPFLAGS } ${ PTHREAD_CFLAGS } " LDFLAGS = " ${ LDFLAGS } ${ PTHREAD_LIBS } "
2005-06-14 10:58:47 +02:00
. e l i f d e f i n e d ( W I T H _ F O R K )
2005-07-13 10:41:58 +02:00
CONFIGURE_ARGS += --with-threads= fork
2005-06-14 10:58:47 +02:00
. e l s e
2005-07-13 10:41:58 +02:00
CONFIGURE_ARGS += --with-threads= pthread
CONFIGURE_ENV = CPPFLAGS = " ${ CPPFLAGS } ${ PTHREAD_CFLAGS } " LDFLAGS = " ${ LDFLAGS } ${ PTHREAD_LIBS } "
2005-06-14 10:58:47 +02:00
. e n d i f
2002-09-20 11:29:11 +02:00
post-patch :
2005-11-01 01:18:03 +01:00
# place files under /var/tmp so that this can be run by an unprivileged
2002-09-20 11:29:11 +02:00
# user stunnel and group stunnel
@${ REINPLACE_CMD } -E -e ' s| \@ prefix\@ /var/run/stunnel/| /var/tmp/stunnel| ; \
s| nobody| stunnel| ; s| nogroup| stunnel| ' \
${ WRKSRC } /tools/stunnel.conf-sample.in
@${ REINPLACE_CMD } -E -e 's|localstatedir/run/stunnel.pid|localstatedir/stunnel.pid|' \
${ WRKSRC } /configure.ac ${ WRKSRC } /configure
2002-09-20 21:55:07 +02: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 11:29:11 +02: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
. e n d i f
2000-07-07 21:27:28 +02:00
post-install :
2004-12-30 16:37:50 +01:00
${ SED } " s+!!PREFIX!!+ ${ PREFIX } +g; s+!!RC_SUBR!!+ ${ RC_SUBR } +g " \
< ${ FILESDIR } /stunnel.sh > ${ WRKDIR } /stunnel.sh
${ INSTALL_SCRIPT } ${ WRKDIR } /stunnel.sh ${ PREFIX } /etc/rc.d/
2002-09-20 11:29:11 +02:00
@${ SETENV } PKG_PREFIX = ${ PREFIX } ${ SH } \
${ PKGINSTALL } ${ PKGNAME } POST-INSTALL
1999-06-06 18:55:02 +02:00
@${ ECHO } ""
2000-07-07 21:27:28 +02:00
@${ ECHO } "**************************************************************************"
@${ ECHO } "To create and install a new certificate, type \"make cert\""
1999-06-06 18:55:02 +02:00
@${ ECHO } ""
2000-07-07 21:27:28 +02:00
@${ ECHO } "And don't forget to check out the FAQ at http://www.stunnel.org/"
@${ ECHO } "**************************************************************************"
1999-06-06 18:55:02 +02:00
@${ ECHO } ""
2004-12-30 16:37:50 +01: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 18:55:02 +02:00
2000-07-07 21:27:28 +02:00
cert :
1999-06-06 18:55:02 +02:00
@${ ECHO } ""
@${ ECHO } "**************************************************************************"
2006-01-31 10:11:38 +01:00
@${ ECHO } " The new certificate will be saved into ${ PREFIX } /etc/stunnel/stunnel.pem "
1999-06-06 18:55:02 +02:00
@${ ECHO } "**************************************************************************"
@${ ECHO } ""
2006-01-31 10:11:38 +01:00
@( cd ${ WRKSRC } /tools/; make install-data-local)
1999-06-06 18:55:02 +02:00
2004-06-11 18:37:56 +02:00
. i f $ { O S V E R S I O N } > 5 0 0 0 0 0
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 17:46:15 +02: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 15:33:19 +01: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 17:46:15 +02: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 18:37:56 +02:00
. e n d i f
. i n c l u d e < b s d . p o r t . p o s t . m k >