resource-agents: upgrade to 4.1.1 and align with stx 3.0
[pti/rtp.git] / meta-stx / recipes-support / cluster-resource-agents / resource-agents_4.1.1.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 SUMMARY = "OCF resource agents for use by compatible cluster managers"
17
18 DESCRIPTION = "A set of scripts to interface with several services \
19 to operate in a High Availability environment for both Pacemaker and \
20 rgmanager service managers. \
21 "
22 HOMEPAGE = "http://sources.redhat.com/cluster/wiki/"
23
24 LICENSE = "GPLv2+ & LGPLv2+ & GPLv3"
25 LIC_FILES_CHKSUM = " \
26     file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
27     file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
28     file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
29 "
30
31 SRC_URI = " \
32     https://codeload.github.com/ClusterLabs/${BPN}/tar.gz/v${PV};downloadfilename=${BPN}-${PV}.tar.gz \
33     file://0001-disable-doc-build.patch \
34     file://0002-Set-OCF_ROOT_DIR-to-libdir-ocf.patch \
35     file://0003-fix-header-defs-lookup.patch \
36     file://0004-configure.ac-fix-install-sh-not-found.patch \
37     \
38     file://stx/new_ocf_return_codes.patch \
39     file://stx/ipaddr2_check_if_state.patch \
40     file://stx/copyright.patch \
41     file://stx/umount-in-namespace.patch \
42     file://stx/lvm_vg_activation.patch \
43     file://stx/pgsql.patch \
44     file://stx/Fix-VG-activity-bug-in-heartbeat-LVM-script.patch \
45     file://stx/ocf-shellfuncs_change_logtag.patch \
46     file://stx/lvm_cleanup_refs_on_stop.patch \
47     file://stx/ipaddr2_if_down.patch \
48     file://stx/ipaddr2_ignore_lo_if_state.patch \
49     file://stx/ipaddr2-avoid-failing-svc-if-down.patch \
50     file://stx/ipaddr2-use-host-scope-for-addresses-on-loopback.patch \
51 "
52
53 SRC_URI[md5sum] = "82e3a335f942347f1b7c27b9f8e8e984"
54 SRC_URI[sha256sum] = "decc370bce20ee7a034886eb19ddb54d823f5e95c58f4d121f53cc965147f736"
55
56 DEPENDS = "cluster-glue"
57
58 inherit autotools systemd pkgconfig
59 inherit update-alternatives
60
61 ALTERNATIVE_PRIORITY = "70"
62 ALTERNATIVE_${PN} = "drbd.sh"
63 ALTERNATIVE_LINK_NAME[drbd.sh] = "${datadir}/cluster/drbd.sh"
64
65 EXTRA_OECONF += " \
66     --disable-fatal-warnings \
67     --with-rsctmpdir=/var/run/heartbeat/rsctmp \
68 "
69
70 do_install_append() {
71     rm -rf "${D}${localstatedir}/run"
72     rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
73
74     mv ${D}${datadir}/cluster/drbd.sh ${D}${datadir}/cluster/drbd.sh.${PN}
75
76     # Create symbolic link between IPAddr and IPAddr2
77     rm -f ${D}${libdir}/ocf/resource.d/heartbeat/IPaddr
78     ln -s ${libdir}/ocf/resource.d/heartbeat/IPaddr2 ${D}${libdir}/ocf/resource.d/heartbeat/IPaddr
79 }
80
81 PACKAGES_prepend  = " \
82     ldirectord \
83 "
84
85 FILES_ldirectord = " \
86     ${sbindir}/ldirectord \
87     ${sysconfdir}/ha.d/resource.d/ldirectord \
88     ${sysconfdir}/init.d/ldirectord \
89     ${sysconfdir}/logrotate.d/ldirectord \
90     ${libdir}/ocf/resource.d/heartbeat/ldirectord \
91 "
92
93 FILES_${PN} += " \
94     ${datadir}/cluster/* \
95     ${datadir}/${BPN}/ocft/configs/portblock \
96     ${libdir}/ocf/resource.d/heartbeat/ \
97     ${libdir}/ocf/lib/heartbeat/* \
98     ${libdir}/ocf/resource.d/redhat \
99     ${libdir}/tmpfiles.d/ \
100 "
101
102 FILES_${PN}-dbg += " \
103     ${libdir}/ocf/resource.d/heartbeat/.debug \
104     ${libdir}/${BPN}/heartbeat/.debug \
105 "
106
107 # There are many tools and scripts that need bash and perl.
108 # lvm.sh requires: lvm2
109 # ip.sh requires: ethtool iproute2 iputils-arping
110 # fs.sh requires: e2fsprogs-e2fsck util-linux quota
111 # netfs.sh requires: procps util-linux nfs-utils
112 RDEPENDS_${PN} += " \
113     bash perl lvm2 \
114     ethtool iproute2 iputils-arping \
115     e2fsprogs-e2fsck util-linux quota \
116     procps nfs-utils \
117 "
118
119 RDEPENDS_ldirectord += " \
120     ipvsadm \
121     libdbi-perl \
122     libdigest-hmac-perl \
123     libmailtools-perl \
124     libnet-dns-perl \
125     libsocket6-perl \
126     libwww-perl \
127     perl \
128     perl-module-getopt-long \
129     perl-module-net-ftp \
130     perl-module-net-smtp \
131     perl-module-pod-usage \
132     perl-module-posix \
133     perl-module-socket \
134     perl-module-strict \
135     perl-module-sys-hostname \
136     perl-module-sys-syslog \
137     perl-module-vars \
138 "
139
140 SYSTEMD_PACKAGES += "ldirectord"
141 SYSTEMD_SERVICE_${PN} += "resource-agents-deps.target"
142 SYSTEMD_SERVICE_ldirectord += "ldirectord.service"