qpopper-4.1.0.ebuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. #inherit eutils flag-o-matic ssl-cert
  5. inherit eutils ssl-cert user
  6. MY_P=${PN}${PV}
  7. DESCRIPTION="A POP3 Server"
  8. HOMEPAGE="http://www.eudora.com/products/unsupported/qpopper/index.html"
  9. SRC_URI="ftp://ftp.qualcomm.com/eudora/servers/unix/popper/${MY_P}.tar.gz"
  10. LICENSE="qpopper ISOC-rfc"
  11. SLOT="0"
  12. KEYWORDS="amd64 x86"
  13. IUSE="debug drac gdbm mailbox pam ssl xinetd apop"
  14. DEPEND="virtual/mta
  15. >=net-mail/mailbase-0.00-r8
  16. xinetd? ( virtual/inetd )
  17. gdbm? ( sys-libs/gdbm )
  18. drac? ( mail-client/drac )
  19. pam? ( >=sys-libs/pam-0.72 )
  20. ssl? ( dev-libs/openssl )"
  21. RDEPEND="${DEPEND}"
  22. S=${WORKDIR}/${MY_P}
  23. pkg_setup() {
  24. use apop && enewuser pop
  25. }
  26. src_prepare() {
  27. # Test dirs are full of binary craft. Drop it.
  28. rm -rf ./mmangle/test || die
  29. epatch "${FILESDIR}"/${PN}-4.1-parallel-build.patch
  30. sed -i -e 's:-o popauth:& ${LDFLAGS}:' popper/Makefile.in || die
  31. }
  32. src_configure() {
  33. econf \
  34. $(use_enable !xinetd standalone) \
  35. $(use_enable debug debugging) \
  36. $(use_with ssl openssl) \
  37. $(use_with gdbm) \
  38. $(use_with pam pam pop3) \
  39. $(use_enable apop apop /etc/pop.auth) \
  40. $(use_enable mailbox home-dir-mail Mailbox) \
  41. $(use_with drac) \
  42. --enable-shy \
  43. --enable-popuid=pop \
  44. --enable-log-login \
  45. --enable-specialauth \
  46. --enable-spool-dir=/var/spool/mail \
  47. --enable-log-facility=LOG_MAIL
  48. if ! use gdbm; then
  49. sed -i -e 's|#define HAVE_GDBM_H|//#define HAVE_GDBM_H|g' config.h || die "sed failed"
  50. fi
  51. }
  52. src_install() {
  53. if use apop; then
  54. dosbin popper/popauth
  55. fowners pop:root /usr/sbin/popauth
  56. fperms 4110 /usr/sbin/popauth
  57. doman man/popauth.8
  58. fi
  59. dosbin popper/popper
  60. doman man/popper.8
  61. insinto /etc
  62. doins "${FILESDIR}/qpopper.conf"
  63. if use ssl; then
  64. sed -i -e 's:^# \(set tls-server-cert-file\).*:\1 = /etc/mail/certs/cert.pem:' \
  65. -e 's:^# \(set tls-support\).*$:\1 = stls:'\
  66. "${D}/etc/qpopper.conf"
  67. fi
  68. if use xinetd; then
  69. insinto /etc/xinetd.d
  70. newins "${FILESDIR}/qpopper.xinetd" pop-3
  71. else
  72. newinitd "${FILESDIR}/qpopper.init.d" qpopper
  73. fi
  74. dodoc README doc/{Release.Notes,Changes}
  75. docinto rfc
  76. dodoc doc/rfc*.txt
  77. dohtml doc/LMOS-FAQ.html
  78. insinto /usr/share/doc/${PF}
  79. doins GUIDE.pdf
  80. }
  81. pkg_postinst () {
  82. if use ssl; then
  83. install_cert /etc/mail/certs/cert
  84. chown root:mail /etc/mail/certs
  85. chmod 660 /etc/mail/certs
  86. fi
  87. if use apop; then
  88. elog "To authenticate the users with APOP "
  89. elog "you have to follow these steps:"
  90. elog ""
  91. elog "1) initialize the authentication database:"
  92. elog " # popauth -init"
  93. elog "2) new users can be added by root:"
  94. elog " # popauth -user <user>"
  95. elog " or removed:"
  96. elog " # popauth -delete <user>"
  97. elog " Other users can add themeselves or change their"
  98. elog " password with the command popauth"
  99. elog "3) scripts or other non-interactive processes can add or change"
  100. elog " the passwords with the following command:"
  101. elog " # popauth -user <user> <password>"
  102. elog ""
  103. fi
  104. }