net-dns/opendnssec: Revbump to fix dependencies and building

Non-maintainer commit

Backport patch for OpenSSL 1.1 from upstream
Adjust MySQL dependencies

Closes: https://bugs.gentoo.org/675008
Closes: https://bugs.gentoo.org/665968
Package-Manager: Portage-2.3.61, Repoman-2.3.12
Signed-off-by: Brian Evans <grknight@gentoo.org>
This commit is contained in:
Brian Evans
2019-02-18 14:11:40 -05:00
parent c1a0f2050e
commit ab95c4b2fc
3 changed files with 63 additions and 11 deletions

View File

@@ -0,0 +1,55 @@
--- a/signer/src/wire/tsig-openssl.c
+++ b/signer/src/wire/tsig-openssl.c
@@ -126,7 +126,11 @@ static void
cleanup_context(void *data)
{
HMAC_CTX* context = (HMAC_CTX*) data;
+#ifdef HAVE_SSL_NEW_HMAC
+ HMAC_CTX_free(context);
+#else
HMAC_CTX_cleanup(context);
+#endif
}
static void
@@ -146,8 +150,13 @@ static void*
create_context()
{
HMAC_CTX* context;
+#ifdef HAVE_SSL_NEW_HMAC
+ CHECKALLOC(context = HMAC_CTX_new());
+ HMAC_CTX_reset(context);
+#else
CHECKALLOC(context = (HMAC_CTX*) malloc(sizeof(HMAC_CTX)));
HMAC_CTX_init(context);
+#endif
context_add_cleanup(context);
return context;
}
--- a/m4/acx_ssl.m4 2016-10-14 09:40:13.000000000 -0400
+++ b/m4/acx_ssl.m4 2019-02-18 13:52:49.861127549 -0500
@@ -35,12 +35,21 @@
if test x_$ssldir = x_/usr/sfw; then
SSL_LIBS="$SSL_LIBS -R$ssldir/lib";
fi
- AC_CHECK_LIB(crypto, HMAC_CTX_init,, [
- AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required])
- ])
+ save_LIBS=$LIBS
+ AC_CHECK_LIB(crypto, HMAC_CTX_reset, [
+ AC_DEFINE_UNQUOTED([HAVE_SSL_NEW_HMAC], [], [Define if you have the SSL libraries with new HMAC related functions.])
+ ], [
+ AC_CHECK_LIB(crypto, HMAC_CTX_init,, [
+ AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required])
+ ])
+ ] )
+ SSL_LIBS="$SSL_LIBS -lcrypto";
+ LIBS="$SSL_LIBS $LIBS"
AC_CHECK_FUNCS([EVP_sha1 EVP_sha256])
+ LIBS=$saveLIBS
fi
AC_SUBST(HAVE_SSL)
+ AC_SUBST(HAVE_SSL_NEW_HMAC)
AC_SUBST(SSL_INCLUDES)
AC_SUBST(SSL_LIBS)
fi

View File

@@ -1,5 +1,5 @@
--- conf/Makefile.am.orig 2013-05-12 22:45:26.514768943 +0200
+++ conf/Makefile.am 2013-05-12 22:46:33.399545628 +0200
--- a/conf/Makefile.am.orig 2013-05-12 22:45:26.514768943 +0200
+++ b/conf/Makefile.am 2013-05-12 22:46:33.399545628 +0200
@@ -7,7 +7,7 @@
XML = addns.xml conf.xml kasp.xml zonelist.xml signconf.xml enforcerstate.xml
XSL= kasp2html.xsl

View File

@@ -1,11 +1,11 @@
# Copyright 1999-2017 Gentoo Foundation
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
EAPI=7
MY_P="${P/_}"
PKCS11_IUSE="+softhsm opensc external-hsm"
inherit autotools eutils multilib user
inherit autotools user
DESCRIPTION="An open-source turn-key solution for DNSSEC"
HOMEPAGE="http://www.opendnssec.org/"
@@ -22,7 +22,7 @@ RDEPEND="
dev-libs/libxslt
net-libs/ldns
mysql? (
virtual/mysql
dev-db/mysql-connector-c:0=
dev-perl/DBD-mysql
)
opensc? ( dev-libs/opensc )
@@ -50,6 +50,7 @@ PATCHES=(
"${FILESDIR}/${PN}-fix-run-dir-2.0.x.patch"
"${FILESDIR}/${PN}-drop-privileges-2.0.x.patch"
"${FILESDIR}/${PN}-use-system-trang.patch"
"${FILESDIR}/${PN}-openssl1.1.patch"
)
S="${WORKDIR}/${MY_P}"
@@ -130,11 +131,7 @@ pkg_setup() {
}
src_prepare() {
local patch
default
for patch in "${PATCHES[@]}"; do
epatch "$patch"
done
eautoreconf
}
@@ -199,7 +196,7 @@ src_install() {
-e 's,^SCHEMA=../src/db/,SCHEMA=/usr/share/opendnssec/db/sql/,' \
-e 's,^SCHEMA=../../src/db/,SCHEMA=/usr/share/opendnssec/db/sql/,' \
"${ED}"/usr/share/opendnssec/db/convert_* \
"${ED}"/usr/share/opendnssec/db/1.4-2.0_db_convert/convert_*
"${ED}"/usr/share/opendnssec/db/1.4-2.0_db_convert/convert_* || die
# fix permissions
fowners root:opendnssec /etc/opendnssec