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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20