commit d21e60febb5da57ee664a0c33dd5570834348e1e Author: CentOS Sources Date: Tue Nov 12 11:27:54 2019 -0500 import resource-agents-sap-hana-0.152.22-1.el8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2d5e4e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz +SOURCES/SAPHanaSR-2067519.tar.gz diff --git a/.resource-agents-sap-hana.metadata b/.resource-agents-sap-hana.metadata new file mode 100644 index 0000000..9195a30 --- /dev/null +++ b/.resource-agents-sap-hana.metadata @@ -0,0 +1,2 @@ +0358e1cb7fe86b2105bd2646cbe86f3c0273844a SOURCES/ClusterLabs-resource-agents-e711383f.tar.gz +92409ca65e8f4e63d5c308368861fa67ced470f1 SOURCES/SAPHanaSR-2067519.tar.gz diff --git a/SOURCES/bz1738205-SAPHanaTopology-make-multi-instance-aware.patch b/SOURCES/bz1738205-SAPHanaTopology-make-multi-instance-aware.patch new file mode 100644 index 0000000..c4fbd7c --- /dev/null +++ b/SOURCES/bz1738205-SAPHanaTopology-make-multi-instance-aware.patch @@ -0,0 +1,49 @@ +From d43d8af650ee9ed175ebd4fdfc15ac2767734a8d Mon Sep 17 00:00:00 2001 +From: Fabian Herschel +Date: Wed, 25 Jul 2018 12:30:32 +0200 +Subject: [PATCH] ra/SAPHanaTopology: bsc#1016691 "SAPHanaSR: Status file of + SAPHanaTopology is not multi instance aware (MCOS)" + +--- + SAPHana/ra/SAPHanaTopology | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/SAPHanaSR-2067519/SAPHana/ra/SAPHanaTopology b/SAPHanaSR-2067519/SAPHana/ra/SAPHanaTopology +index 1e2f301..20d2593 100755 +--- a/SAPHanaSR-2067519/SAPHana/ra/SAPHanaTopology ++++ b/SAPHanaSR-2067519/SAPHana/ra/SAPHanaTopology +@@ -28,7 +28,7 @@ + ####################################################################### + # + # Initialization: +-SAPHanaVersion="0.152.21" ++SAPHanaVersion="0.152.22" + timeB=$(date '+%s') + + : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} +@@ -736,15 +736,17 @@ function sht_start() { + # sht_stop: Stop the SAP HANA Topology Resource + # + function sht_stop() { +- super_ocf_log info "FLOW $FUNCNAME ($*)" +- local output="" +- local rc=0 +- +- rm $HA_RSCTMP/SAPHana/SAPTopologyON.${SID} +- rc=$OCF_SUCCESS ++ super_ocf_log info "FLOW $FUNCNAME ($*)" ++ local output="" ++ local rc=0 ++ if [ -f $HA_RSCTMP/SAPHana/SAPTopologyON ]; then ++ rm $HA_RSCTMP/SAPHana/SAPTopologyON ++ fi ++ rm $HA_RSCTMP/SAPHana/SAPTopologyON.${SID} ++ rc=$OCF_SUCCESS + +- super_ocf_log info "FLOW $FUNCNAME rc=$rc" +- return $rc ++ super_ocf_log info "FLOW $FUNCNAME rc=$rc" ++ return $rc + } + + diff --git a/SPECS/resource-agents-sap-hana.spec b/SPECS/resource-agents-sap-hana.spec new file mode 100644 index 0000000..85868b5 --- /dev/null +++ b/SPECS/resource-agents-sap-hana.spec @@ -0,0 +1,133 @@ +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. +# + +# Below is the script used to generate a new source file +# from the SAPHanaSR upstream git repo. +# +# TAG=$(git log --pretty="format:%h" -n 1) +# distdir="SAPHanaSR-${TAG}" +# TARFILE="${distdir}.tar.gz" +# rm -rf $TARFILE $distdir +# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE +# + +%global upstream_prefix ClusterLabs-resource-agents +%global upstream_version e711383f + +%global saphana_prefix SAPHanaSR +%global saphana_hash 2067519 + +Name: resource-agents-sap-hana +Summary: SAP HANA cluster resource agents +Epoch: 1 +Version: 0.152.22 +Release: 1%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +License: GPLv2+ +URL: https://github.com/fmherschel/SAPHanaSR +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} +Group: System Environment/Base +%else +Group: Productivity/Clustering/HA +%endif +Source0: %{upstream_prefix}-%{upstream_version}.tar.gz +Source1: %{saphana_prefix}-%{saphana_hash}.tar.gz +Patch0: bz1738205-SAPHanaTopology-make-multi-instance-aware.patch + +BuildArch: noarch + +BuildRequires: automake autoconf gcc +BuildRequires: perl-interpreter python3-devel +BuildRequires: libxslt glib2-devel + +%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} +BuildRequires: docbook-style-xsl docbook-dtds +%endif + +Requires: resource-agents >= 4.1.1 + +Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk +Requires: perl + +%description +The SAP HANA resource agents interface with Pacemaker to allow +SAP instances to be managed in a cluster environment. + +%prep +%setup -q -n %{upstream_prefix}-%{upstream_version} +%setup -T -D -a 1 -n %{upstream_prefix}-%{upstream_version} + +%patch0 -p1 + +# add SAPHana agents to Makefile.am +mv %{saphana_prefix}-%{saphana_hash}/SAPHana/ra/SAPHana* heartbeat +sed -i -e '/ SAPInstance \\/a\ SAPHana \\\n SAPHanaTopology \\' heartbeat/Makefile.am +sed -i -e '/ ocf_heartbeat_SAPInstance.7 \\/a\ ocf_heartbeat_SAPHana.7 \\\n ocf_heartbeat_SAPHanaTopology.7 \\' doc/man/Makefile.am + +%build +if [ ! -f configure ]; then + ./autogen.sh +fi + +%global rasset linux-ha + +%configure BASH_SHELL="/bin/bash" \ + PYTHON="%{__python3}" \ + %{conf_opt_fatal} \ + --with-pkg-name=%{name} \ + --with-ras-set=%{rasset} + +%if %{defined jobs} +JFLAGS="$(echo '-j%{jobs}')" +%else +JFLAGS="$(echo '%{_smp_mflags}')" +%endif + +make $JFLAGS + +%install +make install DESTDIR=%{buildroot} + +# remove other agents +find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAPHana*" -exec rm {} \; +find %{buildroot}/%{_mandir} -type f ! -iname "*SAPHana*" -exec rm {} \; + +## tree fixup +# remove docs (there is only one and they should come from doc sections in files) +rm -rf %{buildroot}/usr/share/doc/resource-agents + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_usr}/lib/ocf/resource.d/heartbeat/SAPHana* +%{_mandir}/man7/*SAP* + +%exclude /etc +%exclude /usr/include +%exclude /usr/lib/debug +%exclude /usr/lib/systemd +%exclude /usr/lib/tmpfiles.d +%exclude /usr/libexec +%exclude /usr/sbin +%exclude /usr/share/%{name} +%exclude /usr/src + +%changelog +* Fri Sep 6 2019 Oyvind Albrigtsen - 0.152.22-1 +- SAPHanaTopology: make multi instance aware (MCOS) + + Resolves: rhbz#1738205 + +* Tue Jul 30 2019 Oyvind Albrigtsen - 0.152.21-4 +- Initial build as separate package + + Resolves: rhbz#1688344