OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.2 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../qmail/qmail.conf
  6. # Copyright (C) 2006 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. controldir="${controldir:-var/qmail/control}"
  17. sysconfdir="${sysconfdir:-var/qmail/supervise}"
  18. queuedir="${queuedir:-var/qmail/queue}"
  19. logdir="${logdir:-var/qmail/log}"
  20. if [ "$prefix_auto" == "1" ]; then
  21. prefix="var/qmail"
  22. set_confopt
  23. sysconfdir=var/qmail/supervise
  24. fi
  25. pkg_qmail_symlinks() {
  26. if [ "$1" != "$2" -a ! -e "$root/$2" ]; then
  27. set -x
  28. mkdir -vp "$root/$1"
  29. ln -vs $( echo $2 | sed -e 's,[^/]*/,../,g' | tr -d [a-z] )$1 $root/$2
  30. set +x
  31. fi
  32. }
  33. # compatibility symlinks if needed
  34. #
  35. hook_add preconf 2 'pkg_qmail_symlinks "$prefix" "var/qmail"'
  36. hook_add preconf 4 'pkg_qmail_symlinks "$controldir" "var/qmail/control"'
  37. hook_add preconf 4 'pkg_qmail_symlinks "$sysconfdir" "var/qmail/supervise"'
  38. hook_add preconf 4 'pkg_qmail_symlinks "$queuedir" "var/qmail/queue"'
  39. hook_add preconf 4 'pkg_qmail_symlinks "$logdir" "var/qmail/logs"'
  40. # the author loves to use head -1 and tail -1
  41. #
  42. hook_add preconf 5 "sed -i \
  43. -e 's,head -,head -n ,g' \
  44. -e 's,tail -,tail -n ,g' Makefile"
  45. # make setup
  46. #
  47. hook_add inmake 5 'eval "$MAKE $makeopt man"'
  48. makeinstopt=""
  49. hook_add postmake 1 './install'
  50. # install qmail's 'sendmail' wrappers
  51. #
  52. pkg_qmail_sendmailwrappers() {
  53. ln -sf /$prefix/bin/sendmail $root/usr/bin/sendmail_qmail
  54. ln -sf /$prefix/bin/qmail-qread $root/usr/bin/mailq_qmail
  55. # this is part of fastforward but fits better here
  56. ln -sf /$prefix/bin/newaliases $root/usr/bin/newaliases_qmail
  57. install_setmailer qmail
  58. }
  59. hook_add postinstall 5 'pkg_qmail_sendmailwrappers'
  60. # profile.d
  61. #
  62. pkg_qmail_profiled() {
  63. local rc=$root/var/qmail/boot/multi
  64. cat <<- EOT > $root/etc/profile.d/qmail
  65. export MANPATH=\$MANPATH:$mandir
  66. #export PATH=\$PATH:$bindir
  67. EOT
  68. if [ ! -e $rc ]; then
  69. # and multilog rc
  70. cat <<- EOT > $rc
  71. #!/bin/sh
  72. # Without logger, to use multilog outside
  73. # Using qmail-local to deliver messages according to control/defaultdelivery
  74. exec env - PATH="/$prefix/bin:\$PATH" \\
  75. qmail-start \$( cat /$controldir/defaultdelivery )
  76. EOT
  77. chmod +x $rc
  78. fi
  79. [ ! -e $root/var/qmail/rc ] && \
  80. ln -vs boot/multi $root/var/qmail/rc || true
  81. }
  82. hook_add postmake 5 'pkg_qmail_profiled'
  83. # fifo is not flisted
  84. hook_add postmake 6 'add_flist $prefix/queue/lock/trigger'
  85. createdoc=0
  86. # WARNING! Patched copies of qmail can't be re-distributed and they are unsupported
  87. #
  88. [ "$SDECFG_PKG_QMAIL_LDAP" == "1" ] && . $confdir/qmail-ldap.conf
  89. [ "$SDECFG_PKG_QMAIL_QUEUE" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p qmailqueue )"
  90. [ "$SDECFG_PKG_QMAIL_QMTP" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p qmtpc )"
  91. [ "$SDECFG_PKG_QMAIL_HOLD" == "1" ] && var_append patchfiles ' ' "$( match_source_file -p hold )"