spf_tested_version 1.03 &&
spf_url home  'http://cr.yp.to/qmail.html' &&
spf_url watch 'http://cr.yp.to/qmail.html' &&
spf_url src   "http://cr.yp.to/software/qmail-${spf_version?}.tar.gz" &&
spf_cc_ cpp_args &&
spf_cc_ cc_args -O2 &&
spf_cc_ ld_args -s &&
spf_cc_ make_args &&
spf_cc break - \
  'This character is the user-ext delimiter. The default delimiter is -,
meaning that user joe controls joe-anything. Some system administrators
prefer + or =.' &&
spf_cc patrn 002 \
  'These stat bits are not allowed in ~ and ~/.qmail. On most systems, the
default umask is 022 or 077, so 022 will work here.

Note that ~ftp, ~www, ~uucp, etc. should be owned by root.' &&
spf_cc spawn 120 \
  "This is a silent concurrency limit. You can't set it above 255. On some
systems you can't set it above 125. qmail will refuse to compile if the
limit is too high." &&
spf_cc split 23 'This is the queue subdirectory split.' &&
spf_cc group_qmail qmail 'This is the qmail group.' &&
spf_cc group_nofiles nofiles \
  "This group should not have access to any files, but it must be
usable for processes; this requirement excludes the ``nogroup'' and
``nobody'' groups on many systems." &&
pkg_conf_user() {
  spf_cc user_"${1?}" "${2?}" \
  "The qmail system is heavily partitioned for security; it does almost
nothing as root.  This is the ${1?} user."
} &&
pkg_conf_user alias  alias &&
pkg_conf_user daemon qmaild &&
pkg_conf_user log    qmaill &&
pkg_conf_user owner  root &&
pkg_conf_user passwd qmailp &&
pkg_conf_user queue  qmailq &&
pkg_conf_user remote qmailr &&
pkg_conf_user send   qmails &&
spf_data dir alias &&
spf_data dir control &&
spf_data dir users &&
spf_own . "${spf_ccv_user_owner?}" "${spf_ccv_group_qmail?}" u+r recursive &&
spf_own alias/. "${spf_ccv_user_alias?}" "${spf_ccv_group_qmail?}" g+s &&
spf_own control/. "${spf_ccv_user_owner?}" "${spf_ccv_group_qmail?}" u+r \
  recursive &&
spf_own users/. "${spf_ccv_user_owner?}" "${spf_ccv_group_qmail?}" u+r \
  recursive &&
spf_own queue "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" 750 &&
spf_own queue/bounce "${spf_ccv_user_send?}" "${spf_ccv_group_qmail?}" 700 &&
spf_own queue/info "${spf_ccv_user_send?}" "${spf_ccv_group_qmail?}" 700 \
  recursive &&
spf_own queue/intd "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" 700 &&
spf_own queue/local "${spf_ccv_user_send?}" "${spf_ccv_group_qmail?}" 700 \
  recursive &&
spf_own queue/lock "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" 750 &&
spf_own queue/lock/sendmutex "${spf_ccv_user_send?}" \
  "${spf_ccv_group_qmail?}" 600 &&
spf_own queue/lock/tcpto "${spf_ccv_user_remote?}" "${spf_ccv_group_qmail?}" \
  644 &&
spf_own queue/lock/trigger "${spf_ccv_user_send?}" "${spf_ccv_group_qmail?}" \
  622 &&
spf_own queue/mess "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" 750 \
  recursive &&
spf_own queue/pid "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" 700 &&
spf_own queue/remote "${spf_ccv_user_send?}" "${spf_ccv_group_qmail?}" 700 \
  recursive &&
spf_own queue/todo "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" 750 &&
spf_own bin/qmail-queue "${spf_ccv_user_queue?}" "${spf_ccv_group_qmail?}" \
  u=rwxs,g=x,o=x &&
spf_do_install() {
  spf_edit 1c conf-qmail "${spf_path_prefix?}" &&
  spf_edit 1c conf-cc    "gcc ${spf_args_cpp?} ${spf_args_cc?}" &&
  spf_edit 1c conf-ld    "gcc ${spf_args_cc?} ${spf_args_ld?}" &&
  spf_edit 1c conf-break "${spf_ccv_break?}" &&
  spf_edit 1c conf-patrn "${spf_ccv_patrn?}" &&
  spf_edit 1c conf-spawn "${spf_ccv_spawn?}" &&
  spf_edit 1c conf-split "${spf_ccv_split?}" &&
  prj_echo > conf-groups "${spf_ccv_group_qmail?}
${spf_ccv_group_nofiles?}" &&
  prj_echo > conf-users "${spf_ccv_user_alias?}
${spf_ccv_user_daemon?}
${spf_ccv_user_log?}
${spf_ccv_user_owner?}
${spf_ccv_user_passwd?}
${spf_ccv_user_queue?}
${spf_ccv_user_remote?}
${spf_ccv_user_send?}" &&
  spf_hack_errno error.h &&
  prj_sedfile install.c 's:\(chown\|chmod\)(:0 \&\& &:' &&
  prj_sedfile hier.c 's:.*"man/cat.*:/*&*/:' &&
  eval "make ${spf_args_make?} default man setup" &&
  chmod -R go+rX "${spf_path_prefix?}"/. &&
  chmod +x "${spf_path_prefix?}"/bin/* "${spf_path_prefix?}"/boot/* &&
  chmod 700 \
    "${spf_path_prefix?}"/bin/qmail-lspawn \
    "${spf_path_prefix?}"/bin/qmail-newmrh \
    "${spf_path_prefix?}"/bin/qmail-newu \
    "${spf_path_prefix?}"/bin/qmail-start &&
  chmod 711 \
    "${spf_path_prefix?}"/bin/qmail-clean \
    "${spf_path_prefix?}"/bin/qmail-getpw \
    "${spf_path_prefix?}"/bin/qmail-local \
    "${spf_path_prefix?}"/bin/qmail-popup \
    "${spf_path_prefix?}"/bin/qmail-pw2u \
    "${spf_path_prefix?}"/bin/qmail-remote \
    "${spf_path_prefix?}"/bin/qmail-rspawn \
    "${spf_path_prefix?}"/bin/qmail-send \
    "${spf_path_prefix?}"/bin/splogger &&
  ./config
  ####cur_link_ /var 
}

