aboutsummaryrefslogtreecommitdiffstats
path: root/meta-cgl-common/recipes-cgl/heartbeat/heartbeat_3.0.5.bb
blob: a866f0fb7e22011548dcdcb56fcd7caf9b104a53 (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
SUMMARY = "Messaging and membership subsystem for High-Availability Linux"
DESCRIPTION = "heartbeat is a basic high-availability subsystem for Linux-HA. \
It will run scripts at initialization, and when machines go up or down. \
This version will also perform IP address takeover using gratuitous ARPs. \
 \
Heartbeat contains a cluster membership layer, fencing, and local and \
clusterwide resource management functionality. \
 \
When used with Pacemaker, it supports n-node clusters with significant \
capabilities for managing resources and dependencies. \
 \
In addition it continues to support the older release 1 style of \
2-node clustering. \
 \
It implements the following kinds of heartbeats: \
- Serial ports \
- UDP/IP multicast (ethernet, etc) \
- UDP/IP broadcast (ethernet, etc) \
- UDP/IP heartbeats \
- ping heartbeats (for routers, switches, etc.) \
(to be used for breaking ties in 2-node systems) \
"
HOMEPAGE = "http://linux-ha.org/"
SECTION = "System Environment/Daemons"
LICENSE = "GPLv2 LGPLv2+"
LIC_FILES_CHKSUM = " \
    file://doc/COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b \
    file://doc/COPYING.LGPL;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
"
SRC_URI = " \
    http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/7e3a82377fa8.tar.bz2 \
    file://membership-ccm-Makefile.am-fix-warning.patch \
    file://Makefile.am-not-chgrp-in-cross-compile.patch \
    file://ucast.c-fix-compile-errors.patch \
    file://configure.in-Error-and-warning-fix.patch \
    file://heartbeat-init.d-heartbeat.in-modify-parameter.patch \
    file://heartbeat.service \
"
SRC_URI[md5sum] = "396510e3c143a9c2288bc52cfc9caa3c"
SRC_URI[sha256sum] = "085013154511f3c270b5e9a3281732dbbb9812924ae24d9c3c6db1af4dd260d0"
S = "${WORKDIR}/Heartbeat-3-0-7e3a82377fa8/"
DEPENDS = "cluster-glue corosync"
inherit autotools-brokensep pkgconfig useradd
EXTRA_OECONF = " \
    STAGING_DIR_TARGET=${STAGING_DIR_TARGET} \
    --disable-fatal-warnings \
    --disable-static \
"
SOURCE1 = "heartbeat/init.d/heartbeat"
CFLAGS_append += "-DGLIB_COMPILATION"

do_configure() {
    ./bootstrap
    isbigendian=`echo ${TUNE_FEATURES} | grep bigendian` || true
    if [ $isbigendian"x" = "x" ] ; then
        CPU_ENDIAN="little"
    else
        CPU_ENDIAN="big"
    fi
    cp -a ./configure ./configure.orig
    if [ ${CPU_ENDIAN} == "little" ]; then
        sed -e "s@CROSS_ENDIAN_INFO@\$as_echo \"#define CONFIG_LITTLE_ENDIAN 1\" >>confdefs.h@g" \
            -e "s@CROSS_LIBDIR@${_LIBDIR}@g" \
        ./configure.orig > ./configure
    else
    sed -e "s@CROSS_ENDIAN_INFO@\$as_echo \"#define CONFIG_BIG_ENDIAN 1\" >>confdefs.h@g" \
        -e "s@CROSS_LIBDIR@${_LIBDIR}@g" \
        ./configure.orig > ./configure
    fi
    oe_runconf ${EXTRA_OECONF}
}
do_compile_prepend() {
    sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' ${HOST_PREFIX}libtool
    sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' ${HOST_PREFIX}libtool
    make clean
}
do_install_append () {
    sed -i -e 's,/usr/lib/,${libdir}/,' ${WORKDIR}/heartbeat.service
    if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
        install -d ${D}${libexecdir}
        install -m 0755 ${S}/${SOURCE1} ${D}${libexecdir}/heartbeat.init
        install -d ${D}${systemd_unitdir}/system
        install -m 0644 ${WORKDIR}/heartbeat.service ${D}${systemd_unitdir}/system/
    fi
}

do_install() {
    sed -i -e 's:/etc/rc.d/init.d/functions:/etc/init.d/functions:g' \
        ${S}/${SOURCE1}
    oe_runmake DESTDIR=${D} install
    # cleanup
    [ -d ${D}/usr/man ] && rm -rf ${D}/usr/man
    [ -d ${D}/usr/share/libtool ] && rm -rf ${D}/usr/share/libtool
    find ${D} -type f -name *.la -exec rm -f {} ';'
    rm -rf ${D}/usr/share/heartbeat/cts
    rm -rf ${D}/usr/share/doc/packages
    rm -rf ${D}/usr/share/heartbeat/ha_propagate
    install -m 0755 ${S}/doc/ha.cf    ${D}/etc/ha.d/ha.cf
    install -m 0600 ${S}/doc/authkeys ${D}/etc/ha.d/authkeys
}

inherit ${@base_contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','',d)}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "heartbeat.service"
SYSTEMD_AUTO_ENABLE = "disable"

USERADD_PACKAGES = "${PN}"
GROUPADD_PARAM_${PN} = "-r haclient"
USERADD_PARAM_${PN} = " \
    -r -g haclient -d /var/lib/heartbeat/cores/hacluster -M \
    -s /sbin/nologin -c \"heartbeat user\" hacluster \
"
FILES_${PN}-dbg += " \
    ${libdir}/heartbeat/plugins/quorum/.debug \
    ${libdir}/heartbeat/plugins/HBauth/.debug \
    ${libdir}/heartbeat/plugins/tiebreaker/.debug \
    ${libdir}/heartbeat/plugins/HBcomm/.debug \
    ${libdir}/heartbeat/plugins/HBcompress/.debug \
"
FILES_${PN} += " \
    run/heartbeat/ccm \
    run/heartbeat/dopd \
"