Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / cluster-glue / cluster-glue_1.0.12.bb
1 #
2 # Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 DESCRIPTION = "Cluster Glue is a set of libraries, tools and utilities suitable for \
17 the Heartbeat/Pacemaker cluster stack. In essence, Glue is everything that \
18 is not the cluster messaging layer (Heartbeat), nor the cluster resource manager \
19 (Pacemaker), nor a Resource Agent."
20 HOMEPAGE = "http://clusterlabs.org/"
21 LICENSE = "GPLv2 & LGPLv2.1"
22 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
23                     file://COPYING.LIB;md5=243b725d71bb5df4a1e5920b344b86ad \
24 "
25
26 DEPENDS = "libxml2 libtool glib-2.0 bzip2 util-linux net-snmp openhpi"
27
28 SRC_URI = " \
29     http://hg.linux-ha.org/glue/archive/glue-${PV}.tar.bz2 \
30     file://0001-don-t-compile-doc-and-Error-Fix.patch \
31     file://0001-ribcl.py.in-Warning-Fix.patch \
32     file://volatiles \
33     file://tmpfiles \
34 "
35 SRC_URI_append_libc-uclibc = " file://kill-stack-protector.patch"
36
37 SRC_URI[md5sum] = "ec620466d6f23affa3b074b72bca7870"
38 SRC_URI[sha256sum] = "feba102fa1e24b6be2005089ebe362b82d6567af60005cf371679b1b44ec503f"
39
40 inherit autotools useradd pkgconfig systemd
41
42 SYSTEMD_SERVICE_${PN} = "logd.service"
43 SYSTEMD_AUTO_ENABLE = "disable"
44
45 HA_USER = "hacluster"
46 HA_GROUP = "haclient"
47
48 S = "${WORKDIR}/Reusable-Cluster-Components-glue--glue-${PV}"
49
50 PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
51 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir,systemd"
52
53 EXTRA_OECONF = "--with-daemon-user=${HA_USER} \
54                 --with-daemon-group=${HA_GROUP} \
55                 --disable-fatal-warnings \
56                "
57
58 CACHED_CONFIGUREVARS="ac_cv_path_XML2CONFIG=0"
59
60 USERADD_PACKAGES = "${PN}"
61 USERADD_PARAM_${PN} = "--home-dir=${localstatedir}/lib/heartbeat/cores/${HA_USER} \
62                        -g ${HA_GROUP} -r -s ${sbindir}/nologin -c 'cluster user' ${HA_USER} \
63                       "
64 GROUPADD_PARAM_${PN} = "-r ${HA_GROUP}"
65
66 do_configure_prepend() {
67     ln -sf ${PKG_CONFIG_SYSROOT_DIR}/usr/include/libxml2/libxml ${PKG_CONFIG_SYSROOT_DIR}/usr/include/libxml
68 }
69
70 do_install_append() {
71         install -d ${D}${sysconfdir}/default/volatiles
72         install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/04_cluster-glue
73         install -d ${D}${sysconfdir}/tmpfiles.d
74         install -m 0644 ${WORKDIR}/tmpfiles ${D}${sysconfdir}/tmpfiles.d/${PN}.conf
75 }
76
77 pkg_postinst_${PN} () {
78         if [ -z "$D" ]; then
79                 if type systemd-tmpfiles >/dev/null; then
80                         systemd-tmpfiles --create
81                 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
82                         ${sysconfdir}/init.d/populate-volatile.sh update
83                 fi
84         fi
85 }
86
87 PACKAGES += "\
88          ${PN}-plugin-test \
89          ${PN}-plugin-test-dbg \
90          ${PN}-plugin-test-staticdev \
91          ${PN}-plugin-stonith2 \
92          ${PN}-plugin-stonith2-dbg \
93          ${PN}-plugin-stonith2-staticdev \
94          ${PN}-plugin-stonith2-ribcl \
95          ${PN}-plugin-stonith-external \
96          ${PN}-plugin-raexec \
97          ${PN}-plugin-raexec-dbg \
98          ${PN}-plugin-raexec-staticdev \
99          ${PN}-plugin-interfacemgr \
100          ${PN}-plugin-interfacemgr-dbg \
101          ${PN}-plugin-interfacemgr-staticdev \
102          ${PN}-lrmtest \
103          ${PN}-plugin-compress \
104          ${PN}-plugin-compress-dbg \
105          ${PN}-plugin-compress-staticdev \
106          "
107
108 FILES_${PN} = "${sysconfdir} /var ${libdir}/lib*.so.* ${sbindir} ${datadir}/cluster-glue/*sh ${datadir}/cluster-glue/*pl\
109         ${libdir}/heartbeat/transient-test.sh \
110         ${libdir}/heartbeat/logtest \
111         ${libdir}/heartbeat/ipctransientserver \
112         ${libdir}/heartbeat/base64_md5_test \
113         ${libdir}/heartbeat/ipctest \
114         ${libdir}/heartbeat/ipctransientclient \
115         ${libdir}/heartbeat/ha_logd \
116         ${libdir}/heartbeat/lrmd \
117         ${systemd_unitdir} \
118         "
119
120 FILES_${PN}-dbg += "${libdir}/heartbeat/.debug/ \
121                    "
122 FILES_${PN}-plugin-compress = "${libdir}/heartbeat/plugins/compress/*.so"
123 FILES_${PN}-plugin-compress-staticdev = "${libdir}/heartbeat/plugins/compress/*.*a"
124 FILES_${PN}-plugin-compress-dbg = "${libdir}/heartbeat/plugins/compress/.debug/"
125
126 FILES_${PN}-plugin-test = "${libdir}/heartbeat/plugins/test/test.so"
127 FILES_${PN}-plugin-test-staticdev = "${libdir}/heartbeat/plugins/test/test.*a"
128 FILES_${PN}-plugin-test-dbg = "${libdir}/heartbeat/plugins/test/.debug/"
129 FILES_${PN}-plugin-stonith2 = " \
130         ${libdir}/stonith/plugins/xen0-ha-dom0-stonith-helper \
131         ${libdir}/stonith/plugins/stonith2/*.so \
132         "
133 FILES_${PN}-plugin-stonith2-ribcl = "${libdir}/stonith/plugins/stonith2/ribcl.py"
134
135 FILES_${PN}-plugin-stonith2-dbg = "${libdir}/stonith/plugins/stonith2/.debug/"
136 FILES_${PN}-plugin-stonith2-staticdev = "${libdir}/stonith/plugins/stonith2/*.*a"
137
138 FILES_${PN}-plugin-stonith-external = "${libdir}/stonith/plugins/external/"
139 FILES_${PN}-plugin-raexec = "${libdir}/heartbeat/plugins/RAExec/*.so"
140 FILES_${PN}-plugin-raexec-staticdev = "${libdir}/heartbeat/plugins/RAExec/*.*a"
141 FILES_${PN}-plugin-raexec-dbg = "${libdir}/heartbeat/plugins/RAExec/.debug/"
142
143 FILES_${PN}-plugin-interfacemgr = "${libdir}/heartbeat/plugins/InterfaceMgr/generic.so"
144 FILES_${PN}-plugin-interfacemgr-staticdev = "${libdir}/heartbeat/plugins/InterfaceMgr/generic.*a"
145 FILES_${PN}-plugin-interfacemgr-dbg = "${libdir}/heartbeat/plugins/InterfaceMgr/.debug/"
146
147 FILES_${PN}-lrmtest = "${datadir}/cluster-glue/lrmtest/"
148
149 RDEPENDS_${PN} += "perl"
150 RDEPENDS_${PN}-plugin-stonith2 += "bash"
151 RDEPENDS_${PN}-plugin-stonith-external += "bash python perl"
152 RDEPENDS_${PN}-plugin-stonith2-ribcl += "python"