/[gentoo-x86]/mail-filter/opendkim/opendkim-2.6.1.ebuild
Gentoo

Contents of /mail-filter/opendkim/opendkim-2.6.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jul 31 14:59:15 2012 UTC (2 years, 4 months ago) by eras
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Enable stats collection - bug #428562. Remove old

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-filter/opendkim/opendkim-2.6.1.ebuild,v 1.1 2012/06/27 19:54:30 eras Exp $
4
5 EAPI=4
6 inherit eutils db-use autotools user
7
8 # for betas
9 #MY_P=${P/_b/.B}
10 #S=${WORKDIR}/${PN}-2.0.0
11 #SRC_URI="mirror://sourceforge/opendkim/${MY_P}.tar.gz"
12
13 DESCRIPTION="A milter-based application to provide DKIM signing and verification"
14 HOMEPAGE="http://opendkim.org"
15 SRC_URI="mirror://sourceforge/opendkim/${P}.tar.gz"
16
17 LICENSE="Sendmail-Open-Source BSD"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="asyncdns +berkdb ldap lua opendbx poll sasl +ssl static-libs unbound"
21
22 # FUTURE: diffheaders (libtre error) - bug #296813
23
24 DEPEND="|| ( mail-filter/libmilter mail-mta/sendmail )
25 ssl? ( >=dev-libs/openssl-0.9.8 )
26 berkdb? ( >=sys-libs/db-3.2 )
27 opendbx? ( >=dev-db/opendbx-1.4.0 )
28 lua? ( dev-lang/lua )
29 ldap? ( net-nds/openldap )
30 sasl? ( dev-libs/cyrus-sasl )
31 unbound? ( >=net-dns/unbound-1.4.1 net-dns/dnssec-root )"
32 #diffheaders? ( dev-libs/tre )
33 #gnutls? ( >=net-libs/gnutls-2.11.7 )
34
35 RDEPEND="${DEPEND}"
36
37 REQUIRED_USE="sasl? ( ldap )"
38 #lua? ( berkdb )"
39
40 pkg_setup() {
41 enewgroup milter
42 # mail-milter/spamass-milter creates milter user with this home directory
43 # For consistency reasons, milter user must be created here with this home directory
44 # even though this package doesn't need a home directory for this user (#280571)
45 enewuser milter -1 -1 /var/lib/milter milter
46 }
47
48 src_prepare() {
49 sed -i -e 's:/var/db/dkim:/etc/opendkim:g' \
50 -e 's:/var/db/opendkim:/var/lib/opendkim:g' \
51 -e 's:/etc/mail:/etc/opendkim:g' \
52 -e 's:mailnull:milter:g' \
53 -e 's:^#[[:space:]]*PidFile.*:PidFile /var/run/opendkim/opendkim.pid:' \
54 opendkim/opendkim.conf.sample opendkim/opendkim.conf.simple.in \
55 stats/opendkim-reportstats || die
56
57 sed -i -e 's:dist_doc_DATA:dist_html_DATA:' libopendkim/docs/Makefile.am \
58 || die
59
60 eautoreconf
61 }
62
63 src_configure() {
64 local myconf
65 if use berkdb ; then
66 myconf=$(db_includedir)
67 myconf="--with-db-incdir=${myconf#-I}"
68 myconf+=" --enable-popauth"
69 myconf+=" --enable-query_cache"
70 fi
71 if use asyncdns ; then
72 if use unbound; then
73 myconf+=" --with-unbound"
74 else
75 myconf+=" --enable-arlib"
76 fi
77 else
78 myconf+=" $(use_with unbound) --disable-arlib"
79 fi
80 if use ldap; then
81 myconf+=" $(use_with sasl)"
82 fi
83 econf \
84 $(use_with berkdb db) \
85 $(use_with opendbx odbx) \
86 $(use_with lua) \
87 $(use_enable lua rbl) \
88 $(use_with ldap openldap) \
89 $(use_enable poll) \
90 $(use_enable static-libs static) \
91 ${myconf} \
92 --docdir=/usr/share/doc/${PF} \
93 --htmldir=/usr/share/doc/${PF}/html \
94 --enable-filter \
95 --enable-oversign \
96 --enable-adsp_lists \
97 --enable-dkim_reputation \
98 --enable-identity_header \
99 --enable-rate_limit \
100 --enable-redirect \
101 --enable-resign \
102 --enable-replace_rules \
103 --enable-default_sender \
104 --enable-sender_macro \
105 --enable-vbr \
106 --disable-rpath \
107 --disable-live-testing
108 #$(use_enable diffheaders)
109 }
110
111 src_install() {
112 emake DESTDIR="${D}" install
113 # file collision
114 rm -f "${D}"/usr/share/man/man3/ar.3
115
116 dosbin stats/opendkim-reportstats
117 newinitd "${FILESDIR}/opendkim.init.r2" opendkim
118 dodir /etc/opendkim /var/lib/opendkim
119 fowners milter:milter /var/lib/opendkim
120
121 # default configuration
122 if [ ! -f "${ROOT}"/etc/opendkim/opendkim.conf ]; then
123 grep ^[^#] "${S}"/opendkim/opendkim.conf.simple \
124 > "${D}"/etc/opendkim/opendkim.conf
125 if use unbound; then
126 echo TrustedAnchorFile /etc/dnssec/root-anchors.txt >> "${D}"/etc/opendkim/opendkim.conf
127 fi
128 echo UserID milter >> "${D}"/etc/opendkim/opendkim.conf
129 if use berkdb; then
130 echo Statistics /var/lib/opendkim/stats.dat >> \
131 "${D}"/etc/opendkim/opendkim.conf
132 fi
133 fi
134
135 use static-libs || find "${D}" -name "*.la" -delete
136 }
137
138 pkg_postinst() {
139 elog "If you want to sign your mail messages and need some help"
140 elog "please run:"
141 elog " emerge --config ${CATEGORY}/${PN}"
142 elog "It will help you create your key and give you hints on how"
143 elog "to configure your DNS and MTA."
144
145 ewarn "Make sure your MTA has r/w access to the socket file."
146 ewarn "This can be done either by setting UMask to 002 and adding MTA's user"
147 ewarn "to milter group or you can simply set UMask to 000."
148 }
149
150 pkg_config() {
151 local selector keysize pubkey
152
153 read -p "Enter the selector name (default ${HOSTNAME}): " selector
154 [[ -n "${selector}" ]] || selector=${HOSTNAME}
155 if [[ -z "${selector}" ]]; then
156 eerror "Oddly enough, you don't have a HOSTNAME."
157 return 1
158 fi
159 if [[ -f "${ROOT}"etc/opendkim/${selector}.private ]]; then
160 ewarn "The private key for this selector already exists."
161 else
162 einfo "Select the size of private key:"
163 einfo " [1] 512 bits"
164 einfo " [2] 1024 bits"
165 while read -n 1 -s -p " Press 1 or 2 on the keyboard to select the key size " keysize ; do
166 [[ "${keysize}" == "1" || "${keysize}" == "2" ]] && echo && break
167 done
168 case ${keysize} in
169 1) keysize=512 ;;
170 *) keysize=1024 ;;
171 esac
172
173 # generate the private and public keys
174 opendkim-genkey -b ${keysize} -D "${ROOT}"etc/opendkim/ \
175 -s ${selector} -d '(your domain)' && \
176 chown milter:milter \
177 "${ROOT}"etc/opendkim/"${selector}".private || \
178 { eerror "Failed to create private and public keys." ; return 1; }
179 chmod go-r "${ROOT}"etc/opendkim/"${selector}".private
180 fi
181
182 # opendkim selector configuration
183 echo
184 einfo "Make sure you have the following settings in your /etc/opendkim/opendkim.conf:"
185 einfo " Keyfile /etc/opendkim/${selector}.private"
186 einfo " Selector ${selector}"
187
188 # MTA configuration
189 echo
190 einfo "If you are using Postfix, add following lines to your main.cf:"
191 einfo " smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
192 einfo " non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock"
193 einfo " and read http://www.postfix.org/MILTER_README.html"
194
195 # DNS configuration
196 einfo "After you configured your MTA, publish your key by adding this TXT record to your domain:"
197 cat "${ROOT}"etc/opendkim/${selector}.txt
198 einfo "t=y signifies you only test the DKIM on your domain. See following page for the complete list of tags:"
199 einfo " http://www.dkim.org/specs/rfc4871-dkimbase.html#key-text"
200 einfo
201 einfo "Also look at the ADSP http://tools.ietf.org/html/rfc5617"
202 }

  ViewVC Help
Powered by ViewVC 1.1.20