aboutsummaryrefslogtreecommitdiff
path: root/security/stunnel
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2002-09-20 09:29:11 +0000
committerPeter Pentchev <roam@FreeBSD.org>2002-09-20 09:29:11 +0000
commit88cba5e3822546fa74a37cf8b27dad39985ddf42 (patch)
tree25b220206192f9e8f235711830641af9770c53a2 /security/stunnel
parent0df64d11860f1765951c5511d11c9ad365d284c8 (diff)
downloadports-88cba5e3822546fa74a37cf8b27dad39985ddf42.tar.gz
ports-88cba5e3822546fa74a37cf8b27dad39985ddf42.zip
Notes
Diffstat (limited to 'security/stunnel')
-rw-r--r--security/stunnel/Makefile23
-rw-r--r--security/stunnel/distinfo2
-rw-r--r--security/stunnel/files/patch-Makefile.in20
-rw-r--r--security/stunnel/files/patch-aa6
-rw-r--r--security/stunnel/files/stunnel.in3
-rw-r--r--security/stunnel/files/stunnel.sh3
-rw-r--r--security/stunnel/pkg-deinstall63
-rw-r--r--security/stunnel/pkg-descr2
-rw-r--r--security/stunnel/pkg-install41
-rw-r--r--security/stunnel/pkg-plist30
10 files changed, 160 insertions, 33 deletions
diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile
index e8cc4f97721d..df0b8be5ecd7 100644
--- a/security/stunnel/Makefile
+++ b/security/stunnel/Makefile
@@ -6,28 +6,45 @@
#
PORTNAME= stunnel
-PORTVERSION= 3.22
+PORTVERSION= 4.00
CATEGORIES= security
MASTER_SITES= http://www.stunnel.org/download/stunnel/src/ \
ftp://stunnel.mirt.net/stunnel/ \
ftp://opensores.thebunker.net/pub/mirrors/stunnel/ \
ftp://ftp.cryptoarchive.net/pub/cryptoarchive/mirrors/opensores.thebunker.net/pub/mirrors/stunnel/
-MAINTAINER= roam@freebsd.org
+MAINTAINER= roam@FreeBSD.org
USE_OPENSSL= YES
+USE_REINPLACE= YES
+IS_INTERACTIVE= YES # prompts for information while generating certificate
GNU_CONFIGURE= yes
-CONFIGURE_ARGS= --localstatedir=/var/run --with-pem-dir=${PEM_DIR}
+CONFIGURE_ARGS= --localstatedir=/var/tmp --with-pem-dir=${PEM_DIR}
MAN8= stunnel.8
PEM_DIR?= ${PREFIX}/etc
+post-patch:
+# place files under /var/tmp so that this can be run by an unprivileged user
+# 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
+.ifdef(NOPORTDOCS)
+ @${REINPLACE_CMD} -E -e 's/ install-docDATA/ /; s/^(SUBDIRS.+)doc/\1/' \
+ ${WRKSRC}/Makefile.in
+.endif
+
post-install:
@${SED} "s+!!PREFIX!!+${PREFIX}+g" < ${FILESDIR}/stunnel.sh \
> ${PREFIX}/etc/rc.d/stunnel.sh.sample
@${CHMOD} 755 ${PREFIX}/etc/rc.d/stunnel.sh.sample
+ @${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
+ ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${ECHO} ""
@${ECHO} "**************************************************************************"
@${ECHO} "To create and install a new certificate, type \"make cert\""
diff --git a/security/stunnel/distinfo b/security/stunnel/distinfo
index 95347933a99b..924de9f92802 100644
--- a/security/stunnel/distinfo
+++ b/security/stunnel/distinfo
@@ -1 +1 @@
-MD5 (stunnel-3.22.tar.gz) = 69000d8365b006b3c080a1e2dc9ccba9
+MD5 (stunnel-4.00.tar.gz) = 5da49496d516aa2716405a6defac0b0d
diff --git a/security/stunnel/files/patch-Makefile.in b/security/stunnel/files/patch-Makefile.in
deleted file mode 100644
index 117672685d0f..000000000000
--- a/security/stunnel/files/patch-Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
---- Makefile.in.orig Sun Dec 23 20:03:25 2001
-+++ Makefile.in Sun Sep 15 14:00:00 2002
-@@ -24,7 +24,7 @@
- LIBS=@LIBS@
- HEADERS=common.h prototypes.h client.h
- OBJS=client.o stunnel.o ssl.o protocol.o sthreads.o pty.o log.o options.o
--DESTFILES=$(sbindir)/stunnel $(libdir)/stunnel.so $(man8dir)/stunnel.8 $(PEM_DIR)/stunnel.pem
-+DESTFILES=$(sbindir)/stunnel $(libdir)/stunnel.so $(man8dir)/stunnel.8
-
- WINGCC=i386-mingw32msvc-gcc
- WINCFLAGS=-O2 -Wall -DUSE_WIN32=1 -DHAVE_OPENSSL=1 -DFD_SETSIZE=4096 -DVERSION=\"@VERSION@\" -I../openssl-0.9.6b/outinc
-@@ -33,7 +33,7 @@
-
- # standard external rules
-
--all: stunnel stunnel.8 stunnel.html stunnel.so stunnel.pem
-+all: stunnel stunnel.8 stunnel.html stunnel.so
-
- install: all installdirs $(DESTFILES)
-
diff --git a/security/stunnel/files/patch-aa b/security/stunnel/files/patch-aa
index 33f5ea0e6d88..4040d81f01a8 100644
--- a/security/stunnel/files/patch-aa
+++ b/security/stunnel/files/patch-aa
@@ -1,6 +1,6 @@
---- common.h.orig Wed Oct 31 00:07:31 2001
-+++ common.h Wed Oct 31 11:07:29 2001
-@@ -174,6 +174,7 @@
+--- src/common.h.orig Sat Aug 31 08:16:32 2002
++++ src/common.h Sat Aug 31 08:16:35 2002
+@@ -140,6 +140,7 @@
#define writesocket(s,b,n) write((s),(b),(n))
#define closesocket(s) close(s)
#define ioctlsocket(a,b,c) ioctl((a),(b),(c))
diff --git a/security/stunnel/files/stunnel.in b/security/stunnel/files/stunnel.in
index dc074e2771a1..8edeb0c175dc 100644
--- a/security/stunnel/files/stunnel.in
+++ b/security/stunnel/files/stunnel.in
@@ -10,8 +10,7 @@ STUNNEL="!!PREFIX!!/sbin/stunnel"
case "$1" in
start)
- ${STUNNEL} -d 993 -r localhost:imap -p !!PREFIX!!/etc/stunnel.pem
- ${STUNNEL} -d 995 -r localhost:pop3 -p !!PREFIX!!/etc/stunnel.pem
+ ${STUNNEL} !!PREFIX!!/etc/stunnel/stunnel.conf
;;
stop)
diff --git a/security/stunnel/files/stunnel.sh b/security/stunnel/files/stunnel.sh
index dc074e2771a1..8edeb0c175dc 100644
--- a/security/stunnel/files/stunnel.sh
+++ b/security/stunnel/files/stunnel.sh
@@ -10,8 +10,7 @@ STUNNEL="!!PREFIX!!/sbin/stunnel"
case "$1" in
start)
- ${STUNNEL} -d 993 -r localhost:imap -p !!PREFIX!!/etc/stunnel.pem
- ${STUNNEL} -d 995 -r localhost:pop3 -p !!PREFIX!!/etc/stunnel.pem
+ ${STUNNEL} !!PREFIX!!/etc/stunnel/stunnel.conf
;;
stop)
diff --git a/security/stunnel/pkg-deinstall b/security/stunnel/pkg-deinstall
new file mode 100644
index 000000000000..8d31c1c37859
--- /dev/null
+++ b/security/stunnel/pkg-deinstall
@@ -0,0 +1,63 @@
+#! /bin/sh
+#
+# $FreeBSD$
+# taken from net/cvsup-mirror
+
+PATH=/bin:/usr/sbin
+
+STUNNEL_USER=${STUNNEL_USER:-stunnel}
+STUNNEL_GROUP=${STUNNEL_GROUP:-stunnel}
+
+ask() {
+ local question default answer
+
+ question=$1
+ default=$2
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ read -p "${question} [${default}]? " answer
+ fi
+ if [ x${answer} = x ]; then
+ answer=${default}
+ fi
+ echo ${answer}
+}
+
+yesno() {
+ local dflt question answer
+
+ question=$1
+ dflt=$2
+ while :; do
+ answer=$(ask "${question}" "${dflt}")
+ case "${answer}" in
+ [Yy]*) return 0;;
+ [Nn]*) return 1;;
+ esac
+ echo "Please answer yes or no."
+ done
+}
+
+delete_account() {
+ local u g home
+
+ u=$1
+ g=$2
+ if yesno "Do you want me to remove group \"${g}\"" y; then
+ pw groupdel -n ${g}
+ echo "Done."
+ fi
+ if yesno "Do you want me to remove user \"${u}\"" y; then
+ eval home=~${u}
+ pw userdel -n ${u}
+ echo "Done."
+ if [ -d "${home}" ]; then
+ echo "Please remember to remove the home directory \"${home}\""
+ fi
+ fi
+}
+
+if [ x$2 != xDEINSTALL ]; then
+ exit
+fi
+
+delete_account ${STUNNEL_USER} ${STUNNEL_GROUP}
diff --git a/security/stunnel/pkg-descr b/security/stunnel/pkg-descr
index e4929f528c5a..f3b36e1d909a 100644
--- a/security/stunnel/pkg-descr
+++ b/security/stunnel/pkg-descr
@@ -8,4 +8,4 @@ stunnel can be used to add SSL functionality to commonly
used inetd daemons like POP-2, POP-3 and IMAP servers
without any changes in the programs' code.
-WWW: http://www.stunnel.org/
+WWW: http://stunnel.mirt.net/
diff --git a/security/stunnel/pkg-install b/security/stunnel/pkg-install
new file mode 100644
index 000000000000..2753471a8467
--- /dev/null
+++ b/security/stunnel/pkg-install
@@ -0,0 +1,41 @@
+#! /bin/sh
+#
+# $FreeBSD$
+# taken from devel/perforce
+
+PATH=/bin:/usr/sbin
+
+STUNNEL_USER=${STUNNEL_USER:-stunnel}
+STUNNEL_GROUP=${STUNNEL_GROUP:-stunnel}
+
+case $2 in
+POST-INSTALL)
+ USER=${STUNNEL_USER}
+ GROUP=${STUNNEL_GROUP}
+
+ if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if pw groupadd ${GROUP} ; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if pw useradd ${USER} -g ${GROUP} -h - \
+ -d /nonexistent -c "stunnel Daemon" -s /sbin/nologin
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+
+ ;;
+esac
diff --git a/security/stunnel/pkg-plist b/security/stunnel/pkg-plist
index 914268b3a843..639c6f48c473 100644
--- a/security/stunnel/pkg-plist
+++ b/security/stunnel/pkg-plist
@@ -1,3 +1,31 @@
etc/rc.d/stunnel.sh.sample
-lib/stunnel.so
+etc/stunnel/stunnel.conf-sample
+etc/stunnel/stunnel.pem
+lib/libstunnel.so.0
+lib/libstunnel.so
+lib/libstunnel.la
+lib/libstunnel.a
sbin/stunnel
+%%PORTDOCS%%share/doc/stunnel/stunnel.html
+%%PORTDOCS%%share/doc/stunnel/examples/ca.html
+%%PORTDOCS%%share/doc/stunnel/examples/ca.pl
+%%PORTDOCS%%share/doc/stunnel/examples/importCA.html
+%%PORTDOCS%%share/doc/stunnel/examples/importCA.sh
+%%PORTDOCS%%share/doc/stunnel/examples/stunnel.spec
+%%PORTDOCS%%share/doc/stunnel/examples/stunnel.init
+%%PORTDOCS%%share/doc/stunnel/AUTHORS
+%%PORTDOCS%%share/doc/stunnel/BUGS
+%%PORTDOCS%%share/doc/stunnel/ChangeLog
+%%PORTDOCS%%share/doc/stunnel/COPYING
+%%PORTDOCS%%share/doc/stunnel/COPYRIGHT.GPL
+%%PORTDOCS%%share/doc/stunnel/CREDITS
+%%PORTDOCS%%share/doc/stunnel/FAQ
+%%PORTDOCS%%share/doc/stunnel/INSTALL
+%%PORTDOCS%%share/doc/stunnel/INSTALL.W32
+%%PORTDOCS%%share/doc/stunnel/NEWS
+%%PORTDOCS%%share/doc/stunnel/PORTS
+%%PORTDOCS%%share/doc/stunnel/README
+%%PORTDOCS%%share/doc/stunnel/TODO
+%%PORTDOCS%%@dirrm share/doc/stunnel/examples
+%%PORTDOCS%%@dirrm share/doc/stunnel
+@unexec rmdir %D/etc/stunnel 2>/dev/null || echo "If you are permanently removing this port, you should do a ``rm -rf ${PKG_PREFIX}/etc/stunnel`` to remove any configuration files left." | fmt