msmtp-1.6.2.ebuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  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 ~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. }
  53. src_configure() {
  54. econf \
  55. $(use_enable nls) \
  56. $(use_with ssl ssl $(usex gnutls gnutls openssl)) \
  57. $(use_with sasl libgsasl) \
  58. $(use_with idn libidn) \
  59. $(use_with libsecret )
  60. }
  61. src_compile() {
  62. default
  63. if use doc ; then
  64. cd doc || die
  65. emake html pdf
  66. fi
  67. }
  68. src_install() {
  69. default
  70. if use doc ; then
  71. dohtml doc/msmtp.html
  72. dodoc doc/msmtp.pdf
  73. fi
  74. if use mta ; then
  75. dodir /usr/sbin
  76. dosym /usr/bin/msmtp /usr/sbin/sendmail
  77. dosym /usr/bin/msmtp /usr/bin/sendmail
  78. dosym /usr/bin/msmtp /usr/$(get_libdir)/sendmail
  79. fi
  80. if use vim-syntax ; then
  81. insinto /usr/share/vim/vimfiles/syntax
  82. doins scripts/vim/msmtp.vim
  83. fi
  84. insinto /etc
  85. newins doc/msmtprc-system.example msmtprc
  86. src_install_contrib find_alias find_alias_for_msmtp.sh
  87. src_install_contrib msmtpqueue "*.sh" "README ChangeLog"
  88. src_install_contrib msmtpq "msmtpq msmtp-queue" README.msmtpq
  89. src_install_contrib set_sendmail set_sendmail.sh set_sendmail.conf
  90. }
  91. pkg_postinst() {
  92. if [[ -z ${REPLACING_VERSIONS} ]]; then
  93. einfo "Please edit ${ROOT}etc/msmtprc before first use."
  94. einfo "In addition, per user configuration files can be placed"
  95. einfo "as '~/.msmtprc'. See the msmtprc-user.example file under"
  96. einfo "/usr/share/doc/${PF}/ for an example."
  97. fi
  98. }
  99. src_install_contrib() {
  100. subdir="$1"
  101. bins="$2"
  102. docs="$3"
  103. local dir=/usr/share/${PN}/$subdir
  104. insinto ${dir}
  105. exeinto ${dir}
  106. for i in $bins ; do
  107. doexe scripts/$subdir/$i
  108. done
  109. for i in $docs ; do
  110. newdoc scripts/$subdir/$i $subdir.$i
  111. done
  112. }