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

07c40c
#
07c40c
# All modifications and additions to the file contributed by third parties
07c40c
# remain the property of their copyright owners, unless otherwise agreed
07c40c
# upon. The license for this file, and modifications and additions to the
07c40c
# file, is the same license as for the pristine package itself (unless the
07c40c
# license for the pristine package is not an Open Source License, in which
07c40c
# case the license is the MIT License). An "Open Source License" is a
07c40c
# license that conforms to the Open Source Definition (Version 1.9)
07c40c
# published by the Open Source Initiative.
07c40c
#
07c40c
07c40c
# Below is the script used to generate a new source file
07c40c
# from the SAPHanaSR-ScaleOut upstream git repo.
07c40c
#
07c40c
# TAG=$(git log --pretty="format:%h" -n 1)
07c40c
# distdir="SAPHanaSR-ScaleOut-${TAG}"
07c40c
# TARFILE="${distdir}.tar.gz"
07c40c
# rm -rf $TARFILE $distdir
07c40c
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
07c40c
#
07c40c
07c40c
%global upstream_prefix ClusterLabs-resource-agents
07c40c
%global upstream_version e711383f
07c40c
07c40c
%global saphana_scaleout_prefix SAPHanaSR-ScaleOut
07c40c
%global saphana_scaleout_hash a77e8c6
07c40c
07c40c
Name:		resource-agents-sap-hana-scaleout
07c40c
Summary:	SAP HANA Scale-Out cluster resource agents
07c40c
Epoch:		1
8bc804
Version:	0.164.0
8bc804
Release:	1%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
07c40c
License:	GPLv2+
07c40c
URL:		https://github.com/SUSE/SAPHanaSR-ScaleOut
07c40c
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
07c40c
Group:		System Environment/Base
07c40c
%else
07c40c
Group:		Productivity/Clustering/HA
07c40c
%endif
07c40c
Source0:	%{upstream_prefix}-%{upstream_version}.tar.gz
07c40c
Source1:	%{saphana_scaleout_prefix}-%{saphana_scaleout_hash}.tar.gz
8bc804
Patch0: 	SAPHanaSR-monitor-fix-tolower-error.patch
8bc804
Patch1: 	bz1827107-sap-hana-scaleout-1-timeouts-recommendations.patch
8bc804
Patch2: 	bz1827107-sap-hana-scaleout-2-timeouts-recommendations.patch
8bc804
Patch3: 	bz1827107-sap-hana-scaleout-3-fixes.patch
8bc804
Patch4: 	bz1827107-sap-hana-scaleout-4-sapstartsrv-fix.patch
07c40c
07c40c
BuildArch:	noarch
07c40c
07c40c
BuildRequires:	automake autoconf gcc
07c40c
BuildRequires:	perl-interpreter python3-devel
07c40c
BuildRequires:	libxslt glib2-devel
07c40c
07c40c
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
07c40c
BuildRequires: docbook-style-xsl docbook-dtds
07c40c
%endif
07c40c
07c40c
Requires:	resource-agents >= 4.1.1
07c40c
Conflicts:	resource-agents-sap-hana
07c40c
07c40c
Requires:	/bin/bash /usr/bin/grep /bin/sed /bin/gawk
07c40c
Requires:	perl
07c40c
07c40c
%description
07c40c
The SAP HANA Scale-Out resource agents interface with Pacemaker
07c40c
to allow SAP HANA Scale-Out instances to be managed in a cluster
07c40c
environment.
07c40c
07c40c
%prep
07c40c
%setup -q -n %{upstream_prefix}-%{upstream_version}
07c40c
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
07c40c
07c40c
%patch0 -p1
8bc804
%patch1 -p1
8bc804
%patch2 -p1
8bc804
%patch3 -p1
8bc804
%patch4 -p1
07c40c
07c40c
# add SAPHana agents to Makefile.am
07c40c
mv %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/ra/SAPHana* heartbeat
07c40c
sed -i -e '/			SAPInstance		\\/a\			SAPHanaController			\\\n			SAPHanaTopology		\\' heartbeat/Makefile.am
07c40c
sed -i -e '/                          ocf_heartbeat_SAPInstance.7 \\/a\                          ocf_heartbeat_SAPHanaController.7 \\\n                          ocf_heartbeat_SAPHanaTopology.7 \\' doc/man/Makefile.am
07c40c
07c40c
cp %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/doc/LICENSE .
07c40c
07c40c
%build
07c40c
if [ ! -f configure ]; then
07c40c
	./autogen.sh
07c40c
fi
07c40c
07c40c
%global rasset linux-ha
07c40c
07c40c
%configure BASH_SHELL="/bin/bash" \
07c40c
	PYTHON="%{__python3}" \
07c40c
	%{conf_opt_fatal} \
07c40c
%if %{defined _unitdir}
07c40c
    --with-systemdsystemunitdir=%{_unitdir} \
07c40c
%endif
07c40c
%if %{defined _tmpfilesdir}
07c40c
    --with-systemdtmpfilesdir=%{_tmpfilesdir} \
07c40c
    --with-rsctmpdir=/run/resource-agents \
07c40c
%endif
07c40c
	--with-pkg-name=%{name} \
07c40c
	--with-ras-set=%{rasset}
07c40c
07c40c
%if %{defined jobs}
07c40c
JFLAGS="$(echo '-j%{jobs}')"
07c40c
%else
07c40c
JFLAGS="$(echo '%{_smp_mflags}')"
07c40c
%endif
07c40c
07c40c
make $JFLAGS
07c40c
07c40c
%install
07c40c
make install DESTDIR=%{buildroot}
07c40c
07c40c
# remove other agents
07c40c
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAPHana*" -exec rm {} \;
07c40c
find %{buildroot}/%{_mandir} -type f ! -iname "*SAPHana*" -exec rm {} \;
07c40c
07c40c
install -m 0755 %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/bin/{SAPHanaSR-monitor,SAPHanaSR-showAttr} %{buildroot}/%{_sbindir}
07c40c
mkdir %{buildroot}/%{_usr}/lib/SAPHanaSR-ScaleOut
07c40c
install -m 0444 %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/test/SAPHanaSRTools.pm %{buildroot}/%{_usr}/lib/SAPHanaSR-ScaleOut/SAPHanaSRTools.pm
07c40c
mkdir -p %{buildroot}/%{_datadir}/SAPHanaSR-ScaleOut/samples
07c40c
install -m 0644 %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/srHook/SAPHanaSR.py %{buildroot}/%{_datadir}/SAPHanaSR-ScaleOut
07c40c
install -m 0444 %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/crmconfig/* %{buildroot}/%{_datadir}/SAPHanaSR-ScaleOut/samples
07c40c
install -m 0444 %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/srHook/global.ini %{buildroot}/%{_datadir}/SAPHanaSR-ScaleOut/samples
07c40c
gzip %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/man/SAPHanaSR*.?
07c40c
cp %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/man/SAPHanaSR*.7.gz %{buildroot}/%{_mandir}/man7
07c40c
cp %{saphana_scaleout_prefix}-%{saphana_scaleout_hash}/SAPHana/man/SAPHanaSR*.8.gz %{buildroot}/%{_mandir}/man8
07c40c
07c40c
## tree fixup
07c40c
# remove docs (there is only one and they should come from doc sections in files)
07c40c
rm -rf %{buildroot}/usr/share/doc/resource-agents
07c40c
07c40c
%clean
07c40c
rm -rf %{buildroot}
07c40c
07c40c
%files
07c40c
%defattr(-,root,root)
07c40c
%license LICENSE
07c40c
%{_usr}/lib/ocf/resource.d/heartbeat/SAPHana*
07c40c
%{_mandir}/man7/*SAPHana*
07c40c
%{_mandir}/man8/*SAPHana*
07c40c
%{_sbindir}/SAPHanaSR*
07c40c
%{_usr}/lib/SAPHanaSR-ScaleOut
07c40c
%{_datadir}/SAPHanaSR-ScaleOut
07c40c
07c40c
%exclude /etc
07c40c
%exclude /usr/include
07c40c
%exclude /usr/lib/debug
07c40c
%exclude /usr/lib/systemd
07c40c
%exclude /usr/lib/tmpfiles.d
07c40c
%exclude /usr/libexec
07c40c
%exclude /usr/sbin/ldirectord
07c40c
%exclude /usr/sbin/ocf*
07c40c
%exclude /usr/share/%{name}
07c40c
%exclude /usr/src
07c40c
07c40c
%changelog
8bc804
* Thu Apr 30 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.164.0-1
8bc804
- Set default timeouts based on recommendations and a couple of bugfixes
8bc804
8bc804
  Resolves: rhbz#1827107
8bc804
07c40c
* Tue Feb 18 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.163.2-6
07c40c
- Add Conflicts: to avoid future CI gating errors
07c40c
07c40c
  Resolves: rhbz#1802995
07c40c
07c40c
* Thu Jun 27 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.163.2-5
07c40c
- Initial build as separate package
07c40c
07c40c
  Resolves: rhbz#1705765