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

79895e
#
79895e
# All modifications and additions to the file contributed by third parties
79895e
# remain the property of their copyright owners, unless otherwise agreed
79895e
# upon. The license for this file, and modifications and additions to the
79895e
# file, is the same license as for the pristine package itself (unless the
79895e
# license for the pristine package is not an Open Source License, in which
79895e
# case the license is the MIT License). An "Open Source License" is a
79895e
# license that conforms to the Open Source Definition (Version 1.9)
79895e
# published by the Open Source Initiative.
79895e
#
79895e
79895e
# Below is the script used to generate a new source file
79895e
# from the SAPHanaSR upstream git repo.
79895e
#
79895e
# TAG=$(git log --pretty="format:%h" -n 1)
79895e
# distdir="SAPHanaSR-${TAG}"
79895e
# TARFILE="${distdir}.tar.gz"
79895e
# rm -rf $TARFILE $distdir
79895e
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
79895e
#
79895e
79895e
%global upstream_prefix ClusterLabs-resource-agents
79895e
%global upstream_version e76b7d3a
79895e
79895e
%global saphana_prefix SAPHanaSR
79895e
%global saphana_version 2dea8fe
79895e
79895e
# Whether this platform defaults to using systemd as an init system
79895e
# (needs to be evaluated prior to BuildRequires being enumerated and
79895e
# installed as it's intended to conditionally select some of these, and
79895e
# for that there are only few indicators with varying reliability:
79895e
# - presence of systemd-defined macros (when building in a full-fledged
79895e
#   environment, which is not the case with ordinary mock-based builds)
79895e
# - systemd-aware rpm as manifested with the presence of particular
79895e
#   macro (rpm itself will trivially always be present when building)
79895e
# - existence of /usr/lib/os-release file, which is something heavily
79895e
#   propagated by systemd project
79895e
# - when not good enough, there's always a possibility to check
79895e
#   particular distro-specific macros (incl. version comparison)
79895e
%define systemd_native (%{?_unitdir:1}%{!?_unitdir:0}%{nil \
79895e
  } || %{?__transaction_systemd_inhibit:1}%{!?__transaction_systemd_inhibit:0}%{nil \
79895e
  } || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?))
79895e
79895e
# determine the ras-set to process based on configure invokation
79895e
%bcond_with rgmanager
79895e
%bcond_without linuxha
79895e
79895e
Name:		resource-agents-sap-hana
79895e
Summary:	SAP HANA cluster resource agents
79895e
Epoch:		1
79895e
Version:	0.155.0
06c749
Release:	4%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
79895e
License:	GPLv2+
79895e
URL:		https://github.com/SUSE/SAPHanaSR
79895e
Source0:	%{upstream_prefix}-%{upstream_version}.tar.gz
79895e
Source1:	%{saphana_prefix}-%{saphana_version}.tar.gz
a99511
Patch0:		bz2027423-1-SAPHana-remove-HANA_CALL_TIMEOUT-parameter.patch
a99511
Patch1:		bz2027423-2-SAPHanaTopology-remove-HANA_CALL_TIMEOUT-parameter.patch
06c749
Patch2:		bz2027423-3-SAPHana-SAPHanaTopology-fix-metadata-version.patch
79895e
79895e
BuildArch:	noarch
79895e
79895e
# Build dependencies
79895e
BuildRequires: make
79895e
BuildRequires: automake autoconf pkgconfig gcc
79895e
BuildRequires: perl-interpreter
79895e
BuildRequires: libxslt glib2-devel
79895e
BuildRequires: systemd
79895e
BuildRequires: which
79895e
79895e
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
79895e
BuildRequires: python3-devel
79895e
%else
79895e
BuildRequires: python-devel
79895e
%endif
79895e
79895e
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
79895e
BuildRequires: docbook-style-xsl docbook-dtds
79895e
%if 0%{?rhel} == 0
79895e
BuildRequires: libnet-devel
79895e
%endif
79895e
%endif
79895e
79895e
%if 0%{?suse_version}
79895e
BuildRequires:  libnet-devel
79895e
BuildRequires:  libglue-devel
79895e
BuildRequires:  libxslt docbook_4 docbook-xsl-stylesheets
79895e
%endif
79895e
79895e
Requires:	resource-agents >= 4.8.0
79895e
Conflicts:	%{name}-scaleout
79895e
79895e
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
79895e
Requires: perl
79895e
79895e
%description
79895e
The SAP HANA resource agents interface with Pacemaker to allow
79895e
SAP instances to be managed in a cluster environment.
79895e
79895e
%prep
79895e
%setup -q -n %{upstream_prefix}-%{upstream_version}
79895e
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
79895e
79895e
# add SAPHana agents to Makefile.am
79895e
mv %{saphana_prefix}-%{saphana_version}/ra/SAPHana* heartbeat
79895e
sed -i -e '/			SAPInstance		\\/a\			SAPHana			\\\n			SAPHanaTopology		\\' heartbeat/Makefile.am
79895e
sed -i -e '/                          ocf_heartbeat_SAPInstance.7 \\/a\                          ocf_heartbeat_SAPHana.7 \\\n                          ocf_heartbeat_SAPHanaTopology.7 \\' doc/man/Makefile.am
79895e
79895e
# change provider company
79895e
sed -i -e 's/\("provider_company": \)"SUSE"/\1"Red Hat"/g' %{saphana_prefix}-%{saphana_version}/srHook/SAPHanaSR.py
79895e
a99511
%patch0 -p1
a99511
%patch1 -p1
06c749
%patch2 -p1
a99511
79895e
%build
79895e
if [ ! -f configure ]; then
79895e
	./autogen.sh
79895e
fi
79895e
79895e
%if 0%{?fedora} >= 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
79895e
CFLAGS="$(echo '%{optflags}')"
79895e
%global conf_opt_fatal "--enable-fatal-warnings=no"
79895e
%else
79895e
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
79895e
%global conf_opt_fatal "--enable-fatal-warnings=yes"
79895e
%endif
79895e
79895e
%if %{with rgmanager}
79895e
%global rasset rgmanager
79895e
%endif
79895e
%if %{with linuxha}
79895e
%global rasset linux-ha
79895e
%endif
79895e
%if %{with rgmanager} && %{with linuxha}
79895e
%global rasset all
79895e
%endif
79895e
79895e
export CFLAGS
79895e
79895e
%configure \
79895e
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
79895e
	PYTHON="%{__python3}" \
79895e
%endif
79895e
	%{conf_opt_fatal} \
79895e
%if %{defined _unitdir}
79895e
    --with-systemdsystemunitdir=%{_unitdir} \
79895e
%endif
79895e
%if %{defined _tmpfilesdir}
79895e
    --with-systemdtmpfilesdir=%{_tmpfilesdir} \
79895e
    --with-rsctmpdir=/run/resource-agents \
79895e
%endif
79895e
	--with-pkg-name=resource-agents \
79895e
	--with-ras-set=%{rasset}
79895e
79895e
%if %{defined jobs}
79895e
JFLAGS="$(echo '-j%{jobs}')"
79895e
%else
79895e
JFLAGS="$(echo '%{_smp_mflags}')"
79895e
%endif
79895e
79895e
make $JFLAGS
79895e
79895e
%install
79895e
rm -rf %{buildroot}
79895e
make install DESTDIR=%{buildroot}
79895e
79895e
# remove other agents
79895e
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAPHana*" -exec rm {} \;
79895e
find %{buildroot}/%{_mandir} -type f ! -iname "*SAPHana*" -exec rm {} \;
79895e
79895e
mkdir %{buildroot}/%{_datadir}/SAPHanaSR
79895e
cp -r %{saphana_prefix}-%{saphana_version}/srHook %{buildroot}/%{_datadir}/SAPHanaSR
79895e
79895e
## tree fixup
79895e
# remove docs (there is only one and they should come from doc sections in files)
79895e
rm -rf %{buildroot}/usr/share/doc/resource-agents
79895e
79895e
%files
79895e
%defattr(-,root,root)
79895e
%{_usr}/lib/ocf/resource.d/heartbeat/SAPHana*
79895e
%{_mandir}/man7/*SAP*
79895e
%{_datadir}/SAPHanaSR
79895e
79895e
%exclude /etc
79895e
%exclude /usr/include
79895e
%exclude /usr/lib/debug
79895e
%exclude /usr/lib/systemd
79895e
%exclude /usr/lib/tmpfiles.d
79895e
%exclude /usr/libexec
79895e
%exclude /usr/sbin/ldirectord
79895e
%exclude /usr/sbin/ocf*
79895e
%exclude /usr/share/resource-agents
79895e
%exclude /usr/share/pkgconfig/resource-agents.pc
79895e
%exclude /usr/src
79895e
79895e
%changelog
06c749
* Thu Jan 20 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.155.0-4
a99511
- SAPHana/SAPHanaTopology: remove HANA_CALL_TIMEOUT parameter from
a99511
  metadata
a99511
a99511
  Resolves: rhbz#2027423
a99511
79895e
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:0.155.0-2.1
79895e
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
79895e
  Related: rhbz#1991688
79895e
79895e
* Mon Jun 14 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.155.0-2
79895e
- Add CI gating tests
79895e
79895e
  Resolves: rhbz#1960247
79895e
79895e
* Mon Jun  7 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.155.0-1
79895e
- Rebase to SAPHanaSR 0.155.0 upstream release.
79895e
79895e
* Fri Feb 14 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.154.0-2
79895e
- Rebase to SAPHanaSR 0.154.0 upstream release.
79895e
79895e
  Resolves: rhbz#1802104
79895e
79895e
* Fri Sep  6 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.152.22-1
79895e
- SAPHanaTopology: make multi instance aware (MCOS)
79895e
79895e
  Resolves: rhbz#1738205
79895e
79895e
* Tue Jul 30 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.152.21-4
79895e
- Initial build as separate package
79895e
79895e
  Resolves: rhbz#1688344