msmtp-1.6.6.ebuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit multilib
  5. DESCRIPTION="An SMTP client and SMTP plugin for mail user agents such as Mutt"
  6. HOMEPAGE="http://msmtp.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/msmtp/${P}.tar.xz"
  8. LICENSE="GPL-3"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
  11. IUSE="doc gnutls idn libressl libsecret +mta nls sasl ssl vim-syntax"
  12. CDEPEND="
  13. idn? ( net-dns/libidn )
  14. libsecret? ( app-crypt/libsecret )
  15. nls? ( virtual/libintl )
  16. sasl? ( virtual/gsasl )
  17. ssl? (
  18. gnutls? ( net-libs/gnutls )
  19. !gnutls? (
  20. !libressl? ( dev-libs/openssl:0= )
  21. libressl? ( dev-libs/libressl:0= )
  22. )
  23. )
  24. "
  25. RDEPEND="${CDEPEND}
  26. net-mail/mailbase
  27. mta? (
  28. !mail-mta/courier
  29. !mail-mta/esmtp
  30. !mail-mta/exim
  31. !mail-mta/mini-qmail
  32. !mail-mta/netqmail
  33. !mail-mta/nullmailer
  34. !mail-mta/postfix
  35. !mail-mta/qmail-ldap
  36. !mail-mta/sendmail
  37. !mail-mta/opensmtpd
  38. !<mail-mta/ssmtp-2.64-r2
  39. !>=mail-mta/ssmtp-2.64-r2[mta]
  40. )
  41. "
  42. DEPEND="${CDEPEND}
  43. doc? ( virtual/texi2dvi )
  44. nls? ( sys-devel/gettext )
  45. virtual/pkgconfig
  46. "
  47. REQUIRED_USE="gnutls? ( ssl )"
  48. DOCS="AUTHORS ChangeLog NEWS README THANKS doc/msmtprc*"
  49. src_prepare() {
  50. # Use default Gentoo location for mail aliases
  51. sed -i 's:/etc/aliases:/etc/mail/aliases:' scripts/find_alias/find_alias_for_msmtp.sh || die
  52. default
  53. }
  54. src_configure() {
  55. econf \
  56. $(use_enable nls) \
  57. $(use_with ssl ssl $(usex gnutls gnutls openssl)) \
  58. $(use_with sasl libgsasl) \
  59. $(use_with idn libidn) \
  60. $(use_with libsecret )
  61. }
  62. src_compile() {
  63. default
  64. if use doc ; then
  65. cd doc || die
  66. emake html pdf
  67. fi
  68. }
  69. src_install() {
  70. default
  71. if use doc ; then
  72. dohtml doc/msmtp.html
  73. dodoc doc/msmtp.pdf
  74. fi
  75. if use mta ; then
  76. dodir /usr/sbin
  77. dosym /usr/bin/msmtp /usr/sbin/sendmail
  78. dosym /usr/bin/msmtp /usr/bin/sendmail
  79. dosym /usr/bin/msmtp /usr/$(get_libdir)/sendmail
  80. fi
  81. if use vim-syntax ; then
  82. insinto /usr/share/vim/vimfiles/syntax
  83. doins scripts/vim/msmtp.vim
  84. fi
  85. insinto /etc
  86. newins doc/msmtprc-system.example msmtprc
  87. src_install_contrib find_alias find_alias_for_msmtp.sh
  88. src_install_contrib msmtpqueue "*.sh" "README ChangeLog"
  89. src_install_contrib msmtpq "msmtpq msmtp-queue" README.msmtpq
  90. src_install_contrib set_sendmail set_sendmail.sh set_sendmail.conf
  91. }
  92. pkg_postinst() {
  93. if [[ -z ${REPLACING_VERSIONS} ]]; then
  94. einfo "Please edit ${ROOT}etc/msmtprc before first use."
  95. einfo "In addition, per user configuration files can be placed"
  96. einfo "as '~/.msmtprc'. See the msmtprc-user.example file under"
  97. einfo "/usr/share/doc/${PF}/ for an example."
  98. fi
  99. }
  100. src_install_contrib() {
  101. subdir="$1"
  102. bins="$2"
  103. docs="$3"
  104. local dir=/usr/share/${PN}/$subdir
  105. insinto ${dir}
  106. exeinto ${dir}
  107. for i in $bins ; do
  108. doexe scripts/$subdir/$i
  109. done
  110. for i in $docs ; do
  111. newdoc scripts/$subdir/$i $subdir.$i
  112. done
  113. }