ssmtp-2.64-r3.ebuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PATCHSET=4
  5. WANT_AUTOMAKE=none
  6. inherit eutils autotools user
  7. DESCRIPTION="Extremely simple MTA to get mail off the system to a Mailhub"
  8. HOMEPAGE="ftp://ftp.debian.org/debian/pool/main/s/ssmtp/"
  9. SRC_URI="mirror://debian/pool/main/s/ssmtp/${P/-/_}.orig.tar.bz2
  10. https://dev.gentoo.org/~pinkbyte/distfiles/patches/${P}-patches-${PATCHSET}.tar.xz"
  11. LICENSE="GPL-2"
  12. SLOT="0"
  13. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  14. IUSE="ipv6 libressl +ssl gnutls +mta"
  15. DEPEND="ssl? (
  16. gnutls? ( net-libs/gnutls[openssl] )
  17. !gnutls? (
  18. !libressl? ( dev-libs/openssl:0= )
  19. libressl? ( dev-libs/libressl:0= )
  20. )
  21. )"
  22. RDEPEND="${DEPEND}
  23. net-mail/mailbase
  24. mta? (
  25. !net-mail/mailwrapper
  26. !mail-mta/courier
  27. !mail-mta/esmtp
  28. !mail-mta/exim
  29. !mail-mta/mini-qmail
  30. !mail-mta/msmtp[mta]
  31. !mail-mta/nbsmtp
  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. )"
  39. REQUIRED_USE="gnutls? ( ssl )"
  40. pkg_setup() {
  41. if ! use prefix; then
  42. enewgroup ssmtp
  43. fi
  44. }
  45. src_prepare() {
  46. EPATCH_SUFFIX="patch" EPATCH_SOURCE="${WORKDIR}/patches" \
  47. epatch
  48. epatch_user
  49. # let's start by not using configure.in anymore as future autoconf
  50. # versions will not support it.
  51. mv configure.in configure.ac || die
  52. eautoconf
  53. }
  54. src_configure() {
  55. econf \
  56. --sysconfdir="${EPREFIX}"/etc/ssmtp \
  57. $(use_enable ssl) $(use_with gnutls) \
  58. $(use_enable ipv6 inet6) \
  59. --enable-md5auth
  60. }
  61. src_compile() {
  62. emake etcdir="${EPREFIX}"/etc || die
  63. }
  64. src_install() {
  65. dosbin ssmtp
  66. doman ssmtp.8 ssmtp.conf.5
  67. dodoc ChangeLog CHANGELOG_OLD INSTALL README TLS
  68. newdoc ssmtp.lsm DESC
  69. insinto /etc/ssmtp
  70. doins ssmtp.conf revaliases
  71. local conffile="${ED}etc/ssmtp/ssmtp.conf"
  72. # Sorry about the weird indentation, I couldn't figure out a cleverer way
  73. # to do this without having horribly >80 char lines.
  74. sed -i -e "s:^hostname=:\n# Gentoo bug #47562\\
  75. # Commenting the following line will force ssmtp to figure\\
  76. # out the hostname itself.\n\\
  77. # hostname=:" \
  78. "${conffile}" || die "sed failed"
  79. # Comment rewriteDomain (bug #243364)
  80. sed -i -e "s:^rewriteDomain=:#rewriteDomain=:" "${conffile}"
  81. # Set restrictive perms on ssmtp.conf as per #187841, #239197
  82. # Protect the ssmtp configfile from being readable by regular users as it
  83. # may contain login/password data to auth against a the mailhub used.
  84. if ! use prefix; then
  85. fowners root:ssmtp /etc/ssmtp/ssmtp.conf
  86. fperms 640 /etc/ssmtp/ssmtp.conf
  87. fowners root:ssmtp /usr/sbin/ssmtp
  88. fperms 2711 /usr/sbin/ssmtp
  89. fi
  90. if use mta; then
  91. dosym ../sbin/ssmtp /usr/lib/sendmail
  92. dosym ../sbin/ssmtp /usr/bin/sendmail
  93. dosym ssmtp /usr/sbin/sendmail
  94. dosym ../sbin/ssmtp /usr/bin/mailq
  95. dosym ../sbin/ssmtp /usr/bin/newaliases
  96. fi
  97. }