summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bauman <bman@gentoo.org>2020-09-29 09:52:32 -0400
committerAaron Bauman <bman@gentoo.org>2020-09-29 09:52:32 -0400
commit01d1b4b0b7ad60855d735b3260e9bf8dedd78eda (patch)
tree7e6c51dea75dab88a0928e2461bd5ba06f5cc77b /net-dns/opendnssec
parentRevert "net-dns/opendnssec: fix metadata.xml, remove unused USE description" (diff)
downloadgentoo-01d1b4b0b7ad60855d735b3260e9bf8dedd78eda.tar.gz
gentoo-01d1b4b0b7ad60855d735b3260e9bf8dedd78eda.tar.bz2
gentoo-01d1b4b0b7ad60855d735b3260e9bf8dedd78eda.zip
Revert "net-dns/opendnssec: drop old EAPI=5"
This reverts commit 0253543021b04dd2339f66438542f2c43c876b82. * I dropped LTS release so let's restore them. Signed-off-by: Aaron Bauman <bman@gentoo.org>
Diffstat (limited to 'net-dns/opendnssec')
-rw-r--r--net-dns/opendnssec/Manifest4
-rw-r--r--net-dns/opendnssec/opendnssec-1.3.18-r1.ebuild204
-rw-r--r--net-dns/opendnssec/opendnssec-1.4.12-r1.ebuild208
-rw-r--r--net-dns/opendnssec/opendnssec-1.4.8.2.ebuild206
-rw-r--r--net-dns/opendnssec/opendnssec-2.0.1-r1.ebuild240
5 files changed, 862 insertions, 0 deletions
diff --git a/net-dns/opendnssec/Manifest b/net-dns/opendnssec/Manifest
index b7655458e116..0136e5ba4f94 100644
--- a/net-dns/opendnssec/Manifest
+++ b/net-dns/opendnssec/Manifest
@@ -1 +1,5 @@
+DIST opendnssec-1.3.18.tar.gz 1143889 BLAKE2B 0443a9d29de479257c05d024a756c176a342032eb17b105c04f5808ba550f1026815f191bce6ada13c54a7b7fea0f816d7754227f3d1c9ed76bc4d602785c2cf SHA512 5df39ba778c9b1245e88b81df7aa491bca0aad2943845284c4f8b4dd729fa69014d45f07bdf99a048ccf668a1c9675a8dd99efcec1abdbd4e06e9738fec6ab6d
+DIST opendnssec-1.4.12.tar.gz 1036392 BLAKE2B 3bfbcfe91d7da7c2e4b1c5439f7d55e15612ab6ace6af25fcb9c9eb7ddb2e1055e70684c2bd6bbae57a0c2eb78098b448f7dca198e0d6f9e2e812945a1f06cc2 SHA512 b72b76ab4aec8cc63cc9c020bef9a24b000fd00172a07cf43d57b3a33041bef9e107b71eb7271bb13c3566510599c6a1913cf986a724e169c42dc8bdac8d2e51
+DIST opendnssec-1.4.8.2.tar.gz 1043171 BLAKE2B 20b1fa0d97b776223314937061cd42f4fe0a924e58a159fd0399d23058e2b0fd44d55049947de26c36aade5b5599527fc03f09eeef4e20f8c9beee40dfbcd7fb SHA512 7f2e10b425f60947aca40c61509b07ddc4363105cc882b518ffa816437299d6f881411cb38325f27b3a34c2005953988b39c945362866dd0f1f7c6ef973bfa06
+DIST opendnssec-2.0.1.tar.gz 1101523 BLAKE2B 0446efd04e73e00d204c53164c3c6aaecb9f37014a110ee85d7e7b1728d225aafcf9e6ef31a7dd29cdf2e875e7b653ab6e8178cece65c47a1c5b027facc16130 SHA512 aa12818f92688e087acaff8a6771d2a7da733e04d9e821967d313c7ff880a1056f470b11988eba1e7aad606418c3a4587f654163d74f68e3f61943c74d86d052
DIST opendnssec-2.0.3.tar.gz 1103355 BLAKE2B b64e729003de86e4139efaad60c9feae9f4e19c16a29fdced55d66f5896c4b7d76c4b8c57a8330d55c0c03e87de1ebe6ec49ef9d1b6e215be963680d2c805579 SHA512 4745a9ac317cc65d6f5b14be640687efd5fde2149541f692fb607a458378d27e903f175023c1aa16a777d17cef9cc68f1a84e7e7cdb233466d26756721b34424
diff --git a/net-dns/opendnssec/opendnssec-1.3.18-r1.ebuild b/net-dns/opendnssec/opendnssec-1.3.18-r1.ebuild
new file mode 100644
index 000000000000..a37fb6fc331a
--- /dev/null
+++ b/net-dns/opendnssec/opendnssec-1.3.18-r1.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_}"
+PKCS11_IUSE="+softhsm opensc external-hsm"
+inherit autotools multilib user
+
+DESCRIPTION="An open-source turn-key solution for DNSSEC"
+HOMEPAGE="https://www.opendnssec.org/"
+SRC_URI="https://www.${PN}.org/files/source/${MY_P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="-auditor +curl debug doc eppclient mysql +signer +sqlite test ${PKCS11_IUSE}"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-lang/perl
+ dev-libs/libxml2
+ dev-libs/libxslt
+ net-libs/ldns
+ curl? ( net-misc/curl )
+ mysql? (
+ virtual/mysql
+ dev-perl/DBD-mysql
+ )
+ opensc? ( dev-libs/opensc )
+ softhsm? ( dev-libs/softhsm:* )
+ sqlite? (
+ dev-db/sqlite:3
+ dev-perl/DBD-SQLite
+ )
+"
+DEPEND="${RDEPEND}
+ doc? ( app-doc/doxygen )
+ test? (
+ app-text/trang
+ )
+"
+# test? dev-util/cunit # Requires running test DB
+
+REQUIRED_USE="
+ ^^ ( mysql sqlite )
+ ^^ ( softhsm opensc external-hsm )
+ eppclient? ( curl )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-fix-localstatedir.patch"
+ "${FILESDIR}/${PN}-fix-run-dir.patch"
+ "${FILESDIR}/${PN}-1.3.14-drop-privileges.patch"
+ "${FILESDIR}/${PN}-1.3.14-use-system-trang.patch"
+ "${FILESDIR}/${PN}-1.3.18-eppclient-curl-CVE-2012-5582.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=<path>"
+ ewarn " for Aladdin eToken, set: PKCS11_ETOKEN=<path>"
+ ewarn " for Thales/nCipher netHSM, set: PKCS11_NCIPHER=<path>"
+ ewarn " for AEP Keyper, set: PKCS11_AEPKEYPER=<path>"
+ 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() {
+ local i
+
+ for i in eppclient mysql; do
+ if use ${i}; then
+ ewarn
+ ewarn "Usage of ${i} is considered experimental."
+ ewarn "Do not report bugs against this feature."
+ ewarn
+ fi
+ done
+
+ 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() {
+ base_src_prepare
+ eautoreconf
+}
+
+src_configure() {
+ # $(use_with test cunit "${EPREFIX}/usr/") \
+ econf \
+ --without-cunit \
+ --localstatedir="${EPREFIX}/var/" \
+ --disable-static \
+ --with-database-backend=$(use mysql && echo "mysql")$(use sqlite && echo "sqlite3") \
+ --with-pkcs11-${PKCS11_LIB}=${PKCS11_PATH} \
+ --disable-auditor \
+ $(use_with curl) \
+ $(use_enable debug timeshift) \
+ $(use_enable eppclient) \
+ $(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 '/<!-- \$Id:/ d' \
+ "${ED}"/etc/opendnssec/* || die
+
+ # install update scripts
+ insinto /usr/share/opendnssec
+ use sqlite && doins enforcer/utils/migrate_keyshare_sqlite3.pl
+ use mysql && doins enforcer/utils/migrate_keyshare_mysql.pl
+
+ # fix permissions
+ fowners root:opendnssec /etc/opendnssec
+ fowners root:opendnssec /etc/opendnssec/{conf,kasp,zonelist,zonefetch}.xml
+ use eppclient && fowners root:opendnssec /etc/opendnssec/eppclientd.conf
+
+ fowners opendnssec:opendnssec /var/lib/opendnssec/{,signconf,unsigned,signed,tmp}
+
+ # install conf/init script
+ newinitd "${FILESDIR}"/opendnssec.initd-1.3.x opendnssec
+ newconfd "${FILESDIR}"/opendnssec.confd-1.3.x opendnssec
+ use auditor || sed -i 's/^CHECKCONFIG_BIN=.*/CHECKCONFIG_BIN=/' "${D}"/etc/conf.d/opendnssec
+}
+
+pkg_postinst() {
+ if use softhsm; then
+ elog "Please make sure that you create your softhsm database in a location writeable"
+ elog "by the opendnssec user. You can set its location in /etc/softhsm.conf."
+ elog "Suggested configuration is:"
+ elog " echo \"0:/var/lib/opendnssec/softhsm_slot0.db\" >> /etc/softhsm.conf"
+ elog " softhsm --init-token --slot 0 --label OpenDNSSEC"
+ elog " chown opendnssec:opendnssec /var/lib/opendnssec/softhsm_slot0.db"
+ fi
+ if use auditor; then
+ ewarn
+ ewarn "Please note that auditor support has been disabled in this version since it"
+ ewarn "it depends on ruby 1.8 which has been removed from the portage tree."
+ ewarn "USE=auditor is only provided for this warning but will not install the"
+ ewarn "auditor anymore."
+ ewarn
+ fi
+}
diff --git a/net-dns/opendnssec/opendnssec-1.4.12-r1.ebuild b/net-dns/opendnssec/opendnssec-1.4.12-r1.ebuild
new file mode 100644
index 000000000000..7204fc6a5df8
--- /dev/null
+++ b/net-dns/opendnssec/opendnssec-1.4.12-r1.ebuild
@@ -0,0 +1,208 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_}"
+PKCS11_IUSE="+softhsm opensc external-hsm"
+inherit autotools eutils multilib user
+
+DESCRIPTION="An open-source turn-key solution for DNSSEC"
+HOMEPAGE="https://www.opendnssec.org/"
+SRC_URI="https://www.${PN}.org/files/source/${MY_P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc +mysql +signer sqlite test ${PKCS11_IUSE}"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-lang/perl
+ dev-libs/libxml2
+ dev-libs/libxslt
+ net-libs/ldns
+ mysql? (
+ virtual/mysql
+ dev-perl/DBD-mysql
+ )
+ opensc? ( dev-libs/opensc )
+ 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.patch"
+ "${FILESDIR}/${PN}-fix-run-dir.patch"
+ "${FILESDIR}/${PN}-drop-privileges.patch"
+ "${FILESDIR}/${PN}-use-system-trang.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=<path>"
+ ewarn " for Aladdin eToken, set: PKCS11_ETOKEN=<path>"
+ ewarn " for Thales/nCipher netHSM, set: PKCS11_NCIPHER=<path>"
+ ewarn " for AEP Keyper, set: PKCS11_AEPKEYPER=<path>"
+ 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() {
+ 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() {
+ local patch
+ default
+ for patch in "${PATCHES[@]}"; do
+ epatch "$patch"
+ done
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --without-cunit \
+ --localstatedir="${EPREFIX}/var/" \
+ --disable-static \
+ --with-database-backend=$(use mysql && echo "mysql")$(use sqlite && echo "sqlite3") \
+ --with-pkcs11-${PKCS11_LIB}=${PKCS11_PATH} \
+ $(use_enable debug timeshift) \
+ $(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 '/<!-- \$Id:/ d' \
+ "${ED}"/etc/opendnssec/* || die
+
+ # install update scripts
+ insinto /usr/share/opendnssec
+ if use sqlite; then
+ doins enforcer/utils/migrate_*sqlite*
+ fi
+ if use mysql; then
+ doins enforcer/utils/migrate_*mysql*
+ fi
+
+ # fix permissions
+ fowners root:opendnssec /etc/opendnssec
+ fowners root:opendnssec /etc/opendnssec/{addns,conf,kasp,zonelist}.xml
+ fowners opendnssec:opendnssec /var/lib/opendnssec/{,signconf,unsigned,signed,tmp}
+
+ # install conf/init script
+ newinitd "${FILESDIR}"/opendnssec.initd opendnssec
+ newconfd "${FILESDIR}"/opendnssec.confd opendnssec
+}
+
+pkg_postinst() {
+ local v
+ if use softhsm; then
+ elog "Please make sure that you create your softhsm database in a location writeable"
+ elog "by the opendnssec user. You can set its location in /etc/softhsm.conf."
+ elog "Suggested configuration is:"
+ elog " echo \"0:/var/lib/opendnssec/softhsm_slot0.db\" >> /etc/softhsm.conf"
+ elog " softhsm --init-token --slot 0 --label OpenDNSSEC"
+ elog " chown opendnssec:opendnssec /var/lib/opendnssec/softhsm_slot0.db"
+ fi
+
+ for v in $REPLACING_VERSIONS; do
+ case $v in
+ 1.3.*)
+ ewarn ""
+ ewarn "You are upgrading from version 1.3."
+ ewarn ""
+ ewarn "Please be aware of the following:"
+ ewarn " * OpenDNSSEC now supports both input and output adapters for"
+ ewarn " AXFR and IXFR in addition to file transfer."
+ ewarn " -> The zonefetch.xml file has been replaced by addns.xml"
+ ewarn " to support this enhancement."
+ ewarn " -> changes to the KASP database mean that a database"
+ ewarn " migration is required to upgrade to 1.4 from earlier"
+ ewarn " versions of OpenDNSSEC."
+ ewarn " * The auditor is no longer supported."
+ ewarn ""
+ ewarn "You can find more information here:"
+ ewarn " * /usr/share/doc/opendnssec*/MIGRATION*"
+ ewarn " * https://wiki.opendnssec.org/display/DOCS/Migrating+zone+fetcher+to+DNS+adapters"
+ ewarn " * https://wiki.opendnssec.org/display/DOCS/Migrating+from+earlier+versions+of+OpenDNSSEC"
+ ewarn ""
+ ;;
+ esac
+ done
+}
diff --git a/net-dns/opendnssec/opendnssec-1.4.8.2.ebuild b/net-dns/opendnssec/opendnssec-1.4.8.2.ebuild
new file mode 100644
index 000000000000..fa23c0bf555a
--- /dev/null
+++ b/net-dns/opendnssec/opendnssec-1.4.8.2.ebuild
@@ -0,0 +1,206 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_}"
+PKCS11_IUSE="+softhsm opensc external-hsm"
+inherit autotools multilib user
+
+DESCRIPTION="An open-source turn-key solution for DNSSEC"
+HOMEPAGE="https://www.opendnssec.org/"
+SRC_URI="https://www.${PN}.org/files/source/${MY_P}.tar.gz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc +mysql +signer sqlite test ${PKCS11_IUSE}"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-lang/perl
+ dev-libs/libxml2
+ dev-libs/libxslt
+ net-libs/ldns
+ mysql? (
+ virtual/mysql
+ dev-perl/DBD-mysql
+ )
+ opensc? ( dev-libs/opensc )
+ 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.patch"
+ "${FILESDIR}/${PN}-fix-run-dir.patch"
+ "${FILESDIR}/${PN}-drop-privileges.patch"
+ "${FILESDIR}/${PN}-use-system-trang.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=<path>"
+ ewarn " for Aladdin eToken, set: PKCS11_ETOKEN=<path>"
+ ewarn " for Thales/nCipher netHSM, set: PKCS11_NCIPHER=<path>"
+ ewarn " for AEP Keyper, set: PKCS11_AEPKEYPER=<path>"
+ 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() {
+ 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() {
+ base_src_prepare
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --without-cunit \
+ --localstatedir="${EPREFIX}/var/" \
+ --disable-static \
+ --with-database-backend=$(use mysql && echo "mysql")$(use sqlite && echo "sqlite3") \
+ --with-pkcs11-${PKCS11_LIB}=${PKCS11_PATH} \
+ $(use_enable debug timeshift) \
+ $(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 '/<!-- \$Id:/ d' \
+ "${ED}"/etc/opendnssec/* || die
+
+ # install update scripts
+ insinto /usr/share/opendnssec
+ if use sqlite; then
+ doins enforcer/utils/migrate_keyshare_sqlite3.pl
+ doins enforcer/utils/migrate_adapters_1.sqlite3
+ fi
+ if use mysql; then
+ doins enforcer/utils/migrate_keyshare_mysql.pl
+ doins enforcer/utils/migrate_adapters_1.mysql
+ fi
+
+ # fix permissions
+ fowners root:opendnssec /etc/opendnssec
+ fowners root:opendnssec /etc/opendnssec/{addns,conf,kasp,zonelist}.xml
+ fowners opendnssec:opendnssec /var/lib/opendnssec/{,signconf,unsigned,signed,tmp}
+
+ # install conf/init script
+ newinitd "${FILESDIR}"/opendnssec.initd opendnssec
+ newconfd "${FILESDIR}"/opendnssec.confd opendnssec
+}
+
+pkg_postinst() {
+ local v
+ if use softhsm; then
+ elog "Please make sure that you create your softhsm database in a location writeable"
+ elog "by the opendnssec user. You can set its location in /etc/softhsm.conf."
+ elog "Suggested configuration is:"
+ elog " echo \"0:/var/lib/opendnssec/softhsm_slot0.db\" >> /etc/softhsm.conf"
+ elog " softhsm --init-token --slot 0 --label OpenDNSSEC"
+ elog " chown opendnssec:opendnssec /var/lib/opendnssec/softhsm_slot0.db"
+ fi
+
+ for v in $REPLACING_VERSIONS; do
+ case $v in
+ 1.3.*)
+ ewarn ""
+ ewarn "You are upgrading from version 1.3."
+ ewarn ""
+ ewarn "Please be aware of the following:"
+ ewarn " * OpenDNSSEC now supports both input and output adapters for"
+ ewarn " AXFR and IXFR in addition to file transfer."
+ ewarn " -> The zonefetch.xml file has been replaced by addns.xml"
+ ewarn " to support this enhancement."
+ ewarn " -> changes to the KASP database mean that a database"
+ ewarn " migration is required to upgrade to 1.4 from earlier"
+ ewarn " versions of OpenDNSSEC."
+ ewarn " * The auditor is no longer supported."
+ ewarn ""
+ ewarn "You can find more information here:"
+ ewarn " * /usr/share/doc/opendnssec*/MIGRATION*"
+ ewarn " * https://wiki.opendnssec.org/display/DOCS/Migrating+zone+fetcher+to+DNS+adapters"
+ ewarn " * https://wiki.opendnssec.org/display/DOCS/Migrating+from+earlier+versions+of+OpenDNSSEC"
+ ewarn ""
+ ;;
+ esac
+ done
+}
diff --git a/net-dns/opendnssec/opendnssec-2.0.1-r1.ebuild b/net-dns/opendnssec/opendnssec-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..b93dc8f5ab2b
--- /dev/null
+++ b/net-dns/opendnssec/opendnssec-2.0.1-r1.ebuild
@@ -0,0 +1,240 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/_}"
+PKCS11_IUSE="+softhsm opensc external-hsm"
+inherit autotools eutils multilib user
+
+DESCRIPTION="An open-source turn-key solution for DNSSEC"
+HOMEPAGE="https://www.opendnssec.org/"
+SRC_URI="https://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}"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-lang/perl
+ dev-libs/libxml2
+ dev-libs/libxslt
+ net-libs/ldns
+ mysql? (
+ virtual/mysql
+ 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"
+)
+
+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=<path>"
+ ewarn " for Aladdin eToken, set: PKCS11_ETOKEN=<path>"
+ ewarn " for Thales/nCipher netHSM, set: PKCS11_NCIPHER=<path>"
+ ewarn " for AEP Keyper, set: PKCS11_AEPKEYPER=<path>"
+ 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 "<net-dns/opendnssec-1.4.10"; then
+ ################################################################################
+ eerror "You are already using OpenDNSSEC."
+ eerror "In order to migrate to version >=2.0.0 you need to upgrade to"
+ eerror "version >=1.4.10 first:"
+ eerror ""
+ eerror " emerge \"<net-dns/opendnssec-2\""
+ eerror ""
+ eerror "See https://github.com/opendnssec/opendnssec/blob/2.0/master/MIGRATION"
+ eerror "for details."
+ eerror ""
+ die "Please upgrade to version >=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() {
+ local patch
+ default
+ for patch in "${PATCHES[@]}"; do
+ epatch "$patch"
+ done
+ 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 '/<!-- \$Id:/ d' \
+ "${ED}"/etc/opendnssec/* || die
+
+ # install db update/migration stuff
+ insinto /usr/share/opendnssec/db
+ if use sqlite; then
+ doins enforcer/utils/convert_mysql_to_sqlite
+ fi
+ if use mysql; then
+ doins enforcer/utils/convert_sqlite_to_mysql
+ fi
+
+ insinto /usr/share/opendnssec/db/sql
+ if use sqlite; then
+ doins enforcer/src/db/schema.sqlite
+ fi
+ if use mysql; then
+ doins enforcer/src/db/schema.mysql
+ fi
+
+ insinto /usr/share/opendnssec/db/1.4-2.0_db_convert
+ doins enforcer/utils/1.4-2.0_db_convert/find_problematic_zones.sql
+ doins enforcer/utils/1.4-2.0_db_convert/README.md
+ if use sqlite; then
+ doins enforcer/utils/1.4-2.0_db_convert/sqlite_convert.sql
+ doins enforcer/utils/1.4-2.0_db_convert/convert_sqlite
+ fi
+ if use mysql; then
+ doins enforcer/utils/1.4-2.0_db_convert/convert_mysql
+ doins enforcer/utils/1.4-2.0_db_convert/mysql_convert.sql
+ fi
+
+ # patch scripts to find schema files
+ sed -i \
+ -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_*
+
+ # fix permissions
+ fowners root:opendnssec /etc/opendnssec
+ fowners root:opendnssec /etc/opendnssec/{addns,conf,kasp,zonelist}.xml
+ fowners opendnssec:opendnssec /var/lib/opendnssec/{,enforcer,signconf,signed,signer,unsigned}
+
+ # install conf/init script
+ newinitd "${FILESDIR}"/opendnssec.initd opendnssec
+ newconfd "${FILESDIR}"/opendnssec.confd opendnssec
+}
+
+pkg_postinst() {
+ local v
+ if use softhsm; then
+ elog "Please make sure that you create your softhsm database in a location writeable"
+ elog "by the opendnssec user. You can set its location in /etc/softhsm.conf."
+ elog "Suggested configuration is:"
+ elog " echo \"0:/var/lib/opendnssec/softhsm_slot0.db\" >> /etc/softhsm.conf"
+ elog " softhsm --init-token --slot 0 --label OpenDNSSEC"
+ elog " chown opendnssec:opendnssec /var/lib/opendnssec/softhsm_slot0.db"
+ fi
+ for v in $REPLACING_VERSIONS; do
+ case $v in
+ 1.4.*)
+ ewarn ""
+ ewarn "You are upgrading from version 1.4."
+ ewarn ""
+ ewarn "A migration is needed from 1.4 to 2.0."
+ ewarn "For details see /usr/share/doc/${P}/MIGRATION*"
+ ewarn ""
+ ewarn "For your convenience the mentioned migration scripts and README"
+ ewarn "have been installed to /usr/share/${PN}/db/1.4-2.0_db_convert"
+ ewarn ""
+ ;;
+ esac
+ done
+}