diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2011-06-02 12:26:28 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2011-06-02 12:26:28 +0000 |
commit | 9d47d7a70c738cbb0a43b108da9d7ddbc8934738 (patch) | |
tree | 84faafc6d27cbcfbe00dcf75d061afc9ba1c3c2c /net-dns/opendnssec | |
parent | add ~arm, bug #365845 (diff) | |
download | historical-9d47d7a70c738cbb0a43b108da9d7ddbc8934738.tar.gz historical-9d47d7a70c738cbb0a43b108da9d7ddbc8934738.tar.bz2 historical-9d47d7a70c738cbb0a43b108da9d7ddbc8934738.zip |
Initial commit. Fixes bug #304733. Thanks to Tom Hendrikx for initial ebuild.
Package-Manager: portage-2.2.0_alpha37/cvs/Linux x86_64
Diffstat (limited to 'net-dns/opendnssec')
-rw-r--r-- | net-dns/opendnssec/ChangeLog | 14 | ||||
-rw-r--r-- | net-dns/opendnssec/Manifest | 20 | ||||
-rw-r--r-- | net-dns/opendnssec/files/opendnssec-drop-privileges.patch | 43 | ||||
-rw-r--r-- | net-dns/opendnssec/files/opendnssec-fix-localstatedir.patch | 32 | ||||
-rw-r--r-- | net-dns/opendnssec/files/opendnssec-rename-test.patch | 11 | ||||
-rw-r--r-- | net-dns/opendnssec/files/opendnssec-use-system-trang.patch | 30 | ||||
-rw-r--r-- | net-dns/opendnssec/files/opendnssec.confd | 14 | ||||
-rw-r--r-- | net-dns/opendnssec/files/opendnssec.initd | 91 | ||||
-rw-r--r-- | net-dns/opendnssec/metadata.xml | 18 | ||||
-rw-r--r-- | net-dns/opendnssec/opendnssec-1.3.0_rc2.ebuild | 185 |
10 files changed, 458 insertions, 0 deletions
diff --git a/net-dns/opendnssec/ChangeLog b/net-dns/opendnssec/ChangeLog new file mode 100644 index 000000000000..44996c204992 --- /dev/null +++ b/net-dns/opendnssec/ChangeLog @@ -0,0 +1,14 @@ +# ChangeLog for net-dns/opendnssec +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/opendnssec/ChangeLog,v 1.1 2011/06/02 12:26:28 scarabeus Exp $ + +*opendnssec-1.3.0_rc2 (02 Jun 2011) + + 02 Jun 2011; Tomáš Chvátal <scarabeus@gentoo.org> + +opendnssec-1.3.0_rc2.ebuild, +files/opendnssec.confd, + +files/opendnssec.initd, +files/opendnssec-drop-privileges.patch, + +files/opendnssec-fix-localstatedir.patch, + +files/opendnssec-rename-test.patch, + +files/opendnssec-use-system-trang.patch, +metadata.xml: + Initial commit. Fixes bug #304733. Thanks to Tom Hendrikx for initial ebuild. + diff --git a/net-dns/opendnssec/Manifest b/net-dns/opendnssec/Manifest new file mode 100644 index 000000000000..5ca4a583bab2 --- /dev/null +++ b/net-dns/opendnssec/Manifest @@ -0,0 +1,20 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX opendnssec-drop-privileges.patch 906 RMD160 c7e5f09d08c7431fbe0d5496e980f1468de5185a SHA1 875529fd365e9168f4a34334c884e01b670974d3 SHA256 faecb049748efab2652b890020106748039dbe7022d943393ac50b71b429b340 +AUX opendnssec-fix-localstatedir.patch 1693 RMD160 9f7b783350fe0418f97cb78090fd8f02fc016447 SHA1 0875f47614990ce9c454cee2b1a6ef51c4c30ad9 SHA256 e9a29b3adf22ef6dd3a0ac43d2a48e2705ae09cd7550b4f3294b89dcd7814ecd +AUX opendnssec-rename-test.patch 331 RMD160 34705b28224154aa7e13b15d023f16dcfaf7892e SHA1 4e7653e8425e49d98bc14d009788efbb970366e2 SHA256 d140d1da7df9ba34195097394c715fdf01ace6290325dbe9919f6666a11627d7 +AUX opendnssec-use-system-trang.patch 765 RMD160 8d00ea18c61f2505fb445fcd7245bc6d757b72c5 SHA1 cf997f34f78456f37f6e5e93e4a7c78171cd20f3 SHA256 f9c8c58ce8b50183b3b709876a1c4bd0b5a0eb5c0b852995118db5eead1f9f1d +AUX opendnssec.confd 602 RMD160 7ed98a8d33205ea51eb8da842643f9dca83e513f SHA1 7c92512b21f8eb83944a0ba46fe093c984da6efc SHA256 292246420078b9e9765f10e873602ed8c1ac4d7989f11a6a7eb471961c046c62 +AUX opendnssec.initd 2010 RMD160 ea683029afce4642b911ec1d5a48b7c7f23af3b2 SHA1 0736e32c717a01746515e30479d9e1dc600eb099 SHA256 65e60b6289f7cc4ac0d18429fa50e870ca9f474b589e6d461ea68b903fab7fd0 +DIST opendnssec-1.3.0rc2.tar.gz 1668777 RMD160 d7d66029f9aade7f730b6dadd8bde5e8da560b6a SHA1 447da48b4a56987ec3320e2ddc2839c2c14de86a SHA256 f4bf47f6007b2047915291002c52955dd508797276119d7bc4897e257b4ae23b +EBUILD opendnssec-1.3.0_rc2.ebuild 5147 RMD160 9543fb09be97b62f0a875fcdc0ebbe6da95c46b1 SHA1 cf96a51f1e4adb72760c572d83a2158cea6f4798 SHA256 18185df889519e9c2169dcafdd1a4b23be5d86296f579d8215a714a4780f7142 +MISC ChangeLog 653 RMD160 8e4b079d982c0b6bfeeb48cfd04fbc05fe29c2bb SHA1 463ed4e6a56a3642512435e4e742de0c443610a0 SHA256 090905f62adee3601546c28e1ab151494011656431369dd8855bb07b35b729df +MISC metadata.xml 949 RMD160 5e7a1c1a843c39419fb93f3edecc35bdbc9a7fdc SHA1 b956cada0576409d10708d3cdf473d84ac89d4e2 SHA256 615711bce50ebc27af5a97dbab4a01c17f0e9370b9a6d801e4561975eceea905 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (GNU/Linux) + +iEYEARECAAYFAk3ngWIACgkQHB6c3gNBRYehAwCfQzZOgyuNK/DDaeJBj/sT+1ob +ygUAn2K2wvQV2I9aUHH/Hj1d8yWfZ1Cu +=DqwS +-----END PGP SIGNATURE----- diff --git a/net-dns/opendnssec/files/opendnssec-drop-privileges.patch b/net-dns/opendnssec/files/opendnssec-drop-privileges.patch new file mode 100644 index 000000000000..7c9f72355d20 --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec-drop-privileges.patch @@ -0,0 +1,43 @@ +Index: conf/conf.xml.in +=================================================================== +--- conf/conf.xml.in (revision 3022) ++++ conf/conf.xml.in (working copy) +@@ -38,12 +38,10 @@ + </Common> + + <Enforcer> +-<!-- + <Privileges> + <User>opendnssec</User> + <Group>opendnssec</Group> + </Privileges> +---> + + <Datastore><SQLite>@OPENDNSSEC_STATE_DIR@/kasp.db</SQLite></Datastore> + <Interval>PT3600S</Interval> +@@ -56,12 +54,10 @@ + </Enforcer> + + <Signer> +-<!-- + <Privileges> + <User>opendnssec</User> + <Group>opendnssec</Group> + </Privileges> +---> + + <WorkingDirectory>@OPENDNSSEC_STATE_DIR@/tmp</WorkingDirectory> + <WorkerThreads>8</WorkerThreads> +@@ -80,12 +76,10 @@ + </Signer> + + <Auditor> +-<!-- + <Privileges> + <User>opendnssec</User> + <Group>opendnssec</Group> + </Privileges> +---> + + <WorkingDirectory>@OPENDNSSEC_STATE_DIR@/tmp</WorkingDirectory> + </Auditor> diff --git a/net-dns/opendnssec/files/opendnssec-fix-localstatedir.patch b/net-dns/opendnssec/files/opendnssec-fix-localstatedir.patch new file mode 100644 index 000000000000..3958c6c70ccf --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec-fix-localstatedir.patch @@ -0,0 +1,32 @@ +diff -urN opendnssec-1.3.0rc2.old/Makefile.am opendnssec-1.3.0rc2/Makefile.am +--- opendnssec-1.3.0rc2.old/Makefile.am 2011-06-02 13:48:56.000000000 +0200 ++++ opendnssec-1.3.0rc2/Makefile.am 2011-06-02 13:49:19.000000000 +0200 +@@ -31,11 +31,11 @@ + + install-data-hook: + $(INSTALL) -d $(DESTDIR)$(localstatedir) +- $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec +- $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/tmp +- $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/signconf +- $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/unsigned +- $(INSTALL) -d $(DESTDIR)$(localstatedir)/opendnssec/signed ++ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/opendnssec ++ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/opendnssec/tmp ++ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/opendnssec/signconf ++ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/opendnssec/unsigned ++ $(INSTALL) -d $(DESTDIR)$(localstatedir)/lib/opendnssec/signed + $(INSTALL) -d $(DESTDIR)$(localstatedir)/run + $(INSTALL) -d $(DESTDIR)$(localstatedir)/run/opendnssec + +diff -urN opendnssec-1.3.0rc2.old/m4/opendnssec_common.m4 opendnssec-1.3.0rc2/m4/opendnssec_common.m4 +--- opendnssec-1.3.0rc2.old/m4/opendnssec_common.m4 2011-06-02 13:48:56.000000000 +0200 ++++ opendnssec-1.3.0rc2/m4/opendnssec_common.m4 2011-06-02 13:49:36.000000000 +0200 +@@ -18,7 +18,7 @@ + OPENDNSSEC_LIBEXEC_DIR=$full_libexecdir/opendnssec + OPENDNSSEC_DATA_DIR=$full_datadir/opendnssec + OPENDNSSEC_SYSCONF_DIR=$full_sysconfdir/opendnssec +-OPENDNSSEC_LOCALSTATE_DIR="$full_localstatedir/opendnssec" ++OPENDNSSEC_LOCALSTATE_DIR="$full_localstatedir/lib/opendnssec" + OPENDNSSEC_PID_DIR="$full_localstatedir/run/opendnssec" + + AC_SUBST([OPENDNSSEC_BIN_DIR]) diff --git a/net-dns/opendnssec/files/opendnssec-rename-test.patch b/net-dns/opendnssec/files/opendnssec-rename-test.patch new file mode 100644 index 000000000000..39ef26248519 --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec-rename-test.patch @@ -0,0 +1,11 @@ +--- a/conf/Makefile.am ++++ b/conf/Makefile.am +@@ -27,7 +27,7 @@ SUFFIXES = .rng .rnc .xml + (echo "java is required for converting RelaxNG Compact to RelaxNG"; false) + ${TRANG} $< $@ + +-regress: $(RNG) ++check: $(RNG) + @test -x ${XMLLINT} || \ + (echo "xmllint is required for regression tests"; false) + @for i in ${XML}; do \ diff --git a/net-dns/opendnssec/files/opendnssec-use-system-trang.patch b/net-dns/opendnssec/files/opendnssec-use-system-trang.patch new file mode 100644 index 000000000000..967b3bbdca7e --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec-use-system-trang.patch @@ -0,0 +1,30 @@ +--- a/conf/Makefile.am ++++ b/conf/Makefile.am +@@ -7,7 +7,7 @@ RNG = conf.rng kasp.rng zonelist.rng sig + XML = conf.xml kasp.xml zonelist.xml signconf.xml zonefetch.xml + XSL= kasp2html.xsl + +-TRANG= $(srcdir)/trang/trang.jar ++TRANG= /usr/bin/trang + + sysconfdir = @sysconfdir@/opendnssec + datadir = @datadir@/opendnssec +@@ -16,9 +16,6 @@ noinst_DATA = ${XML} ${XSL} + + dist_data_DATA = ${RNG} ${RNC} ${XSL} + +-EXTRA_DIST = ${TRANG} \ +- $(srcdir)/trang/copying.txt +- + CLEANFILES =+ *.xml + DISTCLEANFILES =+ *.rng + +@@ -28,7 +25,7 @@ SUFFIXES = .rng .rnc .xml + .rnc.rng: + @test -x ${JAVA} || \ + (echo "java is required for converting RelaxNG Compact to RelaxNG"; false) +- ${JAVA} -jar ${TRANG} $< $@ ++ ${TRANG} $< $@ + + regress: $(RNG) + @test -x ${XMLLINT} || \ diff --git a/net-dns/opendnssec/files/opendnssec.confd b/net-dns/opendnssec/files/opendnssec.confd new file mode 100644 index 000000000000..d019e280cf70 --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec.confd @@ -0,0 +1,14 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/opendnssec/files/opendnssec.confd,v 1.1 2011/06/02 12:26:27 scarabeus Exp $ + +# Variables containing default binaries used in the opendnssec +# initscript. You can alter them to another applications/paths +# if required. + +CHECKCONF_BIN=/usr/bin/ods-kaspcheck +CONTROL_BIN=/usr/sbin/ods-control +ENFORCER_BIN=/usr/sbin/ods-enforcerd +SIGNER_BIN=/usr/sbin/ods-signerd +EPPCLIENT_BIN=/usr/sbin/eppclientd +EPPCLIENT_PIDFILE=/var/lib/run/opendnssec/eppclientd.pid diff --git a/net-dns/opendnssec/files/opendnssec.initd b/net-dns/opendnssec/files/opendnssec.initd new file mode 100644 index 000000000000..8b14ac2333ff --- /dev/null +++ b/net-dns/opendnssec/files/opendnssec.initd @@ -0,0 +1,91 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/opendnssec/files/opendnssec.initd,v 1.1 2011/06/02 12:26:27 scarabeus Exp $ + +description="An open-source turn-key solution for DNSSEC" + +depend() { + need net + use logger +} + +checkconfig() { + if [ -x "${CHECKCONFIG_BIN}" ]; then + output=$(${CHECKCONFIG_BIN} 2>&1| grep -v -E "^/etc/opendnssec/(conf|kasp).xml validates") + if [ -n "$output" ]; then + echo $output + fi + + errors=$(echo $output | grep ERROR | wc -l) + if [ $errors -gt 0 ]; then + ewarn "$errors error(s) found in OpenDNSSEC configuration." + fi + return $errors + fi + # can't validate config, just die + return 1 +} + + +start_enforcer() { + if [ -x "${ENFORCER_BIN}" ]; then + ebegin "Starting OpenDNSSEC Enforcer" + ${CONTROL_BIN} enforcer start > /dev/null + eend $? + fi +} + +stop_enforcer() { + if [ -x "${ENFORCER_BIN}" ]; then + ebegin "Stopping OpenDNSSEC Enforcer" + ${CONTROL_BIN} enforcer stop > /dev/null + eend $? + fi +} + +start_signer() { + if [ -x "${SIGNER_BIN}" ]; then + ebegin "Starting OpenDNSSEC Signer" + ${CONTROL_BIN} signer start > /dev/null 2>&1 + eend $? + fi +} + +stop_signer() { + if [ -x "${SIGNER_BIN}" ]; then + ebegin "Stopping OpenDNSSEC Signer" + ${CONTROL_BIN} signer stop > /dev/null 2>&1 + eend $? + fi +} + +start_eppclient() { + if [ -x "${EPPCLIENT_BIN}" ]; then + ebegin "Starting OpenDNSSEC Eppclient" + start-stop-daemon --start --user opendnssec --group opendnssec --exec "${EPPCLIENT_BIN}" --pidfile "${EPPCLIENT_PIDFILE}" > /dev/null + eend $? + fi +} + +stop_eppclient() { + if [ -x "${EPPCLIENT_BIN}" ]; then + ebegin "Stopping OpenDNSSEC Eppclient" + start-stop-daemon --stop --exec "${EPPCLIENT_BIN}" --pidfile "${EPPCLIENT_PIDFILE}" > /dev/null + eend $? + fi +} + +start() { + checkconfig || return $? + start_enforcer || return $? + start_signer || return $? + start_eppclient || return $? +} + +stop() { + stop_eppclient + stop_signer + stop_enforcer + sleep 5 +} diff --git a/net-dns/opendnssec/metadata.xml b/net-dns/opendnssec/metadata.xml new file mode 100644 index 000000000000..4298d0e26286 --- /dev/null +++ b/net-dns/opendnssec/metadata.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <email>scarabeus@gentoo.org</email> + <name>Tomáš Chvátal</name> + </maintainer> + <use> + <flag name='auditor'>Enables auditing capabilities for OpenDNSSEC</flag> + <flag name='eppclient'>Enables support for automatic submission of DNSSEC keys to an upstream epp server</flag> + <flag name='signer'>Enables signing capabilities for OpenDNSSEC</flag> + <flag name='opensc'>Enables support for storing DNSSEC keys through a <pkg>dev-libs/opensc</pkg> PKCS#11 interface</flag> + <flag name='softhsm'>Enables support for storing DNSSEC keys in a <pkg>dev-libs/softhsm</pkg> PKCS#11 object</flag> + <flag name='external-hsm'>Enables support for storing DNSSEC keys through an arbitrary non-portage PKCS#11 interface, specified through an environment variable</flag> + </use> +</pkgmetadata> + diff --git a/net-dns/opendnssec/opendnssec-1.3.0_rc2.ebuild b/net-dns/opendnssec/opendnssec-1.3.0_rc2.ebuild new file mode 100644 index 000000000000..dfa8d89318fe --- /dev/null +++ b/net-dns/opendnssec/opendnssec-1.3.0_rc2.ebuild @@ -0,0 +1,185 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/opendnssec/opendnssec-1.3.0_rc2.ebuild,v 1.1 2011/06/02 12:26:28 scarabeus Exp $ + +EAPI=4 + +MY_P="${P/_}" +PKCS11_IUSE="+softhsm opensc external-hsm" +inherit base autotools multilib + +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" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="auditor +curl debug doc eppclient mysql +signer +sqlite ${PKCS11_IUSE}" + +RDEPEND=" + dev-lang/perl + dev-libs/libxml2 + dev-libs/libxslt + >=net-libs/ldns-1.6.7 + auditor? ( dev-lang/ruby[ssl] >=dev-ruby/dnsruby-1.52 ) + curl? ( net-misc/curl ) + mysql? ( + virtual/mysql + dev-perl/DBD-mysql + ) + sqlite? ( + dev-db/sqlite:3 + dev-perl/DBD-SQLite + ) +" +DEPEND="${RDEPEND} + app-text/trang + doc? ( app-doc/doxygen ) + test? ( dev-util/cunit ) +" + +REQUIRED_USE=" + ^^ ( mysql sqlite ) + ^^ ( softhsm opensc external-hsm ) + eppclient? ( curl ) +" + +PATCHES=( + "${FILESDIR}/${PN}-use-system-trang.patch" + "${FILESDIR}/${PN}-fix-localstatedir.patch" + "${FILESDIR}/${PN}-rename-test.patch" + "${FILESDIR}/${PN}-drop-privileges.patch" +) + +S="${WORKDIR}/${MY_P}" + +DOCS=( MIGRATION NEWS README ) + +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 + PKCS11_PATH=/usr/$(get_libdir)/libsofthsm.so + 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/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 "Usage of ${i} is considered experimental." + ewarn "Do not report bugs against this feature." + fi + done + + check_pkcs11_setup +} + +pkg_setup() { + enewgroup opendnssec + enewuser opendnssec -1 -1 -1 opendnssec +} + +src_prepare() { + base_src_prepare + eautoreconf +} + +src_configure() { + econf \ + --localstatedir="${EPREFIX}/var/" \ + --disable-static \ + --with-database-backend=$(use mysql && echo "mysql")$(use sqlite && echo "sqlite3") \ + --with-pkcs11-${PKCS11_LIB}=${PKCS11_PATH} \ + $(use_with curl) \ + $(use_with test cunit) \ + $(use_enable auditor) \ + $(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' -exec rm -f {} + + + # Remove subversion tags from config files to avoid useless config updates + sed -i \ + -e 's/<!-- \$Id: opendnssec-1.3.0_rc2.ebuild,v 1.1 2011/06/02 12:26:28 scarabeus Exp $ -->//g' \ + "${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} + fowners opendnssec:opendnssec /var/run/opendnssec + + # install conf/init script + newinitd "${FILESDIR}"/opendnssec.initd opendnssec + newconfd "${FILESDIR}"/opendnssec.confd 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 +} |