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