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

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