bincimap-1.2.13.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit eutils
  4. DESCRIPTION="IMAP server for Maildir"
  5. SRC_URI="http://www.bincimap.org/dl/tarballs/1.2/${P}final.tar.bz2"
  6. HOMEPAGE="http://freshmeat.net/projects/bincimap/"
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="amd64 ~hppa ~ppc x86"
  10. IUSE="ssl"
  11. DEPEND="ssl? ( dev-libs/openssl )"
  12. RDEPEND="${DEPEND}
  13. virtual/daemontools
  14. sys-apps/ucspi-tcp
  15. net-mail/checkpassword"
  16. # get rid of old style virtual - bug 350792
  17. # all blockers really needed?
  18. RDEPEND="${RDEPEND}
  19. !mail-mta/courier
  20. !net-mail/courier-imap
  21. !net-mail/cyrus-imapd
  22. !net-mail/uw-imap"
  23. S="${WORKDIR}/${P}final"
  24. src_unpack() {
  25. unpack ${A}
  26. cd "${S}"
  27. epatch "${FILESDIR}"/${P}-gentoo.diff
  28. epatch "${FILESDIR}"/${PN}-1.2-gcc43.patch
  29. epatch "${FILESDIR}"/${P}-glibc-2.10.patch
  30. }
  31. src_compile() {
  32. econf $(use_enable ssl) --sysconfdir=/etc/bincimap || die
  33. emake localstatedir=/etc/bincimap || die
  34. }
  35. src_install () {
  36. make DESTDIR="${D}" localstatedir=/etc/bincimap prefix=/usr install || die
  37. keepdir /var/log/bincimap || die
  38. if use ssl; then
  39. keepdir /var/log/bincimap-ssl || die
  40. fi
  41. dodoc AUTHORS ChangeLog INSTALL \
  42. NEWS README README.SSL TODO
  43. dohtml doc/*.{html,css}
  44. rm -rf "${D}"/usr/share/doc/"${PN}"
  45. # backward compatibility
  46. dosym /etc/bincimap/service/bincimap /etc/bincimap/service/imap
  47. dosym /etc/bincimap/service/bincimaps /etc/bincimap/service/imaps
  48. }
  49. pkg_postinst() {
  50. elog "To start bicimap at boot you have to enable the /etc/init.d/svscan rc file"
  51. elog "and create the following link:"
  52. elog "ln -s /etc/bincimap/service/bincimap /service/bincimap"
  53. elog
  54. if use ssl; then
  55. elog "If you want to use ssl connections, create the following link:"
  56. elog "ln -s /etc/bincimap/service/bincimaps /service/bincimaps"
  57. elog
  58. elog "And this command will setup bincimap-ssl on your system."
  59. elog "emerge --config =${CATEGORY}/${PF}"
  60. elog
  61. fi
  62. elog "NOTE: Default Maildir path is '~/.maildir'. If you want to modify it,"
  63. elog "edit /etc/bincimap/bincimap.conf"
  64. elog
  65. }
  66. pkg_config() {
  67. if use ssl; then
  68. local pemfile=/etc/bincimap/bincimap.pem
  69. if [ ! -f $pemfile ]; then
  70. echo "Creating a self-signed ssl-cert:"
  71. /usr/bin/openssl req -new -x509 -nodes -out $pemfile -days 366 -keyout $pemfile
  72. chmod 640 $pemfile
  73. einfo "If You want to have a signed cert, do the following:"
  74. einfo "openssl req -new -nodes -out req.pem \\"
  75. einfo "-keyout $pemfile"
  76. einfo "chmod 640 $pemfile"
  77. einfo "Send req.pem to your CA to obtain signed_req.pem, and do:"
  78. einfo "cat signed_req.pem >> $pemfile"
  79. fi
  80. fi
  81. }