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

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