/[gentoo-x86]/mail-filter/dkim-milter/dkim-milter-2.4.2.ebuild
Gentoo

Contents of /mail-filter/dkim-milter/dkim-milter-2.4.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jan 29 18:29:26 2008 UTC (6 years, 7 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Remove libmilter atom from run-time dependencies.
(Portage version: 2.1.3.19)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-filter/dkim-milter/dkim-milter-2.4.2.ebuild,v 1.2 2008/01/06 03:38:03 mrness Exp $
4
5 inherit eutils toolchain-funcs
6
7 DESCRIPTION="A milter-based application to provide DomainKeys Identified Mail (DKIM) service"
8 HOMEPAGE="http://sourceforge.net/projects/dkim-milter/"
9 SRC_URI="mirror://sourceforge/dkim-milter/${P}.tar.gz"
10
11 LICENSE="Sendmail-Open-Source"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="ipv6 diffheaders"
15
16 RDEPEND="dev-libs/openssl
17 >=sys-libs/db-3.2
18 || ( mail-filter/libmilter mail-mta/sendmail )
19 diffheaders? ( dev-libs/tre )"
20 DEPEND="${RDEPEND}"
21
22 pkg_setup() {
23 enewgroup milter
24 enewuser milter -1 -1 -1 milter
25 }
26
27 src_unpack() {
28 unpack ${A}
29
30 cd "${S}" || die "source dir not found"
31
32 cp site.config.m4.dist devtools/Site/site.config.m4 || \
33 die "failed to copy site.config.m4"
34 epatch "${FILESDIR}/${P}-gentoo.patch"
35
36 local ENVDEF=""
37 use ipv6 && ENVDEF="${ENVDEF} -DNETINET6"
38 sed -i -e "s:@@CFLAGS@@:${CFLAGS}:" -e "s:@@ENVDEF@@:${ENVDEF}:" \
39 devtools/Site/site.config.m4
40 echo "APPENDDEF(\`confNO_MAN_BUILD', \` ')">>devtools/Site/site.config.m4
41
42 use diffheaders && epatch "${FILESDIR}/${PN}-diffheaders.patch"
43 }
44
45 src_compile() {
46 emake -j1 CC="$(tc-getCC)" || die "emake failed"
47 }
48
49 src_test() {
50 emake -j1 CC="$(tc-getCC)" OPTIONS=check \
51 || die "emake check failed"
52 }
53
54 src_install() {
55 # no other program need to read from here
56 dodir /etc/mail/dkim-filter
57 fowners milter:milter /etc/mail/dkim-filter
58 fperms 700 /etc/mail/dkim-filter
59
60 insinto /etc/mail/dkim-filter
61 newins dkim-filter/dkim-filter.conf.sample dkim-filter.conf
62
63 newinitd "${FILESDIR}/dkim-filter-2.4.1-init" dkim-filter \
64 || die "newinitd failed"
65
66 # prepare directory for .pid, .sock and .stats files
67 dodir /var/run/dkim-filter
68 fowners milter:milter /var/run/dkim-filter
69
70 dodir /usr/bin
71 emake -j1 DESTDIR="${D}" \
72 SBINOWN=root SBINGRP=root UBINOWN=root UBINGRP=root \
73 install || die "make install failed"
74
75 # man build is broken; do man page installation by hand
76 doman */*.{3,5,8}
77
78 # some people like docs
79 dodoc RELEASE_NOTES *.txt
80 }
81
82 pkg_postinst() {
83 elog "If you want to sign your mail messages, you will have to run"
84 elog " emerge --config ${CATEGORY}/${PN}"
85 elog "It will help you create your key and give you hints on how"
86 elog "to configure your DNS and MTA."
87
88 ewarn "Make sure your MTA has r/w access to the socket file."
89 ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
90 ewarn "to milter group or you can simply set UMask to 000."
91 }
92
93 pkg_config() {
94 local selector keysize pubkey
95
96 read -p "Enter the selector name (default ${HOSTNAME}): " selector
97 [[ -n "${selector}" ]] || selector=${HOSTNAME}
98 if [[ -z "${selector}" ]]; then
99 eerror "Oddly enough, you don't have a HOSTNAME."
100 return 1
101 fi
102 if [[ -f "${ROOT}"etc/mail/dkim-filter/${selector}.private ]]; then
103 ewarn "The private key for this selector already exists."
104 else
105 einfo "Select the size of private key:"
106 einfo " [1] 512 bits"
107 einfo " [2] 1024 bits"
108 while read -n 1 -s -p " Press 1 or 2 on the keyboard to select the key size " keysize ; do
109 [[ "${keysize}" == "1" || "${keysize}" == "2" ]] && echo && break
110 done
111 case ${keysize} in
112 1) keysize=512 ;;
113 *) keysize=1024 ;;
114 esac
115
116 # generate the private and public keys
117 dkim-genkey -b ${keysize} -D "${ROOT}"etc/mail/dkim-filter/ \
118 -s ${selector} && \
119 chown milter:milter \
120 "${ROOT}"etc/mail/dkim-filter/"${selector}".private || \
121 { eerror "Failed to create private and public keys." ; return 1; }
122 fi
123
124 # dkim-filter selector configuration
125 echo
126 einfo "Make sure you have the following settings in your dkim-filter.conf:"
127 einfo " Keyfile /etc/mail/dkim-filter/${selector}.private"
128 einfo " Selector ${selector}"
129
130 # MTA configuration
131 echo
132 einfo "If you are using Postfix, add following lines to your main.cf:"
133 einfo " smtpd_milters = unix:/var/run/dkim-filter/dkim-filter.sock"
134 einfo " non_smtpd_milters = unix:/var/run/dkim-filter/dkim-filter.sock"
135
136 # DNS configuration
137 einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
138 cat "${ROOT}"etc/mail/dkim-filter/${selector}.txt
139 einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
140 einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
141 einfo
142 einfo "Also look at the draft SSP http://www.dkim.org/specs/draft-ietf-dkim-ssp-01.html"
143 }

  ViewVC Help
Powered by ViewVC 1.1.20