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

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