# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=5 inherit autotools db-use eutils user DESCRIPTION="Open source DMARC implementation " HOMEPAGE="http://www.trusteddomain.org/opendmarc/" SRC_URI="mirror://sourceforge/opendmarc/${P}.tar.gz" LICENSE="BSD" SLOT="0" KEYWORDS="~x86 ~amd64 ~hppa" DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail ) dev-perl/DBI" RDEPEND="${DEPEND} virtual/perl-Switch" pkg_setup() { enewgroup milter enewuser milter -1 -1 /var/lib/milter milter } src_configure() { econf \ --docdir="${EPREFIX}"/usr/share/doc/${PF} \ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html } src_install() { emake DESTDIR="${D}" install newinitd "${FILESDIR}/opendmarc.init" opendmarc dodir /etc/opendmarc # default configuration if [ ! -f "${ROOT}"/etc/opendmarc/opendmarc.conf ]; then less "${S}"/opendmarc/opendmarc.conf.sample \ > "${D}"/etc/opendmarc/opendmarc.conf echo UserID milter >> "${D}"/etc/opendmarc/opendmarc.conf fi } pkg_postinst() { if [[ -z ${REPLACING_VERSION} ]]; then ewarn "You need to modify the config (/etc/opendmarc/opendmarc.conf)" ewarn "to specify a PID-file." ewarn "Also, if using a UNIX socket make sure your MTA has r/w access to it." ewarn "This can be done either by setting UMask to 002 and adding MTA's user" ewarn "to milter group or you can simply set UMask to 000." fi }