Blame SPECS/resource-agents-sap.spec

21d3dd
#
21d3dd
# All modifications and additions to the file contributed by third parties
21d3dd
# remain the property of their copyright owners, unless otherwise agreed
21d3dd
# upon. The license for this file, and modifications and additions to the
21d3dd
# file, is the same license as for the pristine package itself (unless the
21d3dd
# license for the pristine package is not an Open Source License, in which
21d3dd
# case the license is the MIT License). An "Open Source License" is a
21d3dd
# license that conforms to the Open Source Definition (Version 1.9)
21d3dd
# published by the Open Source Initiative.
21d3dd
#
21d3dd
21d3dd
# Below is the script used to generate a new source file
21d3dd
# from the resource-agent upstream git repo.
21d3dd
#
21d3dd
# TAG=$(git log --pretty="format:%h" -n 1)
21d3dd
# distdir="ClusterLabs-resource-agents-${TAG}"
21d3dd
# TARFILE="${distdir}.tar.gz"
21d3dd
# rm -rf $TARFILE $distdir
21d3dd
# git archive --prefix=$distdir/ HEAD | gzip > $TARFILE
21d3dd
#
21d3dd
21d3dd
%global upstream_prefix ClusterLabs-resource-agents
1f2bf3
%global upstream_version fd0720f7
21d3dd
21d3dd
%global sap_script_prefix sap_cluster_connector
21d3dd
%global sap_script_hash 0015fe2
21d3dd
21d3dd
# Whether this platform defaults to using systemd as an init system
21d3dd
# (needs to be evaluated prior to BuildRequires being enumerated and
21d3dd
# installed as it's intended to conditionally select some of these, and
21d3dd
# for that there are only few indicators with varying reliability:
21d3dd
# - presence of systemd-defined macros (when building in a full-fledged
21d3dd
#   environment, which is not the case with ordinary mock-based builds)
21d3dd
# - systemd-aware rpm as manifested with the presence of particular
21d3dd
#   macro (rpm itself will trivially always be present when building)
21d3dd
# - existence of /usr/lib/os-release file, which is something heavily
21d3dd
#   propagated by systemd project
21d3dd
# - when not good enough, there's always a possibility to check
21d3dd
#   particular distro-specific macros (incl. version comparison)
21d3dd
%define systemd_native (%{?_unitdir:1}%{!?_unitdir:0}%{nil \
21d3dd
  } || %{?__transaction_systemd_inhibit:1}%{!?__transaction_systemd_inhibit:0}%{nil \
21d3dd
  } || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?))
21d3dd
21d3dd
# determine the ras-set to process based on configure invokation
21d3dd
%bcond_with rgmanager
21d3dd
%bcond_without linuxha
21d3dd
21d3dd
Name:		resource-agents-sap
21d3dd
Summary:	SAP cluster resource agents
1f2bf3
Version:	4.10.0
438237
Release:	3%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
21d3dd
License:	GPLv2+
21d3dd
URL:		https://github.com/ClusterLabs/resource-agents
21d3dd
Source0:	%{upstream_prefix}-%{upstream_version}.tar.gz
21d3dd
Source1:	%{sap_script_prefix}-%{sap_script_hash}.tar.gz
438237
Patch0:   bz2151293-SAPInstance-improve-killsap-logic.patch
21d3dd
21d3dd
BuildArch:	noarch
21d3dd
21d3dd
# Build dependencies
21d3dd
BuildRequires: make
21d3dd
BuildRequires: automake autoconf pkgconfig gcc
21d3dd
BuildRequires: libxslt glib2-devel
21d3dd
BuildRequires: systemd
21d3dd
BuildRequires: which
21d3dd
21d3dd
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
21d3dd
BuildRequires: python3-devel
21d3dd
%else
21d3dd
BuildRequires: python-devel
21d3dd
%endif
21d3dd
21d3dd
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel}
21d3dd
BuildRequires: docbook-style-xsl docbook-dtds
21d3dd
%if 0%{?rhel} == 0
21d3dd
BuildRequires: libnet-devel
21d3dd
%endif
21d3dd
%endif
21d3dd
21d3dd
%if 0%{?suse_version}
21d3dd
BuildRequires:  libnet-devel
21d3dd
BuildRequires:  libglue-devel
21d3dd
BuildRequires:  libxslt docbook_4 docbook-xsl-stylesheets
21d3dd
%endif
21d3dd
21d3dd
Requires:	resource-agents >= 4.8.0
21d3dd
21d3dd
Requires: /bin/bash /usr/bin/grep /bin/sed /bin/gawk
21d3dd
21d3dd
%description
21d3dd
The SAP resource agents interface with Pacemaker to allow
21d3dd
SAP instances to be managed in a cluster environment.
21d3dd
21d3dd
%prep
21d3dd
%setup -q -n %{upstream_prefix}-%{upstream_version}
21d3dd
%setup -q -T -D -a 1 -n %{upstream_prefix}-%{upstream_version}
438237
%patch0 -p1
21d3dd
21d3dd
%build
21d3dd
if [ ! -f configure ]; then
21d3dd
	./autogen.sh
21d3dd
fi
21d3dd
21d3dd
%if 0%{?fedora} >= 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
21d3dd
CFLAGS="$(echo '%{optflags}')"
21d3dd
%global conf_opt_fatal "--enable-fatal-warnings=no"
21d3dd
%else
21d3dd
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
21d3dd
%global conf_opt_fatal "--enable-fatal-warnings=yes"
21d3dd
%endif
21d3dd
21d3dd
%if %{with rgmanager}
21d3dd
%global rasset rgmanager
21d3dd
%endif
21d3dd
%if %{with linuxha}
21d3dd
%global rasset linux-ha
21d3dd
%endif
21d3dd
%if %{with rgmanager} && %{with linuxha}
21d3dd
%global rasset all
21d3dd
%endif
21d3dd
21d3dd
export CFLAGS
21d3dd
21d3dd
%configure \
21d3dd
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
21d3dd
	PYTHON="%{__python3}" \
21d3dd
%endif
21d3dd
	%{conf_opt_fatal} \
21d3dd
%if %{defined _unitdir}
21d3dd
    --with-systemdsystemunitdir=%{_unitdir} \
21d3dd
%endif
21d3dd
%if %{defined _tmpfilesdir}
21d3dd
    --with-systemdtmpfilesdir=%{_tmpfilesdir} \
21d3dd
    --with-rsctmpdir=/run/resource-agents \
21d3dd
%endif
21d3dd
	--with-pkg-name=resource-agents \
21d3dd
	--with-ras-set=%{rasset}
21d3dd
21d3dd
%if %{defined jobs}
21d3dd
JFLAGS="$(echo '-j%{jobs}')"
21d3dd
%else
21d3dd
JFLAGS="$(echo '%{_smp_mflags}')"
21d3dd
%endif
21d3dd
21d3dd
make $JFLAGS
21d3dd
21d3dd
%install
21d3dd
rm -rf %{buildroot}
21d3dd
make install DESTDIR=%{buildroot}
21d3dd
21d3dd
# remove other agents
21d3dd
find %{buildroot}/usr/lib/ocf ! -type d ! -iname "SAP*" -exec rm {} \;
21d3dd
find %{buildroot}/%{_mandir} -type f ! -iname "*SAP*" -exec rm {} \;
21d3dd
21d3dd
cp %{sap_script_prefix}-%{sap_script_hash}/redhat/sap_redhat_cluster_connector %{buildroot}/%{_sbindir}/sap_redhat_cluster_connector
21d3dd
21d3dd
## tree fixup
21d3dd
# remove docs (there is only one and they should come from doc sections in files)
21d3dd
rm -rf %{buildroot}/usr/share/doc/resource-agents
21d3dd
21d3dd
%files
21d3dd
%defattr(-,root,root)
1f2bf3
%{_usr}/lib/ocf/resource.d/heartbeat/SAP*
1f2bf3
%{_usr}/lib/ocf/lib/heartbeat/sap*
21d3dd
%{_mandir}/man7/*SAP*
21d3dd
%{_sbindir}/sap_redhat_cluster_connector
21d3dd
21d3dd
%exclude /etc
21d3dd
%exclude /usr/include
1f2bf3
%exclude %{_usr}/lib/debug
1f2bf3
%exclude %{_usr}/lib/systemd
1f2bf3
%exclude %{_usr}/lib/tmpfiles.d
21d3dd
%exclude /usr/libexec/heartbeat
21d3dd
%exclude /usr/sbin/ldirectord
21d3dd
%exclude /usr/sbin/ocf*
21d3dd
%exclude /usr/share/resource-agents
21d3dd
%exclude /usr/share/pkgconfig/resource-agents.pc
21d3dd
%exclude /usr/src
21d3dd
21d3dd
%changelog
438237
* Wed Dec 07 2022 Janine Fuchs <jfuchs@redhat.com> - 4.10.0-3
438237
- SAPInstance: be more resilient against broken kill.sap files
438237
438237
  Resolves: rhbz#2151293
438237
1f2bf3
* Mon Nov 22 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-2
1f2bf3
- Rebase to resource-agents 4.10.0 upstream release.
1f2bf3
1f2bf3
  Resolves: rhbz#2024660
1f2bf3
21d3dd
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 4.8.0-2.1
21d3dd
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
21d3dd
  Related: rhbz#1991688
21d3dd
21d3dd
* Tue Jun 22 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.8.0-2
21d3dd
- Add CI gating tests
21d3dd
21d3dd
  Resolves: rhbz#1960245
21d3dd
21d3dd
* Mon Jun  7 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.8.0-1
21d3dd
- Rebase to resource-agents 4.8.0 upstream release.
21d3dd
21d3dd
* Fri Apr 17 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-30
21d3dd
- use safe temp file location
21d3dd
21d3dd
  Resolves: rhbz#1817439
21d3dd
21d3dd
* Thu Jan 23 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-29
21d3dd
- SAPInstance: add reload-action
21d3dd
21d3dd
  Resolves: rhbz#1751949
21d3dd
21d3dd
* Tue Jun 18 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.1.1-28
21d3dd
- Initial build as separate package
21d3dd
21d3dd
  Resolves: rhbz#1688341