/[gentoo-x86]/mail-mta/qmail-ldap/qmail-ldap-1.03-r2.ebuild
Gentoo

Contents of /mail-mta/qmail-ldap/qmail-ldap-1.03-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Sat Jun 16 13:48:10 2007 UTC (12 years, 4 months ago) by hollow
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
sync with netqmail-1.05-r8 ebuild; fix #62734, #65456, #82089, #97957, #125162 and hopefully #83092; old versions are completely broken, therefore removed
(Portage version: 2.1.2.9)

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-mta/qmail-ldap/qmail-ldap-1.03-r2.ebuild,v 1.9 2007/03/18 06:07:51 genone Exp $
4
5 IUSE="ssl"
6
7 inherit eutils
8
9 S=${WORKDIR}/qmail-${PV}
10
11 DESCRIPTION="A modern replacement for sendmail which uses maildirs"
12 HOMEPAGE="http://www.qmail.org/
13 http://www.jedi.claranet.fr/qmail-tuning.html
14 http://iain.cx/unix/qmail/mysql.php
15 http://www.nrg4u.com/"
16 SRC_URI="mirror://qmail/qmail-1.03.tar.gz
17 http://www.suspectclass.com/~sgifford/qmail/qmail-0.0.0.0.patch
18 http://david.acz.org/software/sendmail-flagf.patch
19 http://www.nrg4u.com/qmail/qmail-ldap-1.03-20040101.patch.gz
20 mirror://gentoo/${P}-r2-tls.patch.bz2"
21
22 DEPEND="virtual/libc
23 net-nds/openldap
24 sys-apps/groff
25 >=sys-apps/ucspi-tcp-0.88
26 >=net-mail/checkpassword-0.90
27 >=net-nds/openldap-2.0.25-r2
28 ssl? ( >=dev-libs/openssl-0.9.6e )"
29
30 RDEPEND="!virtual/mta
31 virtual/libc
32 sys-apps/groff
33 >=net-nds/openldap-2.0.25-r2
34 >=sys-apps/ucspi-tcp-0.88
35 >=sys-process/daemontools-0.76-r1
36 >=net-mail/checkpassword-0.90
37 >=net-mail/dot-forward-0.71"
38
39 PROVIDE="virtual/mta
40 virtual/mda"
41
42 SLOT="0"
43 LICENSE="as-is"
44 KEYWORDS="~x86 ~ppc ~sparc"
45
46 src_unpack() {
47
48 unpack qmail-1.03.tar.gz
49
50 unpack qmail-ldap-1.03-20040101.patch.gz
51
52 cd ${S}
53
54 #main ldap patch
55 #includes : qmail-queue patch | big todo | errno
56 #qmail-103.patch | qmail-local-tabs.patch | big-concurrency.patch
57 epatch ${WORKDIR}/qmail-ldap-1.03-20040101.patch || die "ldap patch failed"
58
59 #define 0.0.0.0 as local system/network
60 epatch ${DISTDIR}/qmail-0.0.0.0.patch || die "0.0.0.0 patch did not apply"
61
62 #FIXNE
63 # AUTOHOME DIR MAKE AND FEATURES PATCH
64 epatch ${FILESDIR}/gentoo.patch || die "Homedir patch did not apply"
65
66 # Account for Linux filesystems lack of a synchronus link()
67 epatch ${FILESDIR}/qmail-link-sync-gentoo.patch
68
69 # make the qmail 'sendmail' binary behave like sendmail's for -f
70 epatch ${DISTDIR}/sendmail-flagf.patch
71
72 # This will make the emails headers be written in localtime rather than GMT
73 # If you really want, uncomment it yourself, as mail really should be in GMT
74 #epatch ${DISTDIR}/qmail-date-localtime.patch.txt
75
76 if use ssl; then
77 epatch ${DISTDIR}/${P}-r2-tls.patch.bz2 || die "tls+auth patch failed"
78 fi
79
80 echo "gcc ${CFLAGS}" > conf-cc
81 echo "gcc" > conf-ld
82 echo "500" > conf-spawn
83
84 }
85
86 src_compile() {
87
88 cd ${S}
89 emake it man ldap|| die
90 }
91
92
93
94 src_install() {
95
96 cd ${S}
97
98 einfo "Setting up directory hierarchy ..."
99
100 diropts -m 755 -o root -g qmail
101 dodir /var/qmail
102
103 for i in bin boot control
104 do
105 dodir /var/qmail/${i}
106 done
107
108 keepdir /var/qmail/users
109
110 diropts -m 755 -o alias -g qmail
111 dodir /var/qmail/alias
112
113 einfo "Installing the qmail software ..."
114
115 insopts -o root -g qmail -m 755
116 insinto /var/qmail/boot
117 doins home home+df proc proc+df binm1 binm1+df binm2 binm2+df binm3 binm3+df
118
119 into /usr
120 dodoc ${FILESDIR}/${PV}-${PR}/samples.ldif
121 dodoc FAQ UPGRADE SENDMAIL INSTALL* TEST* REMOVE* PIC* SECURITY
122 dodoc SYSDEPS TARGETS THANKS THOUGHTS TODO VERSION
123
124 insopts -o qmailq -g qmail -m 4711
125 insinto /var/qmail/bin
126 doins qmail-queue qmail-queue
127
128 insopts -o root -g qmail -m 700
129 insinto /var/qmail/bin
130 doins qmail-lspawn qmail-start qmail-newu qmail-newmrh
131
132 insopts -o root -g qmail -m 711
133 insinto /var/qmail/bin
134 doins qmail-getpw qmail-local qmail-remote qmail-rspawn \
135 qmail-clean qmail-send splogger qmail-pw2u
136
137 insopts -o root -g qmail -m 755
138 insinto /var/qmail/bin
139 doins qmail-inject predate datemail mailsubj qmail-showctl \
140 qmail-qread qmail-qstat qmail-tcpto qmail-tcpok qmail-pop3d \
141 qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd qmail-smtpd \
142 sendmail tcp-env qreceipt qsmhook qbiff forward preline \
143 condredirect bouncesaying except maildirmake maildir2mbox \
144 maildirwatch qail elq pinq config-fast auth_imap auth_pop \
145 auth_smtp dirmaker qmail-ldaplookup qmail-todo
146
147 into /usr
148 for i in *.1 *.5 *.8
149 do
150 doman $i
151 done
152
153 einfo "Creating sendmail replacement ..."
154 diropts -m 755
155 dodir /usr/sbin /usr/lib
156 dosym /var/qmail/bin/sendmail /usr/sbin/sendmail
157 dosym /var/qmail/bin/sendmail /usr/lib/sendmail
158
159 einfo "Setting up the default aliases ..."
160 diropts -m 700 -o alias -g qmail
161 if [ ! -d ${ROOT}/var/qmail/alias/.maildir ] ; then
162 dodir /var/qmail/alias/.maildir
163 for i in cur new tmp
164 do
165 dodir /var/qmail/alias/.maildir/$i
166 done
167 fi
168
169 for i in mailer-daemon postmaster root
170 do
171 touch ${D}/var/qmail/alias/.qmail-${i}
172 fowners alias.qmail /var/qmail/alias/.qmail-${i}
173 done
174
175 einfo "Setting up maildirs by default in the account skeleton ..."
176 diropts -m 755 -o root -g root
177 insinto /etc/skel
178 ${D}/var/qmail/bin/maildirmake ${D}/etc/skel/.maildir
179 newins ${FILESDIR}/dot_qmail .qmail
180 fperms 644 /etc/skel/.qmail
181 insinto /root
182 ${D}/var/qmail/bin/maildirmake ${D}/root/.maildir
183 newins ${FILESDIR}/dot_qmail .qmail
184 fperms 644 /root/.qmail
185
186 einfo "Setting up daemontools ..."
187 insopts -o root -g root -m 755
188 diropts -m 755 -o root -g root
189 dodir /var/qmail/supervise
190 dodir /var/qmail/supervise/qmail-send
191 dodir /var/qmail/supervise/qmail-send/log
192 dodir /var/qmail/supervise/qmail-smtpd
193 dodir /var/qmail/supervise/qmail-smtpd/log
194 dodir /var/qmail/supervise/qmail-pop3d
195 dodir /var/qmail/supervise/qmail-pop3d/log
196 chmod +t ${D}/var/qmail/supervise/qmail-send
197 chmod +t ${D}/var/qmail/supervise/qmail-smtpd
198 chmod +t ${D}/var/qmail/supervise/qmail-pop3d
199 diropts -m 755 -o qmaill
200 keepdir /var/log/qmail /var/log/qmail/qmail-send /var/log/qmail/qmail-smtpd /var/log/qmail/qmail-pop3d
201
202 insinto /var/qmail/supervise/qmail-send
203 newins ${FILESDIR}/supervise/run-qmailsend run
204 insinto /var/qmail/supervise/qmail-send/log
205 newins ${FILESDIR}/supervise/run-qmailsendlog run
206 insinto /var/qmail/supervise/qmail-smtpd
207 newins ${FILESDIR}/supervise/run-qmailsmtpd run
208 insinto /var/qmail/supervise/qmail-smtpd/log
209 newins ${FILESDIR}/supervise/run-qmailsmtpdlog run
210 insinto /var/qmail/supervise/qmail-pop3d
211 newins ${FILESDIR}/supervise/run-qmailpop3d run
212 insinto /var/qmail/supervise/qmail-pop3d/log
213 newins ${FILESDIR}/supervise/run-qmailpop3dlog run
214
215 einfo "Installing the qmail control file ..."
216 exeinto /var/qmail/bin
217 doexe ${FILESDIR}/qmail-control
218
219 einfo "Installing the qmail startup file ..."
220 insinto /var/qmail
221 doins ${FILESDIR}/rc \
222
223 einfo "Installing the qmail configuration file ..."
224 insinto /var/qmail/control
225 insopts -o root -g root -m 644
226 doins ${FILESDIR}/control/defaultdomain \
227 ${FILESDIR}/control/defaulthost \
228 ${FILESDIR}/control/dirmaker \
229 ${FILESDIR}/control/ldapbasedn \
230 ${FILESDIR}/control/ldapgid \
231 ${FILESDIR}/control/ldaplocaldelivery \
232 ${FILESDIR}/control/ldaplogin \
233 ${FILESDIR}/control/ldapmessagestore \
234 ${FILESDIR}/control/ldapserver \
235 ${FILESDIR}/control/ldapuid \
236 ${FILESDIR}/control/qmail-pop3d-loglevel \
237 ${FILESDIR}/control/qmail-pop3d-softlimit \
238 ${FILESDIR}/control/qmail-smtpd-softlimit \
239 ${FILESDIR}/control/qmail-start-loglevel
240
241 insopts -o qmaild -g root -m 600
242 insinto /var/qmail/control
243 doins ${FILESDIR}/control/ldappassword
244
245 einfo "Installing the qmail.schema ..."
246 insinto /etc/openldap/schema
247 doins qmail.schema
248 }
249
250 pkg_postinst() {
251
252 einfo "Setting up the message queue hierarchy ..."
253
254 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue
255 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo
256 install -d -m 700 -o qmailq -g qmail ${ROOT}/var/qmail/queue/pid
257 install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/bounce
258 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess
259
260 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
261 do
262 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/mess/${i}
263 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/todo/${i}
264 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/intd/${i}
265 done
266
267 for i in info local remote
268 do
269 install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/${i}
270 done
271
272 for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
273 do
274 install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/info/${i}
275 install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/local/${i}
276 install -d -m 700 -o qmails -g qmail ${ROOT}/var/qmail/queue/remote/${i}
277 done
278
279 install -d -m 750 -o qmailq -g qmail ${ROOT}/var/qmail/queue/lock
280
281 dd if=/dev/zero of=${ROOT}/var/qmail/queue/lock/tcpto bs=1024 count=1
282 chmod 644 ${ROOT}/var/qmail/queue/lock/tcpto
283 chown qmailr:qmail ${ROOT}/var/qmail/queue/lock/tcpto
284
285 touch ${ROOT}/var/qmail/queue/lock/sendmutex
286 chmod 600 ${ROOT}/var/qmail/queue/lock/sendmutex
287 chown qmails:qmail ${ROOT}/var/qmail/queue/lock/sendmutex
288
289 if [ ! -p ${ROOT}/var/qmail/queue/lock/trigger ] ; then
290 mkfifo ${ROOT}/var/qmail/queue/lock/trigger
291 chmod 622 ${ROOT}/var/qmail/queue/lock/trigger
292 chown qmails:qmail ${ROOT}/var/qmail/queue/lock/trigger
293 fi
294
295 if [ `getent passwd ldapauth | cut -d: -f1` != ldapauth ]; then
296 useradd -g ldapauth -d /var/qmail/maildirs -s /bin/true -u 11184 ldapauth
297 fi
298
299 if [ `getent group ldapauth | cut -d: -f1` != ldapauth ]; then
300 groupadd ldapauth &>/dev/null
301 fi
302
303 elog "Please do not forget to run, the following syntax :\033[0m"
304 elog "emerge --config =${PF}"
305 elog "This will setup qmail to run out-of-the-box on your system."
306 elog
307 elog "To start qmail at boot you have to enable the /etc/init.d/svscan rc file"
308 elog "and create the following links :"
309 elog "ln -s /var/qmail/supervise/qmail-send /service/qmail-send"
310 elog "ln -s /var/qmail/supervise/qmail-smtpd /service/qmail-smtpd"
311 elog "ln -s /var/qmail/supervise/qmail-pop3d /service/qmail-pop3d"
312 elog
313 elog "NOTE: Please check your /var/qmail/control/ldap* files to match your local"
314 elog "ldap settings and add the qmail.schema along with \"allow bind_v2\" to your"
315 elog "slapd.conf. For sample ldifs, please check"
316 elog "/usr/share/doc/${PF}/samples.ldif.gz"
317
318 if use ssl; then
319 einfo "Creating a self-signed ssl-cert:"
320 /usr/bin/openssl req -new -x509 -nodes -out /var/qmail/control/servercert.pem -days 366 -keyout /var/qmail/control/servercert.pem
321 chmod 640 /var/qmail/control/servercert.pem
322 chown qmaild:qmail /var/qmail/control/servercert.pem
323 ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem
324
325 elog "If You want to have a signed cert, do the following:"
326 elog "openssl req -new -nodes -out req.pem \\"
327 elog "-keyout /var/qmail/control/servercert.pem"
328 elog "chmod 640 /var/qmail/control/servercert.pem"
329 elog "chown qmaild:qmail /var/qmail/control/servercert.pem"
330 elog "ln -s /var/qmail/control/servercert.pem /var/qmail/control/clientcert.pem"
331 elog "Send req.pem to your CA to obtain signed_req.pem, and do:"
332 elog "cat signed_req.pem >> /var/qmail/control/servercert.pem"
333 fi
334
335 }
336
337 pkg_config() {
338
339 export qhost=`hostname`
340 if [ ${ROOT} = "/" ] ; then
341 if [ ! -f ${ROOT}/var/qmail/control/me ] ; then
342 ${ROOT}/var/qmail/bin/config-fast $qhost
343 fi
344 fi
345
346 echo "Accepting relaying by default from all ips configured on this machine."
347 LOCALIPS=`/sbin/ifconfig | grep inet | cut -d " " -f 12 -s | cut -b 6-20`
348 for ip in $LOCALIPS; do
349 echo "$ip:allow,RELAYCLIENT=\"\",RBLSMTPD=\"\"" >> /etc/tcp.smtp
350 done
351 echo "127.0.0.1:allow,RELAYCLIENT=\"\",RBLSMTPD=\"\"" >> /etc/tcp.smtp
352
353 tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
354
355 }

  ViewVC Help
Powered by ViewVC 1.1.20