/[gentoo-x86]/eclass/qmail.eclass
Gentoo

Diff of /eclass/qmail.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 Revision 1.8
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/qmail.eclass,v 1.7 2012/09/15 16:16:53 zmedico Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qmail.eclass,v 1.8 2013/05/27 00:59:06 robbat2 Exp $
4 4
5# @ECLASS: qmail.eclass 5# @ECLASS: qmail.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# qmail-bugs@gentoo.org 7# qmail-bugs@gentoo.org
8# @BLURB: common qmail functions 8# @BLURB: common qmail functions
63 return 1 63 return 1
64} 64}
65 65
66dospp() { 66dospp() {
67 insinto "${QMAIL_HOME}"/plugins/ 67 insinto "${QMAIL_HOME}"/plugins/
68 insopts -o root -g root -m 0755 68 insopts -o root -g "$GROUP_ROOT" -m 0755
69 newins $1 ${2:-$(basename $1)} 69 newins $1 ${2:-$(basename $1)}
70} 70}
71 71
72# @FUNCTION: dosupervise 72# @FUNCTION: dosupervise
73# @USAGE: dosupervise <service> [<runfile> <logfile>] 73# @USAGE: dosupervise <service> [<runfile> <logfile>]
76dosupervise() { 76dosupervise() {
77 local service=$1 77 local service=$1
78 local runfile=${2:-${service}} logfile=${3:-${service}-log} 78 local runfile=${2:-${service}} logfile=${3:-${service}-log}
79 [[ -z "${service}" ]] && die "no service given" 79 [[ -z "${service}" ]] && die "no service given"
80 80
81 insopts -o root -g root -m 0755 81 insopts -o root -g "$GROUP_ROOT" -m 0755
82 diropts -o root -g root -m 0755 82 diropts -o root -g "$GROUP_ROOT" -m 0755
83 83
84 dodir ${SUPERVISE_DIR}/${service}{,/log} 84 dodir ${SUPERVISE_DIR}/${service}{,/log}
85 fperms +t ${SUPERVISE_DIR}/${service}{,/log} 85 fperms +t ${SUPERVISE_DIR}/${service}{,/log}
86 86
87 insinto ${SUPERVISE_DIR}/${service} 87 insinto ${SUPERVISE_DIR}/${service}
211} 211}
212 212
213qmail_config_install() { 213qmail_config_install() {
214 einfo "Installing stock configuration files" 214 einfo "Installing stock configuration files"
215 insinto "${QMAIL_HOME}"/control 215 insinto "${QMAIL_HOME}"/control
216 insopts -o root -g root -m 644 216 insopts -o root -g "$GROUP_ROOT" -m 644
217 doins "${GENQMAIL_S}"/control/{conf-*,defaultdelivery} 217 doins "${GENQMAIL_S}"/control/{conf-*,defaultdelivery}
218 218
219 einfo "Installing configuration sanity checker and launcher" 219 einfo "Installing configuration sanity checker and launcher"
220 insinto "${QMAIL_HOME}"/bin 220 insinto "${QMAIL_HOME}"/bin
221 insopts -o root -g root -m 644 221 insopts -o root -g "$GROUP_ROOT" -m 644
222 doins "${GENQMAIL_S}"/control/qmail-config-system 222 doins "${GENQMAIL_S}"/control/qmail-config-system
223 223
224 declare -F qmail_config_install_hook >/dev/null && \ 224 declare -F qmail_config_install_hook >/dev/null && \
225 qmail_config_install_hook 225 qmail_config_install_hook
226} 226}
274 fowners alias:qmail "${i}" 274 fowners alias:qmail "${i}"
275 fi 275 fi
276 done 276 done
277 277
278 einfo "Setting up default maildirs in the account skeleton" 278 einfo "Setting up default maildirs in the account skeleton"
279 diropts -o root -g root -m 755 279 diropts -o root -g "$GROUP_ROOT" -m 755
280 insinto /etc/skel 280 insinto /etc/skel
281 insopts -o root -g root -m 644 281 insopts -o root -g "$GROUP_ROOT" -m 644
282 newins "${GENQMAIL_S}"/control/defaultdelivery .qmail.sample 282 newins "${GENQMAIL_S}"/control/defaultdelivery .qmail.sample
283 "${MAILDIRMAKE}" "${D}"/etc/skel/.maildir 283 "${MAILDIRMAKE}" "${D}"/etc/skel/.maildir
284 keepdir /etc/skel/.maildir/{cur,new,tmp} 284 keepdir /etc/skel/.maildir/{cur,new,tmp}
285 285
286 declare -F qmail_maildir_install_hook >/dev/null && \ 286 declare -F qmail_maildir_install_hook >/dev/null && \
288} 288}
289 289
290qmail_tcprules_install() { 290qmail_tcprules_install() {
291 dodir "${TCPRULES_DIR}" 291 dodir "${TCPRULES_DIR}"
292 insinto "${TCPRULES_DIR}" 292 insinto "${TCPRULES_DIR}"
293 insopts -o root -g root -m 0644 293 insopts -o root -g "$GROUP_ROOT" -m 0644
294 doins "${GENQMAIL_S}"/tcprules/Makefile.qmail 294 doins "${GENQMAIL_S}"/tcprules/Makefile.qmail
295 doins "${GENQMAIL_S}"/tcprules/tcp.qmail-* 295 doins "${GENQMAIL_S}"/tcprules/tcp.qmail-*
296 use ssl || rm -f "${D}${TCPRULES_DIR}"/tcp.qmail-pop3sd 296 use ssl || rm -f "${D}${TCPRULES_DIR}"/tcp.qmail-pop3sd
297} 297}
298 298
301 301
302 cd "${GENQMAIL_S}"/supervise 302 cd "${GENQMAIL_S}"/supervise
303 303
304 for i in qmail-{send,smtpd,qmtpd,qmqpd,pop3d}; do 304 for i in qmail-{send,smtpd,qmtpd,qmqpd,pop3d}; do
305 dosupervise ${i} 305 dosupervise ${i}
306 diropts -o qmaill -g root -m 755 306 diropts -o qmaill -g "$GROUP_ROOT" -m 755
307 keepdir /var/log/qmail/${i} 307 keepdir /var/log/qmail/${i}
308 done 308 done
309 309
310 if use ssl; then 310 if use ssl; then
311 dosupervise qmail-pop3sd 311 dosupervise qmail-pop3sd
312 diropts -o qmaill -g root -m 755 312 diropts -o qmaill -g "$GROUP_ROOT" -m 755
313 keepdir /var/log/qmail/qmail-pop3sd 313 keepdir /var/log/qmail/qmail-pop3sd
314 fi 314 fi
315 315
316 declare -F qmail_supervise_install_hook >/dev/null && \ 316 declare -F qmail_supervise_install_hook >/dev/null && \
317 qmail_supervise_install_hook 317 qmail_supervise_install_hook
318} 318}
319 319
320qmail_spp_install() { 320qmail_spp_install() {
321 einfo "Installing qmail-spp configuration files" 321 einfo "Installing qmail-spp configuration files"
322 insinto "${QMAIL_HOME}"/control/ 322 insinto "${QMAIL_HOME}"/control/
323 insopts -o root -g root -m 0644 323 insopts -o root -g "$GROUP_ROOT" -m 0644
324 doins "${GENQMAIL_S}"/spp/smtpplugins 324 doins "${GENQMAIL_S}"/spp/smtpplugins
325 325
326 einfo "Installing qmail-spp plugins" 326 einfo "Installing qmail-spp plugins"
327 keepdir "${QMAIL_HOME}"/plugins/ 327 keepdir "${QMAIL_HOME}"/plugins/
328 for i in authlog mfdnscheck ifauthnext tarpit; do 328 for i in authlog mfdnscheck ifauthnext tarpit; do
338 CRON_FOLDER=cron.daily || \ 338 CRON_FOLDER=cron.daily || \
339 CRON_FOLDER=cron.hourly 339 CRON_FOLDER=cron.hourly
340 340
341 einfo "Installing SSL Certificate creation script" 341 einfo "Installing SSL Certificate creation script"
342 insinto "${QMAIL_HOME}"/control 342 insinto "${QMAIL_HOME}"/control
343 insopts -o root -g root -m 0644 343 insopts -o root -g "$GROUP_ROOT" -m 0644
344 doins "${GENQMAIL_S}"/ssl/servercert.cnf 344 doins "${GENQMAIL_S}"/ssl/servercert.cnf
345 345
346 insinto "${QMAIL_HOME}"/bin 346 insinto "${QMAIL_HOME}"/bin
347 insopts -o root -g root -m 0755 347 insopts -o root -g "$GROUP_ROOT" -m 0755
348 doins "${GENQMAIL_S}"/ssl/mkservercert 348 doins "${GENQMAIL_S}"/ssl/mkservercert
349 349
350 einfo "Installing RSA key generation cronjob" 350 einfo "Installing RSA key generation cronjob"
351 insinto /etc/${CRON_FOLDER} 351 insinto /etc/${CRON_FOLDER}
352 insopts -o root -g root -m 0755 352 insopts -o root -g "$GROUP_ROOT" -m 0755
353 doins "${GENQMAIL_S}"/ssl/qmail-genrsacert.sh 353 doins "${GENQMAIL_S}"/ssl/qmail-genrsacert.sh
354 354
355 keepdir "${QMAIL_HOME}"/control/tlshosts 355 keepdir "${QMAIL_HOME}"/control/tlshosts
356 356
357 declare -F qmail_ssl_install_hook >/dev/null && \ 357 declare -F qmail_ssl_install_hook >/dev/null && \
358 qmail_ssl_install_hook 358 qmail_ssl_install_hook
359} 359}
360 360
361qmail_src_install() { 361qmail_src_install() {
362 export GROUP_ROOT="$(id -gn root)"
362 qmail_base_install 363 qmail_base_install
363 qmail_full_install 364 qmail_full_install
364 qmail_config_install 365 qmail_config_install
365 qmail_man_install 366 qmail_man_install
366 qmail_sendmail_install 367 qmail_sendmail_install

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20