File fence-agents.spec of Package fence-agents.10129

#
# spec file for package fence-agents
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global plugin_dir %{_libdir}/stonith/plugins/rhcs

Name:           fence-agents
Summary:        Fence Agents for Pacemaker from RHCS
License:        GPL-2.0-only AND LGPL-2.1-only
Group:          Productivity/Clustering/HA
Version:        4.0.17
Release:        0
Url:            https://github.com/ClusterLabs/fence-agents
Source0:        %{name}-%{version}.tar.xz
# PATCH-FEATURE-UPSTREAM Backport fence_compute (fate#320346) (bsc#964748)
Patch1:         0001-Backport-fence_compute-to-4.0.17-fate-320346.patch
Patch2:         0002-fence_azure_arm-add-fencing-agent-for-Azure-Resource-Manager.patch 
Patch3:         0003-fence_azure_arm-move-option-definitions-to-define_new_opts.patch
Patch4:         0004-fence_azure_arm-remove-reboot-action-remove-sys.exit.patch
Patch5:         0005-fix-compile-error-for-azure_zrm.patch
Patch6:         0006-change-getopt-and-help-in-define_new_opts.patch
# Add fence_gce: Google Compute Engine fence support (fate#325539) (bsc#1088358)
Patch7:         0001-fence_gce-new-agent.patch
Patch8:         0001-Zone-Project-parameters-are-mandatory.patch
Patch9:         0001-fence_gce-Write-error-messages-to-log.patch
Patch10:        0001-fence_gce-fix-regression-missing-import-googleapicli.patch
Patch11:        0002-fence_gce-fix-regression-missing-import-oauth2client.patch
Patch12:        0003-fence_gce-use-default-credentials-from-googleapiclie.patch
Patch13:        0001-fence_gce-add-support-for-stackdriver-logging.patch
Patch14:        0002-fence_gce-set-project-and-zone-as-not-required.patch
Patch15:        0003-fence_gce-add-power-cycle-as-default-method.patch
Patch16:        0004-fence_gce-add-missing-imports-to-retrieve-the-projec.patch
Patch17:        0005-fence_gce-s-loging-stackdriver-logging.patch
Patch18:        0006-fence_gce-use-root-logger-for-stackdriver.patch
Patch19:        0007-fence_gce-minor-changes-in-logging.patch
Patch20:        0001-fence_gce-filter-call-to-aggregatedList.patch
Patch21:        fence_gce-Makefile.am.patch
Patch22:        fence_gce-python-shebang.patch
Patch23:        fence_gce-metadata-xml.patch
Patch24:        fence_compute-metadata-xml.patch

Requires:       python-curl
Requires:       python-openssl
Requires:       python-pexpect
Requires:       python-requests
Requires:       python-suds

BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  glibc-devel
BuildRequires:  libtool
BuildRequires:  libxml2-tools
BuildRequires:  libxslt
BuildRequires:  mozilla-nspr-devel
BuildRequires:  mozilla-nss-devel
BuildRequires:  perl
BuildRequires:  perl-Net-Telnet
BuildRequires:  pkg-config
BuildRequires:  python
BuildRequires:  python-curl
BuildRequires:  python-google-api-python-client
BuildRequires:  python-pexpect
BuildRequires:  python-requests
BuildRequires:  python-suds
BuildRequires:  python-xml
BuildRequires:  xz

%package -n fence-agents-unsupported
Summary:        Fence Agents for Pacemaker from RHCS
Group:          Productivity/Clustering/HA
Requires:       %{name} = %{version}-%{release}
# These are requirements of specific fencing agents; when moving the
# agent over to the supported main package, make sure to also shift the
# Requires if needed
Requires:       net-snmp
Requires:       openssh
Requires:       perl-Net-Telnet
Requires:       sg3_utils
Requires:       telnet
# for fence_vmware_soap:
Requires:       python-suds
# This is required by fence_virsh. Per discussion on fedora-devel
# switching from package to file based require.
Requires:       /usr/bin/virsh

# This is required by fence_ipmilan. it appears that the packages
# have changed Requires around. Make sure to get the right one.
Requires:       /usr/bin/ipmitool

%if 0%{?with_regression_tests}
BuildRequires:  time
%endif

%description
Fence Agents is a collection of scripts to handle remote power
management for several devices.



Authors:
--------
    Abhijith Das <adas@redhat.com>
    Adam Manthei <amanthei@redhat.com>
    A. J. Lewis <alewis@redhat.com>
    Alasdair G. Kergon <agk@redhat.com>
    Andrew Price <andy@andrewprice.me.uk>
    Benjamin Marzinski <bmarzins@redhat.com>
    Bob Peterson <rpeterso@redhat.com>
    Chris Feist <cfeist@redhat.com>
    Christine Caulfield <ccaulfie@redhat.com>
    Daniel Phillips <phillips@redhat.com>
    David Teigland <teigland@redhat.com>
    Fabio M. Di Nitto <fdinitto@redhat.com>
    James Parsons <jparsons@redhat.com>
    Joel Becker <joel.becker@oracle.com>
    Jonathan Brassow <jbrassow@redhat.com>
    jparsons <jparsons@redhat.com>
    Ken Preslan <kpreslan@redhat.com>
    Lon Hohberger <lhh@redhat.com>
    Marc - A. Dahlhaus <mad@wol.de>
    Marek 'marx' Grac <mgrac@redhat.com>
    Mark Hlawatschek <hlawatschek@atix.de>
    Michael Conrad Tadpol Tilstra <mtilstra@redhat.com>
    Patrick Caulfield <pcaulfie@redhat.com>
    Robert Peterson <rpeterso@redhat.com>
    Ross Vandegrift <ross@kallisti.us>
    Ryan McCabe <rmccabe@redhat.com>
    Ryan O'Hara <rohara@redhat.com>
    Stanko Kupcevic <kupcevic@redhat.com>
    Steven Whitehouse <swhiteho@redhat.com>
    Wendy Cheng <wcheng@redhat.com>

%description -n fence-agents-unsupported
Fence Agents is a collection of scripts to handle remote power
management for several devices.



Authors:
--------
    Abhijith Das <adas@redhat.com>
    Adam Manthei <amanthei@redhat.com>
    A. J. Lewis <alewis@redhat.com>
    Alasdair G. Kergon <agk@redhat.com>
    Andrew Price <andy@andrewprice.me.uk>
    Benjamin Marzinski <bmarzins@redhat.com>
    Bob Peterson <rpeterso@redhat.com>
    Chris Feist <cfeist@redhat.com>
    Christine Caulfield <ccaulfie@redhat.com>
    Daniel Phillips <phillips@redhat.com>
    David Teigland <teigland@redhat.com>
    Fabio M. Di Nitto <fdinitto@redhat.com>
    James Parsons <jparsons@redhat.com>
    Joel Becker <joel.becker@oracle.com>
    Jonathan Brassow <jbrassow@redhat.com>
    jparsons <jparsons@redhat.com>
    Ken Preslan <kpreslan@redhat.com>
    Lon Hohberger <lhh@redhat.com>
    Marc - A. Dahlhaus <mad@wol.de>
    Marek 'marx' Grac <mgrac@redhat.com>
    Mark Hlawatschek <hlawatschek@atix.de>
    Michael Conrad Tadpol Tilstra <mtilstra@redhat.com>
    Patrick Caulfield <pcaulfie@redhat.com>
    Robert Peterson <rpeterso@redhat.com>
    Ross Vandegrift <ross@kallisti.us>
    Ryan McCabe <rmccabe@redhat.com>
    Ryan O'Hara <rohara@redhat.com>
    Stanko Kupcevic <kupcevic@redhat.com>
    Steven Whitehouse <swhiteho@redhat.com>
    Wendy Cheng <wcheng@redhat.com>

%prep
%setup -q -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1

%build
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
export CFLAGS
./autogen.sh
%{configure}
make

%install
make install DESTDIR=%{buildroot}

## tree fix up
# fix libfence permissions
chmod 0755 %{buildroot}%{_datadir}/fence/*.py
# remove docs
rm -rf %{buildroot}/usr/share/doc/fence-agents
# create links to agents in the plugins dir
mkdir -p %{buildroot}%{plugin_dir}
ln -s %{_sbindir}/fence_cisco_ucs %{buildroot}%{plugin_dir}

%if 0%{?with_regression_tests}
%check
make check
PYTHONPATH=fence/agents/lib python fence/agents/lib/tests/test_fencing.py
%endif

%clean
if
  [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]
then
  rm -rf $RPM_BUILD_ROOT
fi

%files
%defattr(-,root,root,-)
%doc doc/COPYING.* doc/COPYRIGHT doc/README.licence
#%%dir %%{_sysconfdir}/cluster
%dir %{plugin_dir}
%dir %{_libdir}/stonith/plugins
%dir %{_libdir}/stonith
%{_datadir}/fence
%{_datadir}/cluster
#%%{_sbindir}/fence_cisco_ucs
#%%{_mandir}/man8/fence_cisco_ucs*
%{plugin_dir}/fence_cisco_ucs

#%%files -n fence-agents-unsupported
#%%defattr(-,root,root,-)
#%%config(noreplace) %%{_sysconfdir}/cluster/fence_na.conf
%{_sbindir}/fence_*
#%%exclude %%{_sbindir}/fence_cisco_ucs
%exclude %{_sbindir}/fence_dummy
%exclude %{_mandir}/man8/fence_dummy*
%{_mandir}/man8/fence_*
#%%exclude %%{_mandir}/man8/fence_cisco_ucs*
%{_libexecdir}/fence_*

%changelog
openSUSE Build Service is sponsored by