rabbitmq-server-3.6.9.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit eutils python-any-r1 systemd user
  6. DESCRIPTION="RabbitMQ is a high-performance AMQP-compliant message broker written in Erlang"
  7. HOMEPAGE="http://www.rabbitmq.com/"
  8. SRC_URI="http://www.rabbitmq.com/releases/rabbitmq-server/v${PV}/rabbitmq-server-${PV}.tar.xz"
  9. LICENSE="GPL-2 MPL-1.1"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~arm64 ~x86"
  12. IUSE=""
  13. RDEPEND="dev-lang/erlang[ssl]"
  14. DEPEND="${RDEPEND}
  15. app-arch/zip
  16. app-arch/unzip
  17. app-text/docbook-xml-dtd:4.5
  18. app-text/xmlto
  19. dev-libs/libxslt
  20. $(python_gen_any_dep 'dev-python/simplejson[${PYTHON_USEDEP}]')
  21. "
  22. pkg_setup() {
  23. enewgroup rabbitmq
  24. enewuser rabbitmq -1 -1 /var/lib/rabbitmq rabbitmq
  25. python-any-r1_pkg_setup
  26. }
  27. src_compile() {
  28. emake all docs dist
  29. }
  30. src_install() {
  31. # erlang module
  32. local targetdir="/usr/$(get_libdir)/erlang/lib/rabbitmq_server-${PV}"
  33. einfo "Setting correct RABBITMQ_HOME in scripts"
  34. sed -e "s:^RABBITMQ_HOME=.*:RABBITMQ_HOME=\"${targetdir}\":g" \
  35. -i deps/rabbit/scripts/rabbitmq-env || die
  36. einfo "Installing Erlang modules to ${targetdir}"
  37. insinto "${targetdir}"
  38. doins -r deps/rabbit/ebin deps/rabbit/include plugins
  39. einfo "Installing server scripts to /usr/sbin"
  40. for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-defaults rabbitmq-plugins; do
  41. exeinto /usr/libexec/rabbitmq
  42. doexe deps/rabbit/scripts/${script}
  43. newsbin "${FILESDIR}"/rabbitmq-script-wrapper ${script}
  44. done
  45. # install the init script
  46. newinitd "${FILESDIR}"/rabbitmq-server.init-r3 rabbitmq
  47. systemd_dounit "${FILESDIR}/rabbitmq.service"
  48. # install documentation
  49. dodoc deps/rabbit/docs/*.xml
  50. dodoc deps/rabbit/README
  51. # create the directory where our log file will go.
  52. diropts -m 0770 -o rabbitmq -g rabbitmq
  53. keepdir /var/log/rabbitmq /etc/rabbitmq
  54. # create the mnesia directory
  55. diropts -m 0770 -o rabbitmq -g rabbitmq
  56. dodir /var/lib/rabbitmq{,/mnesia}
  57. }
  58. pkg_preinst() {
  59. if has_version "<=net-misc/rabbitmq-server-1.8.0"; then
  60. elog "IMPORTANT UPGRADE NOTICE:"
  61. elog
  62. elog "RabbitMQ is now running as an unprivileged user instead of root."
  63. elog "Therefore you need to fix the permissions for RabbitMQs Mnesia database."
  64. elog "Please run the following commands as root:"
  65. elog
  66. elog " usermod -d /var/lib/rabbitmq rabbitmq"
  67. elog " chown rabbitmq:rabbitmq -R /var/lib/rabbitmq"
  68. elog
  69. elif has_version "<net-misc/rabbitmq-server-2.1.1"; then
  70. elog "IMPORTANT UPGRADE NOTICE:"
  71. elog
  72. elog "Please read release notes before upgrading:"
  73. elog
  74. elog "http://www.rabbitmq.com/release-notes/README-3.0.0.txt"
  75. fi
  76. if has_version "<net-misc/rabbitmq-server-3.3.0"; then
  77. elog
  78. elog "This release changes the behaviour of the default guest user:"
  79. elog
  80. elog "http://www.rabbitmq.com/access-control.html"
  81. fi
  82. }