From ab95c4b2fc1510037a6b71dc9a6e38ffe45b0db6 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Mon, 18 Feb 2019 14:11:40 -0500 Subject: 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 --- .../opendnssec/files/opendnssec-openssl1.1.patch | 55 +++++ .../files/opendnssec-use-system-trang.patch | 4 +- net-dns/opendnssec/opendnssec-2.0.3-r1.ebuild | 236 ++++++++++++++++++++ net-dns/opendnssec/opendnssec-2.0.3.ebuild | 239 --------------------- 4 files changed, 293 insertions(+), 241 deletions(-) create mode 100644 net-dns/opendnssec/files/opendnssec-openssl1.1.patch create mode 100644 net-dns/opendnssec/opendnssec-2.0.3-r1.ebuild delete mode 100644 net-dns/opendnssec/opendnssec-2.0.3.ebuild (limited to 'net-dns/opendnssec') diff --git a/net-dns/opendnssec/files/opendnssec-openssl1.1.patch b/net-dns/opendnssec/files/opendnssec-openssl1.1.patch new file mode 100644 index 000000000000..b81068c4b9fd --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec-openssl1.1.patch @@ -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 diff --git a/net-dns/opendnssec/files/opendnssec-use-system-trang.patch b/net-dns/opendnssec/files/opendnssec-use-system-trang.patch index 745b277e1339..4cc564c265a3 100644 --- a/net-dns/opendnssec/files/opendnssec-use-system-trang.patch +++ b/net-dns/opendnssec/files/opendnssec-use-system-trang.patch @@ -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 diff --git a/net-dns/opendnssec/opendnssec-2.0.3-r1.ebuild b/net-dns/opendnssec/opendnssec-2.0.3-r1.ebuild new file mode 100644 index 000000000000..d8769127684e --- /dev/null +++ b/net-dns/opendnssec/opendnssec-2.0.3-r1.ebuild @@ -0,0 +1,236 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MY_P="${P/_}" +PKCS11_IUSE="+softhsm opensc external-hsm" +inherit autotools user + +DESCRIPTION="An open-source turn-key solution for DNSSEC" +HOMEPAGE="http://www.opendnssec.org/" +SRC_URI="http://www.${PN}.org/files/source/${MY_P}.tar.gz" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="debug doc +mysql readline +signer sqlite test ${PKCS11_IUSE}" + +RDEPEND=" + dev-lang/perl + dev-libs/libxml2 + dev-libs/libxslt + net-libs/ldns + mysql? ( + dev-db/mysql-connector-c:0= + dev-perl/DBD-mysql + ) + opensc? ( dev-libs/opensc ) + readline? ( sys-libs/readline:0 ) + softhsm? ( dev-libs/softhsm:* ) + sqlite? ( + dev-db/sqlite:3 + dev-perl/DBD-SQLite + ) +" +DEPEND="${RDEPEND} + doc? ( app-doc/doxygen ) + test? ( + app-text/trang + ) +" + +REQUIRED_USE=" + ^^ ( mysql sqlite ) + ^^ ( softhsm opensc external-hsm ) +" + +PATCHES=( + "${FILESDIR}/${PN}-fix-localstatedir-2.0.x.patch" + "${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}" + +DOCS=( MIGRATION NEWS ) + +check_pkcs11_setup() { + # PKCS#11 HSM's are often only available with proprietary drivers not + # available in portage tree. + + if use softhsm; then + PKCS11_LIB=softhsm + if has_version ">=dev-libs/softhsm-1.3.1"; then + PKCS11_PATH=/usr/$(get_libdir)/softhsm/libsofthsm.so + else + PKCS11_PATH=/usr/$(get_libdir)/libsofthsm.so + fi + elog "Building with SoftHSM PKCS#11 library support." + fi + if use opensc; then + PKCS11_LIB=opensc + PKCS11_PATH=/usr/$(get_libdir)/opensc-pkcs11.so + elog "Building with OpenSC PKCS#11 library support." + fi + if use external-hsm; then + if [[ -n ${PKCS11_SCA6000} ]]; then + PKCS11_LIB=sca6000 + PKCS11_PATH=${PKCS11_SCA6000} + elif [[ -n ${PKCS11_ETOKEN} ]]; then + PKCS11_LIB=etoken + PKCS11_PATH=${PKCS11_ETOKEN} + elif [[ -n ${PKCS11_NCIPHER} ]]; then + PKCS11_LIB=ncipher + PKCS11_PATH=${PKCS11_NCIPHER} + elif [[ -n ${PKCS11_AEPKEYPER} ]]; then + PKCS11_LIB=aepkeyper + PKCS11_PATH=${PKCS11_AEPKEYPER} + else + ewarn "You enabled USE flag 'external-hsm' but did not specify a path to a PKCS#11" + ewarn "library. To set a path, set one of the following environment variables:" + ewarn " for Sun Crypto Accelerator 6000, set: PKCS11_SCA6000=" + ewarn " for Aladdin eToken, set: PKCS11_ETOKEN=" + ewarn " for Thales/nCipher netHSM, set: PKCS11_NCIPHER=" + ewarn " for AEP Keyper, set: PKCS11_AEPKEYPER=" + ewarn "Example:" + ewarn " PKCS11_ETOKEN=\"/opt/etoken/lib/libeTPkcs11.so\" emerge -pv opendnssec" + ewarn "or store the variable into /etc/portage/make.conf" + die "USE flag 'external-hsm' set but no PKCS#11 library path specified." + fi + elog "Building with external PKCS#11 library support ($PKCS11_LIB): ${PKCS11_PATH}" + fi +} + +pkg_pretend() { + if has_version "=2.0.0 you need to upgrade to" + eerror "version >=1.4.10 first:" + eerror "" + eerror " emerge \"=1.4.10 first for proper db migraion" + fi + + check_pkcs11_setup +} + +pkg_setup() { + enewgroup opendnssec + enewuser opendnssec -1 -1 -1 opendnssec + + # pretend does not preserve variables so we need to run this once more + check_pkcs11_setup +} + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf \ + --without-cunit \ + --localstatedir="${EPREFIX}/var" \ + --disable-static \ + --with-enforcer-database=$(use mysql && echo "mysql")$(use sqlite && echo "sqlite3") \ + --with-pkcs11-${PKCS11_LIB}=${PKCS11_PATH} \ + $(use_with readline) \ + $(use_enable signer) +} + +src_compile() { + default + use doc && emake docs +} + +src_install() { + default + + # remove useless .la files + find "${ED}" -name '*.la' -delete + + # Remove subversion tags from config files to avoid useless config updates + sed -i \ + -e '/