* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/, net-misc/stunnel/files/
@ 2016-07-06 11:18 Anthony G. Basile
0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2016-07-06 11:18 UTC (permalink / raw
To: gentoo-commits
commit: 75e8a84bc6a37d5dc5752e3eac0ca667566d165a
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 6 11:20:44 2016 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Jul 6 11:20:44 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75e8a84b
net-misc/stunnel: reload configuration using HUP, bug #588054
Package-Manager: portage-2.2.28
net-misc/stunnel/files/stunnel-r1 | 51 ++++++++++++++++++
net-misc/stunnel/stunnel-5.34-r1.ebuild | 93 +++++++++++++++++++++++++++++++++
2 files changed, 144 insertions(+)
diff --git a/net-misc/stunnel/files/stunnel-r1 b/net-misc/stunnel/files/stunnel-r1
new file mode 100644
index 0000000..e7eee32
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-r1
@@ -0,0 +1,51 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload"
+SERVICENAME=${SVCNAME#*.}
+SERVICENAME=${SERVICENAME:-stunnel}
+STUNNEL_CONFIGFILE=${STUNNEL_CONFIGFILE:-/etc/stunnel/${SERVICENAME}.conf}
+
+depend() {
+ need net
+ before logger
+}
+
+get_config() {
+ if [ ! -e ${STUNNEL_CONFIGFILE} ] ; then
+ eerror "You need to create ${STUNNEL_CONFIGFILE} first."
+ return 1
+ fi
+ CHROOT=$(grep "^chroot" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
+ [ -n "${CHROOT}" ] && CHROOT="--chroot ${CHROOT}"
+ PIDFILE=$(grep "^pid" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
+ PIDFILE=${PIDFILE:-/run/stunnel/${SERVICENAME}.pid}
+}
+
+start() {
+ get_config || return 1
+ checkpath -d -m 0775 -o root:stunnel /run/stunnel
+ if [ "$(dirname ${PIDFILE})" != "/run" ]; then
+ checkpath -d -m 0755 -o stunnel:stunnel -q $(dirname ${PIDFILE})
+ fi
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --pidfile "${PIDFILE}" ${CHROOT} \
+ --exec /usr/bin/stunnel -- ${STUNNEL_CONFIGFILE} ${STUNNEL_OPTIONS}
+ eend $? "Failed to start ${SVCNAME}"
+}
+
+stop() {
+ get_config || return 1
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ eend $? "Failed to stop ${SVCNAME}"
+}
+
+reload() {
+ get_config || return 1
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile ${PIDFILE} --name stunnel
+ eend $?
+}
diff --git a/net-misc/stunnel/stunnel-5.34-r1.ebuild b/net-misc/stunnel/stunnel-5.34-r1.ebuild
new file mode 100644
index 0000000..53ee300
--- /dev/null
+++ b/net-misc/stunnel/stunnel-5.34-r1.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit ssl-cert eutils multilib systemd user
+
+DESCRIPTION="TLS/SSL - Port Wrapper"
+HOMEPAGE="http://www.stunnel.org/index.html"
+SRC_URI="ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.usenix.org.uk/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://ftp.nluug.nl/pub/networking/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.namesdir.com/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://stunnel.cybermirror.org/archive/${PV%%.*}.x/${P}.tar.gz
+ http://mirrors.zerg.biz/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ ftp://mirrors.go-parts.com/stunnel/archive/${PV%%.*}.x/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="ipv6 libressl selinux stunnel3 tcpd"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+ !libressl? ( dev-libs/openssl:0 )
+ libressl? ( dev-libs/libressl )"
+RDEPEND="${DEPEND}
+ stunnel3? ( dev-lang/perl )
+ selinux? ( sec-policy/selinux-stunnel )"
+
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup stunnel
+ enewuser stunnel -1 -1 -1 stunnel
+}
+
+src_prepare() {
+ # Hack away generation of certificate
+ sed -i -e "s/^install-data-local:/do-not-run-this:/" \
+ tools/Makefile.in || die "sed failed"
+
+ # libressl compat
+ epatch "${FILESDIR}"/stunnel-compat-libressl.patch
+
+ echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
+}
+
+src_configure() {
+ econf \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ $(use_enable ipv6) \
+ $(use_enable tcpd libwrap) \
+ --with-ssl="${EPREFIX}"/usr \
+ --disable-fips
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ rm -rf "${ED}"/usr/share/doc/${PN}
+ rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
+ "${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8
+ use stunnel3 || rm -f "${ED}"/usr/bin/stunnel3
+
+ # The binary was moved to /usr/bin with 4.21,
+ # symlink for backwards compatibility
+ dosym ../bin/stunnel /usr/sbin/stunnel
+
+ dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog
+ dohtml doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
+ tools/importCA.html
+
+ insinto /etc/stunnel
+ doins "${FILESDIR}"/stunnel.conf
+ newinitd "${FILESDIR}"/stunnel-r1 stunnel
+
+ doenvd "${T}"/20stunnel
+
+ systemd_dounit "${S}/tools/stunnel.service"
+ systemd_newtmpfilesd "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf
+}
+
+pkg_postinst() {
+ if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then
+ install_cert /etc/stunnel/stunnel
+ chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ fi
+
+ einfo "If you want to run multiple instances of stunnel, create a new config"
+ einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
+ einfo "\'pid= \' with a unique filename."
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/, net-misc/stunnel/files/
@ 2017-11-06 13:54 Anthony G. Basile
0 siblings, 0 replies; 5+ messages in thread
From: Anthony G. Basile @ 2017-11-06 13:54 UTC (permalink / raw
To: gentoo-commits
commit: 0d0139d9442980ff8b1bb9c1db112162fb108496
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 6 13:53:52 2017 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Nov 6 13:54:08 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d0139d9
net-misc/stunnel: version bump to 5.43
Package-Manager: Portage-2.3.8, Repoman-2.3.3
net-misc/stunnel/Manifest | 1 +
.../files/stunnel-5.43-compat-libressl.patch | 126 +++++++++++++++++++++
net-misc/stunnel/stunnel-5.43.ebuild | 95 ++++++++++++++++
3 files changed, 222 insertions(+)
diff --git a/net-misc/stunnel/Manifest b/net-misc/stunnel/Manifest
index f0c646af453..eee88aeff94 100644
--- a/net-misc/stunnel/Manifest
+++ b/net-misc/stunnel/Manifest
@@ -3,3 +3,4 @@ DIST stunnel-5.37.tar.gz 645336 SHA256 d0e3530e3effc64fdec792c71791d4937c6b8bd3b
DIST stunnel-5.38.tar.gz 647774 SHA256 09ada29ba1683ab1fd1f31d7bed8305127a0876537e836a40cb83851da034fd5 SHA512 29adae28955639ab7732ff0d7ea3c097211babcd0c8932717c582f5e38279811a0a209f1daa2c6a22cf69ef28b8b67439038625ba58683c268c322b19e43ac58 WHIRLPOOL ae549e6d498a0bf31591b32f56c4d97141e00485d66aa50be23c5022e9c73f5d51c91d685bf135bf12a365a9b56d53c2dded042ecd8810cbe19e74ca7f89cc5b
DIST stunnel-5.39.tar.gz 647101 SHA256 288c087a50465390d05508068ac76c8418a21fae7275febcc63f041ec5b04dee SHA512 1a59ca3bedd00730598e5bdee61d1968e76d3b1c0bb666fcab5103f5ba6fac0585612198baab180ac0745f658041510fe0115ec8b111da6fd7c161a4ec301458 WHIRLPOOL b4cb9c164b65a6091cde9867cc2386083b5d7224d98f19a84021408b0827eb117a9fa1ef3c3d8e9c85d28d8988dbddaf37ed03235d115d9e284d0ef24ddbe5fa
DIST stunnel-5.40.tar.gz 648828 SHA256 23acdb390326ffd507d90f8984ecc90e0d9993f6bd6eac1d0a642456565c45ff SHA512 2dd403f212f701370775516d25ea441fe41564daf1460f8a9ba4eb960adfb5f007ebfb51a90503fa168c420f06e17a6d20f1b0eab697e2abb6a42dc6f1f898b2 WHIRLPOOL 5f9fa99d8e6e153abd15896bd704f42324a8f376633e65685fc7b3d80f06b52048eba923c16a8fbb57e09624a65f0f957fc169e1b9f89d683b67c1cee1ba71b0
+DIST stunnel-5.43.tar.gz 698715 SHA256 05915babf705a0494886a72a7367913d403d07fc908ebb7b380d639e2d8bcee2 SHA512 3158ab7573d8c548ee71aecb3f94e141bd80e123a62848945263004e28668050a8a08c904dbf61df28c4f5c1d94eb380943ab39835ccd18273a6acf05a3488a8 WHIRLPOOL 3da1656e5937dd1155431fcffd59d523de05a9957a46c8c44edae9493e153919972b1c03b292d6833b4e5ab6a1d8f6b40987f5baa9be9600397430462566b0da
diff --git a/net-misc/stunnel/files/stunnel-5.43-compat-libressl.patch b/net-misc/stunnel/files/stunnel-5.43-compat-libressl.patch
new file mode 100644
index 00000000000..5b015a98b61
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.43-compat-libressl.patch
@@ -0,0 +1,126 @@
+diff -Naur stunnel-5.43.orig/src/common.h stunnel-5.43/src/common.h
+--- stunnel-5.43.orig/src/common.h 2017-01-02 14:27:26.000000000 +0000
++++ stunnel-5.43/src/common.h 2017-11-06 13:42:39.940942240 +0000
+@@ -448,7 +448,7 @@
+ #define OPENSSL_NO_TLS1_2
+ #endif /* OpenSSL older than 1.0.1 || defined(OPENSSL_NO_TLS1) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ #ifndef OPENSSL_NO_SSL2
+ #define OPENSSL_NO_SSL2
+ #endif /* !defined(OPENSSL_NO_SSL2) */
+@@ -474,7 +474,7 @@
+ #include <openssl/des.h>
+ #ifndef OPENSSL_NO_DH
+ #include <openssl/dh.h>
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g);
+ #endif /* OpenSSL older than 1.1.0 */
+ #endif /* !defined(OPENSSL_NO_DH) */
+diff -Naur stunnel-5.43.orig/src/ctx.c stunnel-5.43/src/ctx.c
+--- stunnel-5.43.orig/src/ctx.c 2017-08-17 09:18:53.000000000 +0000
++++ stunnel-5.43/src/ctx.c 2017-11-06 13:47:55.571861529 +0000
+@@ -295,7 +295,7 @@
+
+ #ifndef OPENSSL_NO_DH
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) {
+ return ctx->cipher_list;
+ }
+@@ -398,7 +398,7 @@
+ /**************************************** initialize OpenSSL CONF */
+
+ NOEXPORT int conf_init(SERVICE_OPTIONS *section) {
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *cctx;
+ NAME_LIST *curr;
+ char *cmd, *param;
+diff -Naur stunnel-5.43.orig/src/options.c stunnel-5.43/src/options.c
+--- stunnel-5.43.orig/src/options.c 2017-10-16 18:38:47.000000000 +0000
++++ stunnel-5.43/src/options.c 2017-11-06 13:46:18.630650320 +0000
+@@ -3656,7 +3656,7 @@
+ }
+ #endif
+ /* engines can add new algorithms */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS|
+ OPENSSL_INIT_ADD_ALL_DIGESTS, NULL);
+ #else
+diff -Naur stunnel-5.43.orig/src/ssl.c stunnel-5.43/src/ssl.c
+--- stunnel-5.43.orig/src/ssl.c 2017-10-07 14:23:08.000000000 +0000
++++ stunnel-5.43/src/ssl.c 2017-11-06 13:42:39.940942240 +0000
+@@ -51,7 +51,7 @@
+ int index_session_authenticated, index_session_connect_address;
+
+ int ssl_init(void) { /* init TLS before parsing configuration file */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS |
+ OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_LOAD_CONFIG, NULL);
+ #else
+@@ -87,7 +87,7 @@
+ }
+
+ #ifndef OPENSSL_NO_DH
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ /* this is needed for dhparam.c generated with OpenSSL >= 1.1.0
+ * to be linked against the older versions */
+ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
+diff -Naur stunnel-5.43.orig/src/sthreads.c stunnel-5.43/src/sthreads.c
+--- stunnel-5.43.orig/src/sthreads.c 2017-08-17 09:18:53.000000000 +0000
++++ stunnel-5.43/src/sthreads.c 2017-11-06 13:42:39.940942240 +0000
+@@ -216,7 +216,7 @@
+
+ struct CRYPTO_dynlock_value stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+ #define CRYPTO_THREAD_lock_new() CRYPTO_get_new_dynlockid()
+ #endif
+
+diff -Naur stunnel-5.43.orig/src/verify.c stunnel-5.43/src/verify.c
+--- stunnel-5.43.orig/src/verify.c 2017-05-13 09:01:07.000000000 +0000
++++ stunnel-5.43/src/verify.c 2017-11-06 13:46:56.317566128 +0000
+@@ -51,7 +51,7 @@
+ NOEXPORT int verify_callback(int, X509_STORE_CTX *);
+ NOEXPORT int verify_checks(CLI *, int, X509_STORE_CTX *);
+ NOEXPORT int cert_check(CLI *, X509_STORE_CTX *, int);
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *, X509_STORE_CTX *);
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+ NOEXPORT int cert_check_local(X509_STORE_CTX *);
+@@ -285,7 +285,7 @@
+ }
+
+ if(depth==0) { /* additional peer certificate checks */
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(!cert_check_subject(c, callback_ctx))
+ return 0; /* reject */
+ #endif /* OPENSSL_VERSION_NUMBER>=0x10002000L */
+@@ -296,7 +296,7 @@
+ return 1; /* accept */
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cert_check_subject(CLI *c, X509_STORE_CTX *callback_ctx) {
+ X509 *cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ NAME_LIST *ptr;
+@@ -353,7 +353,7 @@
+ cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ subject=X509_get_subject_name(cert);
+
+-#if OPENSSL_VERSION_NUMBER<0x10100006L
++#if OPENSSL_VERSION_NUMBER<0x10100006L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs
+ #endif
+ /* modern API allows retrieving multiple matching certificates */
diff --git a/net-misc/stunnel/stunnel-5.43.ebuild b/net-misc/stunnel/stunnel-5.43.ebuild
new file mode 100644
index 00000000000..cb4aa444784
--- /dev/null
+++ b/net-misc/stunnel/stunnel-5.43.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit ssl-cert multilib systemd user
+
+DESCRIPTION="TLS/SSL - Port Wrapper"
+HOMEPAGE="http://www.stunnel.org/index.html"
+SRC_URI="ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.usenix.org.uk/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://ftp.nluug.nl/pub/networking/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.namesdir.com/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://stunnel.cybermirror.org/archive/${PV%%.*}.x/${P}.tar.gz
+ http://mirrors.zerg.biz/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ ftp://mirrors.go-parts.com/stunnel/archive/${PV%%.*}.x/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="ipv6 libressl selinux stunnel3 tcpd"
+
+DEPEND="tcpd? ( sys-apps/tcp-wrappers )
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )"
+RDEPEND="${DEPEND}
+ stunnel3? ( dev-lang/perl )
+ selinux? ( sec-policy/selinux-stunnel )"
+
+RESTRICT="test"
+
+pkg_setup() {
+ enewgroup stunnel
+ enewuser stunnel -1 -1 -1 stunnel
+}
+
+src_prepare() {
+ # Hack away generation of certificate
+ sed -i -e "s/^install-data-local:/do-not-run-this:/" \
+ tools/Makefile.in || die "sed failed"
+
+ # libressl compat
+ eapply "${FILESDIR}"/${PN}-5.43-compat-libressl.patch
+
+ echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
+
+ eapply_user
+}
+
+src_configure() {
+ econf \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ $(use_enable ipv6) \
+ $(use_enable tcpd libwrap) \
+ --with-ssl="${EPREFIX}"/usr \
+ --disable-fips
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ rm -rf "${ED}"/usr/share/doc/${PN}
+ rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
+ "${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8
+ use stunnel3 || rm -f "${ED}"/usr/bin/stunnel3
+
+ # The binary was moved to /usr/bin with 4.21,
+ # symlink for backwards compatibility
+ dosym ../bin/stunnel /usr/sbin/stunnel
+
+ dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog
+ docinto html
+ dodoc doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
+ tools/importCA.html
+
+ insinto /etc/stunnel
+ doins "${FILESDIR}"/stunnel.conf
+ newinitd "${FILESDIR}"/stunnel-r1 stunnel
+
+ doenvd "${T}"/20stunnel
+
+ systemd_dounit "${S}/tools/stunnel.service"
+ systemd_newtmpfilesd "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf
+}
+
+pkg_postinst() {
+ if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then
+ install_cert /etc/stunnel/stunnel
+ chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ fi
+
+ einfo "If you want to run multiple instances of stunnel, create a new config"
+ einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
+ einfo "\'pid= \' with a unique filename."
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/, net-misc/stunnel/files/
@ 2019-02-26 22:28 Aaron Bauman
0 siblings, 0 replies; 5+ messages in thread
From: Aaron Bauman @ 2019-02-26 22:28 UTC (permalink / raw
To: gentoo-commits
commit: 992eb4bfc2d96201fbc5587b5f29c9d81b278eb5
Author: Stefan Strogin <stefan.strogin <AT> gmail <DOT> com>
AuthorDate: Tue Feb 26 20:12:10 2019 +0000
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Tue Feb 26 22:28:20 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=992eb4bf
net-misc/stunnel: update patch for LibreSSL support
Probably won't work with <dev-libs/libressl-2.7.0 (if it ever worked).
Closes: https://bugs.gentoo.org/656420
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Stefan Strogin <stefan.strogin <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/11164
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
net-misc/stunnel/files/stunnel-5.50-libressl.patch | 228 +++++++++++++++++++++
...{stunnel-5.50.ebuild => stunnel-5.50-r1.ebuild} | 6 +-
2 files changed, 231 insertions(+), 3 deletions(-)
diff --git a/net-misc/stunnel/files/stunnel-5.50-libressl.patch b/net-misc/stunnel/files/stunnel-5.50-libressl.patch
new file mode 100644
index 00000000000..4481220c268
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-5.50-libressl.patch
@@ -0,0 +1,228 @@
+diff --git a/src/ctx.c b/src/ctx.c
+index cd59f4e..b41be1b 100644
+--- a/src/ctx.c
++++ b/src/ctx.c
+@@ -118,7 +118,7 @@ NOEXPORT void sslerror_log(unsigned long, char *);
+
+ /**************************************** initialize section->ctx */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ typedef long unsigned SSL_OPTIONS_TYPE;
+ #else
+ typedef long SSL_OPTIONS_TYPE;
+@@ -126,7 +126,7 @@ typedef long SSL_OPTIONS_TYPE;
+
+ int context_init(SERVICE_OPTIONS *section) { /* init TLS context */
+ /* create TLS context */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ if(section->option.client)
+ section->ctx=SSL_CTX_new(TLS_client_method());
+ else /* server mode */
+@@ -437,7 +437,7 @@ NOEXPORT int ecdh_init(SERVICE_OPTIONS *section) {
+ /**************************************** initialize OpenSSL CONF */
+
+ NOEXPORT int conf_init(SERVICE_OPTIONS *section) {
+-#if OPENSSL_VERSION_NUMBER>=0x10002000L
++#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *cctx;
+ NAME_LIST *curr;
+ char *cmd, *param;
+@@ -1247,7 +1247,7 @@ NOEXPORT void info_callback(const SSL *ssl, int where, int ret) {
+
+ c=SSL_get_ex_data((SSL *)ssl, index_ssl_cli);
+ if(c) {
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ OSSL_HANDSHAKE_STATE state=SSL_get_state(ssl);
+ #else
+ int state=SSL_get_state((SSL *)ssl);
+diff --git a/src/options.c b/src/options.c
+index 103ea6c..756e48c 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -75,7 +75,7 @@ NOEXPORT char *sni_init(SERVICE_OPTIONS *);
+ NOEXPORT void sni_free(SERVICE_OPTIONS *);
+ #endif /* !defined(OPENSSL_NO_TLSEXT) */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int str_to_proto_version(const char *);
+ #else /* OPENSSL_VERSION_NUMBER<0x10100000L */
+ NOEXPORT char *tls_methods_set(SERVICE_OPTIONS *, const char *);
+@@ -3048,7 +3048,7 @@ NOEXPORT char *parse_service_option(CMD cmd, SERVICE_OPTIONS **section_ptr,
+ break;
+ }
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ /* sslVersion */
+ switch(cmd) {
+@@ -3621,7 +3621,7 @@ NOEXPORT void sni_free(SERVICE_OPTIONS *section) {
+
+ /**************************************** modern TLS version handling */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT int str_to_proto_version(const char *name) {
+ if(!strcasecmp(name, "all"))
+diff --git a/src/prototypes.h b/src/prototypes.h
+index aaf50fc..01343bf 100644
+--- a/src/prototypes.h
++++ b/src/prototypes.h
+@@ -223,7 +223,7 @@ typedef struct service_options_struct {
+ #if OPENSSL_VERSION_NUMBER>=0x009080dfL
+ long unsigned ssl_options_clear;
+ #endif /* OpenSSL 0.9.8m or later */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ int min_proto_version, max_proto_version;
+ #else /* OPENSSL_VERSION_NUMBER<0x10100000L */
+ SSL_METHOD *client_method, *server_method;
+@@ -663,7 +663,7 @@ int getnameinfo(const struct sockaddr *, socklen_t,
+ #define USE_OS_THREADS
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_OS_THREADS
+
+@@ -711,7 +711,7 @@ typedef enum {
+
+ extern CRYPTO_RWLOCK *stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+ /* Emulate the OpenSSL 1.1 locking API for older OpenSSL versions */
+ CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
+ int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *);
+diff --git a/src/ssl.c b/src/ssl.c
+index ad06cb5..0b45769 100644
+--- a/src/ssl.c
++++ b/src/ssl.c
+@@ -39,7 +39,7 @@
+ #include "prototypes.h"
+
+ /* global OpenSSL initialization: compression, engine, entropy */
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cb_dup_addr(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp);
+ #else
+@@ -114,7 +114,7 @@ int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) {
+ #endif
+ #endif
+
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT int cb_dup_addr(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
+ void *from_d, int idx, long argl, void *argp) {
+ #else
+@@ -177,7 +177,7 @@ int ssl_configure(GLOBAL_OPTIONS *global) { /* configure global TLS settings */
+
+ #ifndef OPENSSL_NO_COMP
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ NOEXPORT int COMP_get_type(const COMP_METHOD *meth) {
+ return meth->type;
+diff --git a/src/sthreads.c b/src/sthreads.c
+index 412a31a..e12a330 100644
+--- a/src/sthreads.c
++++ b/src/sthreads.c
+@@ -97,14 +97,16 @@ unsigned long stunnel_thread_id(void) {
+
+ #endif /* USE_WIN32 */
+
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100004L
++#if (OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100004L) || \
++ defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void threadid_func(CRYPTO_THREADID *tid) {
+ CRYPTO_THREADID_set_numeric(tid, stunnel_thread_id());
+ }
+ #endif
+
+ void thread_id_init(void) {
+-#if OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100000L
++#if (OPENSSL_VERSION_NUMBER>=0x10000000L && OPENSSL_VERSION_NUMBER<0x10100000L) || \
++ defined(LIBRESSL_VERSION_NUMBER)
+ CRYPTO_THREADID_set_callback(threadid_func);
+ #endif
+ #if OPENSSL_VERSION_NUMBER<0x10000000L || !defined(OPENSSL_NO_DEPRECATED)
+@@ -115,7 +117,7 @@ void thread_id_init(void) {
+ /**************************************** locking */
+
+ /* we only need to initialize locking with OpenSSL older than 1.1.0 */
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_PTHREAD
+
+@@ -224,7 +226,7 @@ NOEXPORT int s_atomic_add(int *val, int amount, CRYPTO_RWLOCK *lock) {
+
+ CRYPTO_RWLOCK *stunnel_locks[STUNNEL_LOCKS];
+
+-#if OPENSSL_VERSION_NUMBER<0x10100004L
++#if OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER)
+
+ #ifdef USE_OS_THREADS
+
+@@ -334,7 +336,8 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) {
+
+ void locking_init(void) {
+ size_t i;
+-#if defined(USE_OS_THREADS) && OPENSSL_VERSION_NUMBER<0x10100004L
++#if defined(USE_OS_THREADS) && \
++ (OPENSSL_VERSION_NUMBER<0x10100004L || defined(LIBRESSL_VERSION_NUMBER))
+ size_t num;
+
+ /* initialize the OpenSSL static locking */
+diff --git a/src/tls.c b/src/tls.c
+index 9616df3..b89c61e 100644
+--- a/src/tls.c
++++ b/src/tls.c
+@@ -41,7 +41,7 @@
+ volatile int tls_initialized=0;
+
+ NOEXPORT void tls_platform_init();
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void free_function(void *);
+ #endif
+
+@@ -52,7 +52,7 @@ void tls_init() {
+ tls_platform_init();
+ tls_initialized=1;
+ ui_tls=tls_alloc(NULL, NULL, "ui");
+-#if OPENSSL_VERSION_NUMBER>=0x10100000L
++#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+ CRYPTO_set_mem_functions(str_alloc_detached_debug,
+ str_realloc_detached_debug, str_free_debug);
+ #else
+@@ -184,7 +184,7 @@ TLS_DATA *tls_get() {
+
+ /**************************************** OpenSSL allocator hook */
+
+-#if OPENSSL_VERSION_NUMBER<0x10100000L
++#if OPENSSL_VERSION_NUMBER<0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ NOEXPORT void free_function(void *ptr) {
+ /* CRYPTO_set_mem_ex_functions() needs a function rather than a macro */
+ /* unfortunately, OpenSSL provides no file:line information here */
+diff --git a/src/verify.c b/src/verify.c
+index b4b5115..0457ce0 100644
+--- a/src/verify.c
++++ b/src/verify.c
+@@ -346,7 +346,7 @@ NOEXPORT int cert_check_local(X509_STORE_CTX *callback_ctx) {
+ cert=X509_STORE_CTX_get_current_cert(callback_ctx);
+ subject=X509_get_subject_name(cert);
+
+-#if OPENSSL_VERSION_NUMBER<0x10100006L
++#if OPENSSL_VERSION_NUMBER<0x10100006L || defined(LIBRESSL_VERSION_NUMBER)
+ #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs
+ #endif
+ /* modern API allows retrieving multiple matching certificates */
diff --git a/net-misc/stunnel/stunnel-5.50.ebuild b/net-misc/stunnel/stunnel-5.50-r1.ebuild
similarity index 96%
rename from net-misc/stunnel/stunnel-5.50.ebuild
rename to net-misc/stunnel/stunnel-5.50-r1.ebuild
index 428e58d9d2b..c2c51a0ff50 100644
--- a/net-misc/stunnel/stunnel-5.50.ebuild
+++ b/net-misc/stunnel/stunnel-5.50-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
@@ -39,8 +39,8 @@ src_prepare() {
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
tools/Makefile.in || die "sed failed"
- # libressl compat
- eapply "${FILESDIR}"/${PN}-5.48-compat-libressl.patch
+ # bug 656420
+ eapply "${FILESDIR}"/${P}-libressl.patch
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/, net-misc/stunnel/files/
@ 2020-08-09 19:16 Steve Arnold
0 siblings, 0 replies; 5+ messages in thread
From: Steve Arnold @ 2020-08-09 19:16 UTC (permalink / raw
To: gentoo-commits
commit: 4ad773667769976017f40ad88c556c50a7a42158
Author: Stephen Arnold <nerdboy <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 9 19:15:21 2020 +0000
Commit: Steve Arnold <nerdboy <AT> gentoo <DOT> org>
CommitDate: Sun Aug 9 19:15:21 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad77366
net-misc/stunnel: update r1 init script, add ~arm64 to 5.56-r1
* adds --exec to stop args and einfo for symlink
Closes: https://bugs.gentoo.org/736332
Package-Manager: Portage-2.3.67, Repoman-2.3.17
Signed-off-by: Steve Arnold <nerdboy <AT> gentoo.org>
net-misc/stunnel/files/stunnel-r1 | 5 +++--
net-misc/stunnel/stunnel-5.56-r1.ebuild | 6 ++++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/net-misc/stunnel/files/stunnel-r1 b/net-misc/stunnel/files/stunnel-r1
index a73527ed57e..11530eabe72 100644
--- a/net-misc/stunnel/files/stunnel-r1
+++ b/net-misc/stunnel/files/stunnel-r1
@@ -1,5 +1,5 @@
#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
extra_started_commands="reload"
@@ -38,7 +38,8 @@ start() {
stop() {
get_config || return 1
ebegin "Stopping ${SVCNAME}"
- start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
+ start-stop-daemon --stop --quiet --exec /usr/bin/stunnel \
+ --pidfile ${PIDFILE}
eend $? "Failed to stop ${SVCNAME}"
}
diff --git a/net-misc/stunnel/stunnel-5.56-r1.ebuild b/net-misc/stunnel/stunnel-5.56-r1.ebuild
index 10f5581fa01..a6540f0fb4a 100644
--- a/net-misc/stunnel/stunnel-5.56-r1.ebuild
+++ b/net-misc/stunnel/stunnel-5.56-r1.ebuild
@@ -17,7 +17,7 @@ SRC_URI="ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
IUSE="ipv6 selinux stunnel3 tcpd"
DEPEND="dev-libs/openssl:0=
@@ -85,5 +85,7 @@ pkg_postinst() {
einfo "If you want to run multiple instances of stunnel, create a new config"
einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
- einfo "\'pid= \' with a unique filename."
+ einfo "\'pid= \' with a unique filename. For openrc make a symlink from the"
+ einfo "stunnel init script to \'stunnel.name\' and use that to start|stop"
+ einfo "your custom instance"
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/, net-misc/stunnel/files/
@ 2021-03-14 20:33 Conrad Kostecki
0 siblings, 0 replies; 5+ messages in thread
From: Conrad Kostecki @ 2021-03-14 20:33 UTC (permalink / raw
To: gentoo-commits
commit: 021b0cccd5ea0f8b0cdb764ef696a71a5e430487
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 14 20:23:03 2021 +0000
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Mar 14 20:25:34 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=021b0ccc
net-misc/stunnel: bump to version 5.58
Also added from PR 14362 the handling of pid file ownership, to support
the specified user and group from stunnel.conf.
Closes: https://github.com/gentoo/gentoo/pull/14362
Package-Manager: Portage-3.0.16, Repoman-3.0.2
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
net-misc/stunnel/Manifest | 1 +
net-misc/stunnel/files/stunnel-r2 | 55 +++++++++++++++++++
net-misc/stunnel/stunnel-5.58.ebuild | 100 +++++++++++++++++++++++++++++++++++
3 files changed, 156 insertions(+)
diff --git a/net-misc/stunnel/Manifest b/net-misc/stunnel/Manifest
index 432660d827e..d27cdf861c3 100644
--- a/net-misc/stunnel/Manifest
+++ b/net-misc/stunnel/Manifest
@@ -1,3 +1,4 @@
DIST stunnel-5.50.tar.gz 973685 BLAKE2B e4185fa0c4f15ea118a8f6590bae14a9e1d7ccf1f73b75e46d8c7f04e4ece471c29b0a3715a24568301c5220fe385cbf42295c91ae9b295e3d7ab2b0ffec45a1 SHA512 96029b4f0dc0f04130e847bf47e56e8fdd22f2aaddb5fe0f581a0da6b870049152216795a0a9d9cdb6b93621df0a7d999e968a8c59989d261fd81c5f02cc1bac
DIST stunnel-5.55.tar.gz 986873 BLAKE2B feb3a7d80aa2f67e0b8de2cdd2a134947f0715cc09c2d2778cd2aef4dcc55ffef45c55e010bd6048f38b143d22006beb90c7b76575a8d6d3d430d1f87dd271fa SHA512 278e39e87e080171d2bed3b193f8f7923b48c12c6d788afeb113a71bfc6077129305e8f93f5e7046b12cc8aa381e89909358756c978ef129d3067ceeb60e112a
DIST stunnel-5.56.tar.gz 981163 BLAKE2B eef5a535165b1346d14e8fdd25ded7f497378bb63ab7d68642c5e1b3db2716c8e46db443146385a192a7e6042adcca295a5b107912e113f3f13f66e7a8d8b00b SHA512 db1be82b80bd5606568c5565f1c9a5710d4f7abca2d89388daa441bc395aaf2be998ac6403c7a17b8af01b89ade825186c20c50f73a809f9d64eca2e1b57a877
+DIST stunnel-5.58.tar.gz 988551 BLAKE2B 45ce3d43ff683fa1146ced00c6a2ef7c09a935da3dcd1a6529fa024e064c251798d96a1e45d4abf13195ca50fb7f1cf3ddc25c9e954a1cad8bb4745c4e35701d SHA512 6f62bf13bf53f174b2810ad6708a9dfdb70e9b4e2f60c0c9cf4df691169a63014901402ccbe2862010f4cee240c1a8eec34b70a7a3fcef36e7a2ca14a7f70ece
diff --git a/net-misc/stunnel/files/stunnel-r2 b/net-misc/stunnel/files/stunnel-r2
new file mode 100644
index 00000000000..abd42987d2b
--- /dev/null
+++ b/net-misc/stunnel/files/stunnel-r2
@@ -0,0 +1,55 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+SERVICENAME=${SVCNAME#*.}
+SERVICENAME=${SERVICENAME:-stunnel}
+STUNNEL_CONFIGFILE=${STUNNEL_CONFIGFILE:-/etc/stunnel/${SERVICENAME}.conf}
+
+depend() {
+ need net
+ before logger
+}
+
+get_config() {
+ if [ ! -e ${STUNNEL_CONFIGFILE} ] ; then
+ eerror "You need to create ${STUNNEL_CONFIGFILE} first."
+ return 1
+ fi
+ CHROOT=$(grep "^chroot" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
+ [ -n "${CHROOT}" ] && CHROOT="--chroot ${CHROOT}"
+ PIDFILE=$(grep "^pid" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
+ PIDFILE=${PIDFILE:-/run/stunnel/${SERVICENAME}.pid}
+ SETUID=$(grep "^setuid" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
+ SETUID=${SETUID:-stunnel}
+ SETGID=$(grep "^setgid" ${STUNNEL_CONFIGFILE} | sed "s;.*= *;;")
+ SETGID=${SETGID:-stunnel}
+}
+
+start() {
+ get_config || return 1
+ checkpath -d -m 0775 -o root:stunnel /run/stunnel
+ if [ "$(dirname ${PIDFILE})" != "/run" ]; then
+ checkpath -d -m 0755 -o ${SETUID}:${SETGID} -q $(dirname ${PIDFILE})
+ fi
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --pidfile "${PIDFILE}" ${CHROOT} \
+ --exec /usr/bin/stunnel -- ${STUNNEL_CONFIGFILE} ${STUNNEL_OPTIONS}
+ eend $? "Failed to start ${SVCNAME}"
+}
+
+stop() {
+ get_config || return 1
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --exec /usr/bin/stunnel \
+ --pidfile ${PIDFILE}
+ eend $? "Failed to stop ${SVCNAME}"
+}
+
+reload() {
+ get_config || return 1
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile ${PIDFILE} --name stunnel
+ eend $?
+}
diff --git a/net-misc/stunnel/stunnel-5.58.ebuild b/net-misc/stunnel/stunnel-5.58.ebuild
new file mode 100644
index 00000000000..2fcb74bea80
--- /dev/null
+++ b/net-misc/stunnel/stunnel-5.58.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib ssl-cert systemd tmpfiles
+
+DESCRIPTION="TLS/SSL - Port Wrapper"
+HOMEPAGE="https://www.stunnel.org/index.html"
+SRC_URI="
+ ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.usenix.org.uk/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://ftp.nluug.nl/pub/networking/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://www.namesdir.com/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ http://stunnel.cybermirror.org/archive/${PV%%.*}.x/${P}.tar.gz
+ http://mirrors.zerg.biz/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+ ftp://mirrors.go-parts.com/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="ipv6 selinux stunnel3 tcpd"
+
+DEPEND="
+ dev-libs/openssl:0=
+ tcpd? ( sys-apps/tcp-wrappers )
+"
+
+RDEPEND="
+ acct-user/stunnel
+ acct-group/stunnel
+ ${DEPEND}
+ selinux? ( sec-policy/selinux-stunnel )
+ stunnel3? ( dev-lang/perl )
+"
+
+RESTRICT="test"
+
+src_prepare() {
+ # Hack away generation of certificate
+ sed -i -e "s/^install-data-local:/do-not-run-this:/" \
+ tools/Makefile.in || die "sed failed"
+
+ echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
+
+ eapply_user
+}
+
+src_configure() {
+ local myeconfargs=(
+ --libdir="${EPREFIX}/usr/$(get_libdir)"
+ $(use_enable ipv6)
+ $(use_enable tcpd libwrap)
+ --with-ssl="${EPREFIX}"/usr
+ --disable-fips
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ rm -rf "${ED}"/usr/share/doc/${PN}
+ rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
+ "${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8
+ use stunnel3 || rm -f "${ED}"/usr/bin/stunnel3
+
+ # The binary was moved to /usr/bin with 4.21,
+ # symlink for backwards compatibility
+ dosym ../bin/stunnel /usr/sbin/stunnel
+
+ dodoc AUTHORS.md BUGS.md CREDITS.md PORTS.md README.md TODO.md
+ docinto html
+ dodoc doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
+ tools/importCA.html
+
+ insinto /etc/stunnel
+ doins "${FILESDIR}"/stunnel.conf
+ newinitd "${FILESDIR}"/stunnel-r2 stunnel
+
+ doenvd "${T}"/20stunnel
+
+ systemd_dounit "${S}/tools/stunnel.service"
+ newtmpfiles "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf
+}
+
+pkg_postinst() {
+ if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then
+ install_cert /etc/stunnel/stunnel
+ chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
+ fi
+
+ einfo "If you want to run multiple instances of stunnel, create a new config"
+ einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
+ einfo "\'pid= \' with a unique filename. For openrc make a symlink from the"
+ einfo "stunnel init script to \'stunnel.name\' and use that to start|stop"
+ einfo "your custom instance"
+}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-14 20:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-06 13:54 [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/, net-misc/stunnel/files/ Anthony G. Basile
-- strict thread matches above, loose matches on Subject: below --
2021-03-14 20:33 Conrad Kostecki
2020-08-09 19:16 Steve Arnold
2019-02-26 22:28 Aaron Bauman
2016-07-06 11:18 Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox