Blame SPECS/resource-agents-sap-hana.spec

75ebab
#
75ebab
# All modifications and additions to the file contributed by third parties
75ebab
# remain the property of their copyright owners, unless otherwise agreed
75ebab
# upon. The license for this file, and modifications and additions to the
75ebab
# file, is the same license as for the pristine package itself (unless the
75ebab
# license for the pristine package is not an Open Source License, in which
75ebab
# case the license is the MIT License). An "Open Source License" is a
75ebab
# license that conforms to the Open Source Definition (Version 1.9)
75ebab
# published by the Open Source Initiative.
75ebab
#
75ebab
75ebab
# Below is the script used to generate a new source file
75ebab
# from the SAPHanaSR upstream git repo.
75ebab
#
75ebab
# TAG=$(git log --pretty="format:%h" -n 1)
75ebab
# distdir="SAPHanaSR-${TAG}"
75ebab
# TARFILE="${distdir}.tar.gz"
75ebab
# rm -rf $TARFILE $distdir
75ebab
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
75ebab
#
75ebab
75ebab
%global upstream_prefix ClusterLabs-resource-agents
75ebab
%global upstream_version e711383f
75ebab
75ebab
%global saphana_prefix SAPHanaSR
2787ec
%global saphana_version d1dde99
75ebab
75ebab
Name:		resource-agents-sap-hana
75ebab
Summary:	SAP HANA cluster resource agents
75ebab
Epoch:		1
2787ec
Version:	0.154.0
0959f3
Release:	2%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}.1
75ebab
License:	GPLv2+
2787ec
URL:		https://github.com/SUSE/SAPHanaSR
75ebab
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
75ebab
Group:		System Environment/Base
75ebab
%else
75ebab
Group:		Productivity/Clustering/HA
75ebab
%endif
75ebab
Source0:	%{upstream_prefix}-%{upstream_version}.tar.gz
2787ec
Source1:	%{saphana_prefix}-%{saphana_version}.tar.gz
0959f3
Patch0:		bz1984944-SAPHana-use-actual-mode.patch
75ebab
75ebab
BuildArch:	noarch
75ebab
75ebab
BuildRequires: automake autoconf gcc
75ebab
BuildRequires: perl-interpreter python3-devel
75ebab
BuildRequires: libxslt glib2-devel
75ebab
75ebab
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
75ebab
BuildRequires: docbook-style-xsl docbook-dtds
75ebab
%endif
75ebab
75ebab
Requires:	resource-agents >= 4.1.1
2787ec
Conflicts:	%{name}-scaleout
75ebab
75ebab
Requires:	/bin/bash /usr/bin/grep /bin/sed /bin/gawk
75ebab
Requires:	perl
75ebab
75ebab
%description
75ebab
The SAP HANA resource agents interface with Pacemaker to allow
75ebab
SAP instances to be managed in a cluster environment.
75ebab
75ebab
%prep
75ebab
%setup -q -n %{upstream_prefix}-%{upstream_version}
2787ec
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
75ebab
75ebab
# add SAPHana agents to Makefile.am
2787ec
mv %{saphana_prefix}-%{saphana_version}/ra/SAPHana* heartbeat
75ebab
sed -i -e '/			SAPInstance		\\/a\			SAPHana			\\\n			SAPHanaTopology		\\' heartbeat/Makefile.am
75ebab
sed -i -e '/                          ocf_heartbeat_SAPInstance.7 \\/a\                          ocf_heartbeat_SAPHana.7 \\\n                          ocf_heartbeat_SAPHanaTopology.7 \\' doc/man/Makefile.am
75ebab
2787ec
# change provider company
2787ec
sed -i -e 's/\("provider_company": \)"SUSE"/\1"Red Hat"/g' %{saphana_prefix}-%{saphana_version}/srHook/SAPHanaSR.py
2787ec
0959f3
%patch0 -p1
0959f3
75ebab
%build
75ebab
if [ ! -f configure ]; then
75ebab
	./autogen.sh
75ebab
fi
75ebab
75ebab
%global rasset linux-ha
75ebab
75ebab
%configure BASH_SHELL="/bin/bash" \
75ebab
	PYTHON="%{__python3}" \
75ebab
	%{conf_opt_fatal} \
75ebab
	--with-pkg-name=%{name} \
75ebab
	--with-ras-set=%{rasset}
75ebab
75ebab
%if %{defined jobs}
75ebab
JFLAGS="$(echo '-j%{jobs}')"
75ebab
%else
75ebab
JFLAGS="$(echo '%{_smp_mflags}')"
75ebab
%endif
75ebab
75ebab
make $JFLAGS
75ebab
75ebab
%install
75ebab
make install DESTDIR=%{buildroot}
75ebab
75ebab
# remove other agents
75ebab
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAPHana*" -exec rm {} \;
75ebab
find %{buildroot}/%{_mandir} -type f ! -iname "*SAPHana*" -exec rm {} \;
75ebab
2787ec
mkdir %{buildroot}/%{_datadir}/SAPHanaSR
2787ec
cp -r %{saphana_prefix}-%{saphana_version}/srHook %{buildroot}/%{_datadir}/SAPHanaSR
2787ec
75ebab
## tree fixup
75ebab
# remove docs (there is only one and they should come from doc sections in files)
75ebab
rm -rf %{buildroot}/usr/share/doc/resource-agents
75ebab
75ebab
%clean
75ebab
rm -rf %{buildroot}
75ebab
75ebab
%files
75ebab
%defattr(-,root,root)
75ebab
%{_usr}/lib/ocf/resource.d/heartbeat/SAPHana*
75ebab
%{_mandir}/man7/*SAP*
2787ec
%{_datadir}/SAPHanaSR
75ebab
75ebab
%exclude /etc
75ebab
%exclude /usr/include
75ebab
%exclude /usr/lib/debug
75ebab
%exclude /usr/lib/systemd
75ebab
%exclude /usr/lib/tmpfiles.d
75ebab
%exclude /usr/libexec
75ebab
%exclude /usr/sbin
75ebab
%exclude /usr/share/%{name}
75ebab
%exclude /usr/src
75ebab
75ebab
%changelog
0959f3
* Fri Jul 23 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.154.0-2.1
0959f3
- SAPHana: use actual_mode from global.ini and fallback to mode when
0959f3
  it's not set
0959f3
0959f3
  Resolves: rhbz#1984944
0959f3
2787ec
* Fri Feb 14 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.154.0-2
2787ec
- Rebase to SAPHanaSR 0.154.0 upstream release.
2787ec
2787ec
  Resolves: rhbz#1802104
2787ec
75ebab
* Fri Sep  6 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.152.22-1
75ebab
- SAPHanaTopology: make multi instance aware (MCOS)
75ebab
75ebab
  Resolves: rhbz#1738205
75ebab
75ebab
* Tue Jul 30 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.152.21-4
75ebab
- Initial build as separate package
75ebab
75ebab
  Resolves: rhbz#1688344