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

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