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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Oct 26 12:26:05 2012 UTC (2 years, 1 month ago) by eras
Branch: MAIN
Version bump

(Portage version: 2.2.0_alpha141/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)

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

  ViewVC Help
Powered by ViewVC 1.1.20