summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-extended/rabbitmq/rabbitmq-server_3.2.4.bb
blob: 7f003fd6ed9b806dc2cb2cb22693ef24853c51d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
DESCRIPTION = "High-performance AMQP-compliant message broker written in Erlang."
HOMEPAGE = "http://www.rabbitmq.com/"
LICENSE = "MPL-1.1"
LIC_FILES_CHKSUM = "file://LICENSE-MPL-RabbitMQ;md5=b651d0a6feaaf2bf5eb9d36b2495c510"
SECTION = "network"
PR = "r2"

SRC_URI = "http://www.rabbitmq.com/releases/rabbitmq-server/v${PV}/${PN}-${PV}.tar.gz \
           file://rabbitmq-server \
           file://remove-docs.patch \
           file://cleanup_install.patch \
           file://rabbitmq-server.service \
           file://rabbitmq-server-setup \
           "

SRC_URI[md5sum] = "09d1af64c005bc680d6790b90655d021"
SRC_URI[sha256sum] = "a930f92b362df2f292ec5f0281aa2011eb0c668faf6e24c4653a9fc53ec43b9f"

DEPENDS = " \
    erlang-native \
    libxslt \
    python-simplejson \
    zip-native \
    unzip-native \
    libxslt-native \
    coreutils-native\
"

RDEPENDS_${PN} = "erlang erlang-modules"

do_compile() {
    oe_runmake
}

do_install() {
    RABBIT_LIB_DIR=${D}${libdir}/rabbitmq/lib/${PN}-${PV}
    DOC_INSTALL_DIR="${D}${docdir}"

    sed -e "s:^RABBITMQ_HOME=.*:RABBITMQ_HOME=\"${libdir}/rabbitmq/lib/${PN}-${PV}\":g" \
               -i ${S}/scripts/rabbitmq-env
    oe_runmake TARGET_DIR=${D} \
               SBIN_DIR=${D}/${bindir} \
               MAN_DIR=${D}/${mandir} \
               DOC_INSTALL_DIR=${DOC_INSTALL_DIR} install \

    install -d ${D}${libdir}/rabbitmq/lib/${PN}-${PV}

    install -d ${D}${localstatedir}/log/${PN}

    install -d ${D}${sysconfdir}/init.d
    install -m 0755 ${WORKDIR}/rabbitmq-server ${D}${sysconfdir}/init.d/rabbitmq-server

    sed -e "s:%ROOT_HOME%:${ROOT_HOME}:" -i ${D}${sysconfdir}/init.d/rabbitmq-server

    mv ${D}/ebin ${RABBIT_LIB_DIR}/ebin
    mv ${D}/include ${RABBIT_LIB_DIR}/include
    mv ${D}/plugins ${RABBIT_LIB_DIR}/plugins

    install -d ${D}${systemd_unitdir}/system
    install -m 0644 ${WORKDIR}/rabbitmq-server.service ${D}${systemd_unitdir}/system

    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
	install -d ${D}${bindir}
	install -m 0755 ${WORKDIR}/rabbitmq-server-setup ${D}${bindir}
    fi
}

inherit useradd update-rc.d systemd

USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM_${PN} = "--system rabbitmq"
USERADD_PARAM_${PN}  = "--system --create-home --home /var/lib/rabbitmq \
			-g rabbitmq rabbitmq"

INITSCRIPT_NAME = "rabbitmq-server"
INITSCRIPT_PARAMS = "defaults"

SYSTEMD_SERVICE_${PN} = "rabbitmq-server.service"

FILES_${PN} += " ${libdir}/rabbitmq/lib/${PN}-${PV}/* \
                 ${localstatedir}/* \ 
               "

FILES_${PN}-doc += "LICENSE* INSTALL"
INSANE_SKIP_${PN} = "unsafe-references-in-scripts"