--- /dev/null
+diff -Naur a/tls.c b/tls.c
+--- a/tls.c 2006-11-25 19:52:08.000000000 +0100
++++ b/tls.c 2015-11-10 16:16:25.000000000 +0100
+@@ -73,10 +73,12 @@
+ printf("egd_sock is %s\n", egd_sock);
+ #ifdef HAVE_RAND_STATUS
+ if (RAND_status() != 1) {
++#ifndef OPENSSL_NO_EGD
+ if ( RAND_egd(egd_sock) == -1 ) {
+ fprintf(stderr, "egd_sock is %s\n", egd_sock);
+ sys_err("RAND_egd failed\n");
+ }
++#endif
+ if (RAND_status() != 1)
+ sys_err("ssl_init: System without /dev/urandom, PRNG seeding must be done manually.\r\n");
+ }
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="a TLS/SSL FTP wrapper/proxy which allows to use TLS with every FTP client"
+HOMEPAGE="http://www.tlswrap.com"
+SRC_URI="http://www.tlswrap.com/${P}.tar.gz"
+
+# GPL-2 for Gentoo init script
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="libressl"
+
+DEPEND="!libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:= )"
+RDEPEND=${DEPEND}
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-libressl.patch"
+}
+
+src_install() {
+ emake prefix="${D}/usr" install
+ dodoc ChangeLog README
+ newinitd "${FILESDIR}/tlswrap.init" tlswrap
+}