diff options
author | Alin Năstac <mrness@gentoo.org> | 2009-03-07 14:05:40 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2009-03-07 14:05:40 +0000 |
commit | 7cd2c7a1a82a3d47fb301686fc4329856bd8b7b3 (patch) | |
tree | 01011d5f7046fafa1318174089188111d6132957 /mail-filter/dk-milter | |
parent | Fix xv being placed in multimedia category. Bug 260610 by Daniel Pielmeier (b... (diff) | |
download | gentoo-2-7cd2c7a1a82a3d47fb301686fc4329856bd8b7b3.tar.gz gentoo-2-7cd2c7a1a82a3d47fb301686fc4329856bd8b7b3.tar.bz2 gentoo-2-7cd2c7a1a82a3d47fb301686fc4329856bd8b7b3.zip |
Version bump.
(Portage version: 2.1.6.7/cvs/Linux x86_64)
Diffstat (limited to 'mail-filter/dk-milter')
-rw-r--r-- | mail-filter/dk-milter/ChangeLog | 10 | ||||
-rw-r--r-- | mail-filter/dk-milter/dk-milter-1.0.2.ebuild | 136 | ||||
-rw-r--r-- | mail-filter/dk-milter/files/dk-milter-1.0.2-as-needed.patch | 21 |
3 files changed, 165 insertions, 2 deletions
diff --git a/mail-filter/dk-milter/ChangeLog b/mail-filter/dk-milter/ChangeLog index cf525591bb9e..17343c2bb871 100644 --- a/mail-filter/dk-milter/ChangeLog +++ b/mail-filter/dk-milter/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for mail-filter/dk-milter -# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.15 2008/12/12 06:36:18 mrness Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.16 2009/03/07 14:05:40 mrness Exp $ + +*dk-milter-1.0.2 (07 Mar 2009) + + 07 Mar 2009; Alin Năstac <mrness@gentoo.org> + +files/dk-milter-1.0.2-as-needed.patch, +dk-milter-1.0.2.ebuild: + Version bump. *dk-milter-1.0.1-r1 (12 Dec 2008) diff --git a/mail-filter/dk-milter/dk-milter-1.0.2.ebuild b/mail-filter/dk-milter/dk-milter-1.0.2.ebuild new file mode 100644 index 000000000000..8626fe5cbf98 --- /dev/null +++ b/mail-filter/dk-milter/dk-milter-1.0.2.ebuild @@ -0,0 +1,136 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/dk-milter-1.0.2.ebuild,v 1.1 2009/03/07 14:05:40 mrness Exp $ + +inherit eutils toolchain-funcs + +DESCRIPTION="A milter-based application provide DomainKeys service" +HOMEPAGE="http://sourceforge.net/projects/dk-milter/" +SRC_URI="mirror://sourceforge/dk-milter/${P}.tar.gz" + +LICENSE="Sendmail-Open-Source" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ipv6" + +RDEPEND="dev-libs/openssl + >=sys-libs/db-3.2" +DEPEND="${RDEPEND} + || ( mail-filter/libmilter mail-mta/sendmail )" # libmilter is a static library + +pkg_setup() { + enewgroup milter + enewuser milter -1 -1 -1 milter +} + +src_unpack() { + unpack ${A} + + epatch "${FILESDIR}"/${P}-as-needed.patch + + local ENVDEF="" + use ipv6 && ENVDEF="${ENVDEF} -DNETINET6" + sed -e "s:@@CFLAGS@@:${CFLAGS}:" \ + -e "s:@@LDFLAGS@@:${LDFLAGS}:" \ + -e "s/@@ENVDEF@@/${ENVDEF}/" \ + "${FILESDIR}/gentoo.config.m4" > "${S}/devtools/Site/site.config.m4" \ + || die "failed to generate site.config.m4" +} + +src_compile() { + emake -j1 CC="$(tc-getCC)" || die "emake failed" +} + +src_install() { + # no other program need to read from here + dodir /etc/mail/dk-filter + fowners milter:milter /etc/mail/dk-filter + fperms 700 /etc/mail/dk-filter + + newinitd "${FILESDIR}/dk-filter.init" dk-filter \ + || die "newinitd failed" + newconfd "${FILESDIR}/dk-filter.conf" dk-filter \ + || die "newconfd failed" + + # prepare directory for .pid and .sock files + dodir /var/run/dk-filter + fowners milter:milter /var/run/dk-filter + + dodir /usr/bin + emake -j1 DESTDIR="${D}" \ + SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \ + install || die "make install failed" + + # man build is broken; do man page installation by hand + doman */*.8 + + # some people like docs + dodoc README RELEASE_NOTES KNOWNBUGS *.txt +} + +pkg_postinst() { + ewarn "DomainKeys RFC is obsoleted by DKIM and therefore you should only use" + ewarn "dk-milter for verifying mail signed with DomainKeys-Signature." + echo + elog "However, if you still want to use this in sign mode, you should run" + elog " emerge --config ${CATEGORY}/${PN}" + elog "It will help you create your key and give you hints on how" + elog "to configure your DNS and MTA." +} + +pkg_config() { + local selector pubkey + + read -p "Enter the selector name (default ${HOSTNAME}): " selector + [[ -n "${selector}" ]] || selector=${HOSTNAME} + if [[ -z "${selector}" ]]; then + eerror "Oddly enough, you don't have a HOSTNAME." + return 1 + fi + if [[ -f "${ROOT}"etc/mail/dk-filter/${selector}.private ]]; then + ewarn "The private key for this selector already exists." + else + einfo "Select the size of private key:" + einfo " [1] 512 bits" + einfo " [2] 1024 bits" + while read -n 1 -s -p " Press 1 or 2 on the keyboard to select the key size " keysize ; do + [[ "${keysize}" == "1" || "${keysize}" == "2" ]] && echo && break + done + case ${keysize} in + 1) keysize=512 ;; + *) keysize=1024 ;; + esac + + # generate the private and public keys + openssl genrsa -out "${ROOT}"etc/mail/dk-filter/${selector}.private ${keysize} && \ + chown milter:milter "${ROOT}"etc/mail/dk-filter/${selector}.private && chmod u=r,g-rwx,o-rwx "${ROOT}"etc/mail/dk-filter/${selector}.private && + openssl rsa -in "${ROOT}"etc/mail/dk-filter/${selector}.private -out "${ROOT}"etc/mail/dk-filter/${selector}.public -pubout -outform PEM || \ + { eerror "Failed to create private and public keys." ; return 1; } + fi + + # dk-filter selector configuration + echo + einfo "Make sure you add these parameters to your dk-filter command line:" + einfo " -b sv -d your-domain.com -H -s /etc/mail/dk-filter/${selector}.private -S ${selector}" + + # MTA configuration + echo + einfo "If you are using Postfix, add following lines to your main.cf:" + einfo " smtpd_milters = unix:/var/run/dk-filter/dk-filter.sock" + einfo " non_smtpd_milters = unix:/var/run/dk-filter/dk-filter.sock" + + # DNS configuration + { + local line + pubkey= + while read line; do + [[ "${line}" == "--"* ]] || pubkey="${pubkey}${line}" + done + } < "${ROOT}"etc/mail/dk-filter/${selector}.public + echo + einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:" + einfo " ${selector}._domainkey IN TXT \"g=\\; k=rsa\\; t=y\\; o=~\\; p=${pubkey}\"" + echo + einfo "t=y signifies you only test the DK on your domain." + einfo "See the DomainKeys specification for more info." +} diff --git a/mail-filter/dk-milter/files/dk-milter-1.0.2-as-needed.patch b/mail-filter/dk-milter/files/dk-milter-1.0.2-as-needed.patch new file mode 100644 index 000000000000..e49e3b5e03fe --- /dev/null +++ b/mail-filter/dk-milter/files/dk-milter-1.0.2-as-needed.patch @@ -0,0 +1,21 @@ +diff -Nru dk-milter-1.0.2.orig/devtools/M4/UNIX/defines.m4 dk-milter-1.0.2/devtools/M4/UNIX/defines.m4 +--- dk-milter-1.0.2.orig/devtools/M4/UNIX/defines.m4 2006-10-06 05:44:44.000000000 +0000 ++++ dk-milter-1.0.2/devtools/M4/UNIX/defines.m4 2009-03-07 14:02:10.000000000 +0000 +@@ -26,7 +26,7 @@ + CCLINK = ifdef(`confCCLINK', `confCCLINK', `confCC') + # Linker for libraries + LD= ifdef(`confLD', `confLD', `confCC') +-LDOPTS= ifdef(`confLDOPTS', `confLDOPTS') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `') ++LDOPTS= ifdef(`confLDOPTS', `confLDOPTS') + LDOPTS_SO= ${LDOPTS} ifdef(`confLDOPTS_SO', `confLDOPTS_SO', `-shared') + + # Shell +@@ -68,7 +68,7 @@ + LIBDIRS=confLIBDIRS + + # Additional libs needed +-LIBADD= ifdef(`conf_'bldCURRENT_PRD`_LIBS', `conf_'bldCURRENT_PRD`_LIBS') ++LIBADD= ifdef(`conf_'bldCURRENT_PRD`_LIBS', `conf_'bldCURRENT_PRD`_LIBS') ifdef(`confMT', ifdef(`confMTLDOPTS', `confMTLDOPTS', `'), `') + + # libraries required on your system + LIBS= ${LIBADD} ifdef(`confLIBS', `confLIBS') ifdef(`conf_'bldCURRENT_PRD`_LIB_POST', `conf_'bldCURRENT_PRD`_LIB_POST') |