File resource-agents.spec of Package resource-agents.10310

#
# spec file for package resource-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 https://bugs.opensuse.org/
#


Name:           resource-agents
Version:        4.0.1+git.1495055229.643177f1
Release:        0
Summary:        Open Source HA Reusable Cluster Resource Scripts
License:        GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
Group:          Productivity/Clustering/HA
Url:            http://linux-ha.org/
Source:         resource-agents-%{version}.tar.xz
Source1:        resource-agents.conf
Source2:        monitoring-plugins-metadata.tar.bz2

# PATCH-FIX-OPENSUSE: activate VG with partial PV by default
Patch1:         0001-LVM-Default-partial_activation-to-true-in-SLE-HAE.patch
# PATCH-FIX-OPENSUSE: fix path to sm-notify
Patch2:         0002-nfsserver-fix-path-to-sm-notify.patch
# PATCH-FIX-OPENSUSE: ldirectord: don't create subsys lock
Patch3:         0003-ldirectord-don-t-create-subsys-lock.patch
# PATCH-FIX-OPENSUSE: Revert moving binaries to /usr/libexec
Patch4:         0004-Revert-Low-build-Move-binaries-in-usr-lib-heartbeat-.patch
# PATCH-FIX-OPENSUSE: Medium: CTDB: Use --logging syntax for ctdbd (bsc#981863)
Patch5:         0005-Medium-CTDB-Use-logging-syntax-for-ctdbd-bsc-981863.patch
# PATCH-FIX-OPENSUSE: Revert ocf_log: use same log format at pacemaker
Patch6:         0006-Revert-ocf_log-use-same-log-format-as-pacemaker.patch
# PATCH-FIX-UPSTREAM: Low: sg_persist: Read empty value when when no attribute exists (bsc#1048288)
Patch7:         0007-Low-sg_persist-Read-empty-value-when-when-no-attribu.patch
# PATCH-FIX-UPSTREAM: High: aws-vpc-route53: Add agent for AWS Route 53 (fate#322781)
Patch8:         0008-High-aws-vpc-route53-Add-agent-for-AWS-Route-53-fate.patch
# PATCH-FIX-UPSTREAM: Medium: Raid1: Handle case when mddev is a symlink(bsc#1047991)
Patch9:         0009-Medium-Raid1-Handle-case-when-mddev-is-a-symlink.patch
# PATCH-FIX-UPSTREAM: High: CTDB: Don't fail on empty directory (bsc#1052577)
Patch10:        0010-High-CTDB-Don-t-fail-on-empty-directory-bsc-1052577.patch
# PATCH-FIX-UPSTREAM: Low: ocf-shellfuncs: Avoid printing empty INFO messages (bsc#1053621)
Patch11:        0011-Low-ocf-shellfuncs-Avoid-printing-empty-INFO-message.patch
# PATCH-FIX-UPSTREAM: Low: SAPInstance: Mention monitor support in documentation (bsc#1051913)
Patch12:        0012-Low-SAPInstance-Mention-monitor-support-in-documenta.patch
# PATCH-FIX-UPSTREAM: High: galera: Backport fixes from upstream (bsc#1055017) (bsc#1056635)
Patch13:        0013-High-galera-Backport-galera-fixes-from-upstream-bsc-.patch
# PATCH-FIX-UPSTREAM: VirtualDomain: Properly migrate VMs on node shutdown (bsc#1074014)
Patch14:        0014-VirtualDomain-Properly-migrate-VMs-on-node-shutdown-.patch
# PATCH-FIX-UPSTREAM: Low: aws-vpc-route53: Fix missing ocf_log in log message
Patch15:        0015-Low-aws-vpc-route53-Fix-missing-ocf_log-in-log-messa.patch
# PATCH-FIX-UPSTREAM: High: aws-vpc-route53: Add agent for AWS Route 53 (fate#322781)
Patch16:        0016-High-aws-vpc-route53-Add-agent-for-AWS-Route-53-fate.patch
# PATCH-FIX-UPSTREAM: Low: aws-vpc-route53: Fix missing ocf_log in log message
Patch17:        0017-Low-aws-vpc-route53-Fix-missing-ocf_log-in-log-messa.patch
# PATCH-FIX-UPSTREAM: Medium: aws-vpc-route53: Fix tempfile race (bsc#1059312)
Patch18:        0018-Medium-aws-vpc-route53-Fix-tempfile-race-bsc-1059312.patch
# PATCH-FIX-UPSTREAM: Dev: aws-vpc-route53: Eliminate duplicated code
Patch19:        0019-Dev-aws-vpc-route53-Eliminate-duplicated-code.patch
# PATCH-FIX-UPSTREAM: Dev: aws-vpc-route53: Clean up logging
Patch20:        0020-Dev-aws-vpc-route53-Clean-up-logging.patch
# PATCH-FIX-UPSTREAM: Low: Raid1: remove unnecessary wait flags (bsc#1077416)
Patch21:        0021-Low-Raid1-remove-unnecessary-wait-flags-bsc-1077416.patch
# PATCH-FIX-UPSTREAM: Medium: Raid1: Ignore transient devices after stopping a device (bsc#1077416)
Patch22:        0022-Medium-Raid1-Ignore-transient-devices-after-stopping.patch
# PATCH-FIX-UPSTREAM: High: oracle: Fix alter user syntax for set_mon_user_profile (bsc#1089279)
Patch23:        0001-High-oracle-Fix-alter-user-syntax-for-set_mon_user_p.patch
# PATCH-FIX-UPSTREAM: SAPInstance: implemeted reload method
Patch24:        0024-SAPInstance-implemeted-reload-method.patch
# PATCH-FIX-UPSTREAM: SAPInstance: Improved indents
Patch25:        0025-SAPInstance-Improved-indents.patch
# PATCH-FIX-UPSTREAM: Medium: SAPInstance: Add monitored services for ENSA2
Patch26:        0026-Medium-SAPInstance-Add-monitored-services-for-ENSA2-.patch
# PATCH-FIX-UPSTREAM: SAPInstance: Improved SAP instance profile detection
Patch27:        0027-SAPInstance-Improved-SAP-instance-profile-detection.patch
# PATCH-FIX-UPSTREAM: CTDB: fix initial probe
Patch28:        0028-CTDB-fix-initial-probe.patch
# PATCH-FIX-OPENSUSE: CTDB: fix incorrect db corruption reports (bsc#1101668, bsc#1102935)
Patch29:        0029-CTDB-fix-incorrect-db-corruption-reports-bsc-1101668.patch
# PATCH-FIX-OPENSUSE: CTDB: fix OCF_RESKEY_ctdb_recovery_lock validation (bsc#1088692, bsc#1102935)
Patch30:        0030-CTDB-fix-OCF_RESKEY_ctdb_recovery_lock-validation-bs.patch
# PATCH-FIX-UPSTREAM: pgsql: Avoid the change of /dev/null to postgres owner/group
Patch31:        0031-pgsql-Avoid-the-change-of-dev-null-to-postgres-owner.patch
# PATCH-FIX-UPSTREAM: Add Python library
Patch32:        0032-Add-Python-library.patch
# PATCH-FIX-UPSTREAM: Python: add logging.basicConfig() to support background
Patch33:        0033-Python-add-logging.basicConfig-to-support-background.patch
# PATCH-FIX-UPSTREAM: configure: add Python path detection
Patch34:        0034-configure-add-Python-path-detection.patch
# PATCH-FIX-UPSTREAM: CI: skip Python agents in shellcheck
Patch35:        0035-CI-skip-Python-agents-in-shellcheck.patch
# PATCH-PR-UPSTREAM: Dev: ocf.py: Flesh out python library for resource agents
Patch40:        0040-1229.patch
# PATCH-PR-UPSTREAM: Dev: ocf.py: Improved exception handling
Patch41:        0041-1233.patch
# PATCH-PR-UPSTREAM: Fix a couple of bugs in ocf.py
Patch42:        0042-1245.patch
# PATCH-PR-UPSTREAM: dev: ocf.py: depth is not a time parameter and shouldn't a suffix
Patch43:        0043-1246.patch
# PATCH-PR-UPSTREAM: Dev: ocf.py: Add distro() function
Patch44:        0044-1251.patch

# PATCH-PR-UPSTREAM: 1248: azure-events: Updated agent to use ocf.py, Python 2/3 compatibility (Start)
Patch47:        0047-Initial-version-of-the-AzEvents-RA.patch
Patch48:        0048-AzEvents-Use-configure-to-replace-shebang-line.patch
Patch49:        0049-Implemented-review-feedback-from-krig.patch
Patch50:        0050-dev-AzEvents-Use-pacemaker-commands-to-set-standby.patch
Patch51:        0051-dev-AzEvents-Start-using-ocf.py-1161.patch
Patch52:        0052-dev-azure-events-Add-custom-user-agent.patch
Patch53:        0053-azure-events-adjust-the-execution-permissions-on-con.patch
# PATCH-PR-UPSTREAM: 1248: azure-events: Updated agent to use ocf.py, Python 2/3 compatibility (Finish)
# PATCH-FIX-UPSTREAM: 0001-galera-Ignore-safe_to_bootstrap-in-grastate.dat-in-s.patch
Patch54:        0001-galera-Ignore-safe_to_bootstrap-in-grastate.dat-in-s.patch
# PATCH-FIX-UPSTREAM: 0001-galera-Use-no-defaults-when-calling-mysql-client-for.patch -- 0001-galera-Use-no-defaults-when-calling-mysql-client-for.patch
Patch55:        0001-galera-Use-no-defaults-when-calling-mysql-client-for.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  docbook_4
BuildRequires:  libglue-devel
BuildRequires:  libnet-devel
BuildRequires:  libxslt
BuildRequires:  pkgconfig
BuildRequires:  systemd-rpm-macros
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(python)
Obsoletes:      heartbeat-resources
Provides:       %{name}-devel = %{version}
Provides:       heartbeat-resources
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A set of scripts to interface with several services to operate in a
High Availability environment for both Pacemaker and rgmanager
service managers.

%package -n ldirectord
Summary:        A Monitoring Daemon for Maintaining High Availability Resources
License:        GPL-2.0-only AND LGPL-2.1-or-later
Group:          Productivity/Clustering/HA
Requires:       %{name}
Requires:       ipvsadm
Requires:       logrotate
Requires:       perl-IO-Socket-INET6
Requires:       perl-MailTools
Requires:       perl-Net-SSLeay
Requires:       perl-Socket6
Requires:       perl-libwww-perl
Obsoletes:      heartbeat-ldirectord
Provides:       heartbeat-ldirectord
%{?systemd_requires}

%description -n ldirectord
ldirectord is a stand alone daemon for monitoring the services on real
servers. Currently, HTTP, HTTPS, and FTP services are supported.
ldirectord is simple to install and works with the heartbeat code
(http://www.linux-ha.org/).

See 'ldirectord -h' and linux-ha/doc/ldirectord for more information.

%package -n monitoring-plugins-metadata
Summary:        Metadata for Monitoring plugins
License:        LGPL-2.1-or-later AND GPL-2.0-or-later
Group:          Productivity/Clustering/HA
Requires:       monitoring-plugins-fping
Requires:       monitoring-plugins-http
Requires:       monitoring-plugins-ldap
Requires:       monitoring-plugins-mysql
Requires:       monitoring-plugins-pgsql
Requires:       monitoring-plugins-tcp
Requires:       resource-agents
Provides:       nagios-plugins-metadata
BuildArch:      noarch

%description -n monitoring-plugins-metadata
XML files containing metadata which facilitates using nagios
plugins as resource agents. These files were produced from help
pages of individual nagios plugins.

%prep
%setup -q
%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
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
# %patch36 -p1
# %patch37 -p1

# %patch38 -p1
# %patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1

# %patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1

%build
autoreconf -fvi
#because quilt push changed the permissions of  sg_persist.
chmod 775 heartbeat/sg_persist
%configure \
    --docdir=%{_defaultdocdir}/%{name} \
    --with-ras-set=linux-ha \
    --enable-fatal-warnings=no \
    --with-systemdsystemunitdir=%{_unitdir} \ \
    --with-pkg-name=%{name} \
    --with-rsctmpdir=%{_rundir}/%{name}  
make %{?_smp_mflags}

%install
%make_install
mkdir -p %{buildroot}%{_sysconfdir}/ha.d/resource.d
ln -s service %{buildroot}/%{_sbindir}/rcldirectord
# Dont package static libs or compiled python
find %{buildroot} -type f -name "*.la" -delete -print
find %{buildroot} -name '*.pyc' -type f -print0 | xargs -0 rm -f
find %{buildroot} -name '*.pyo' -type f -print0 | xargs -0 rm -f
# Unset execute permissions from things that shouln't have it
find %{buildroot} -name 'ocf-*'  -type f -print0 | xargs -0 chmod a-x
find %{buildroot} -name '*.dtd'  -type f -print0 | xargs -0 chmod a-x
chmod 0755 %{buildroot}%{_sbindir}/ocf-tester
chmod 0755 %{buildroot}%{_sbindir}/ocft
mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
install -m 644 %{SOURCE1} %{buildroot}%{_prefix}/lib/tmpfiles.d
(
cd %{buildroot}/%{_libdir}/heartbeat
for f in ocf-returncodes ocf-shellfuncs
do
    ln -s %{_libexecdir}/ocf/lib/heartbeat/$f
done
)

# install nagios plugins XML metadata
tar -xjf %{SOURCE2}
mkdir -p %{buildroot}%{_datadir}/nagios/plugins-metadata
for file in $(find plugins-metadata -type f); do
	install -m 644 $file %{buildroot}%{_datadir}/nagios/plugins-metadata
done

%post
systemd-tmpfiles --create resource-agents.conf || :

%preun -n ldirectord
%service_del_preun ldirectord.service

%postun -n ldirectord
%service_del_postun ldirectord.service

%post -n ldirectord
%service_add_post ldirectord.service

%pre -n ldirectord
%service_add_pre ldirectord.service

%files
%defattr(-,root,root)
%dir %{_prefix}/lib/ocf
%dir %{_prefix}/lib/ocf/resource.d
%dir %{_prefix}/lib/ocf/lib
%dir %{_prefix}/lib/tmpfiles.d
%{_libexecdir}/tmpfiles.d/resource-agents.conf
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*.rng
%dir %{_datadir}/%{name}/ocft
%dir %{_datadir}/%{name}/ocft/configs
%config(noreplace) %{_datadir}/%{name}/ocft/configs/*
%{_datadir}/%{name}/ocft/caselib
%{_datadir}/%{name}/ocft/README
%{_datadir}/%{name}/ocft/README.zh_CN
%{_datadir}/%{name}/ocft/helpers.sh
%{_datadir}/%{name}/ocft/runocft
%{_datadir}/%{name}/ocft/runocft.prereq
%{_libexecdir}/ocf/resource.d/heartbeat
%{_libexecdir}/ocf/lib/heartbeat
%{_sbindir}/ocf-tester
%{_sbindir}/ocft
%{_sbindir}/sfex_init
%{_sbindir}/sfex_stat
%{_includedir}/heartbeat
%ghost %dir %attr (1755, root, root) %{_rundir}/resource-agents
%doc AUTHORS
%license COPYING
%license COPYING.LGPL
%license COPYING.GPLv3
%doc %{_datadir}/%{name}/ra-api-1.dtd
%{_mandir}/man7/*.7*
%{_mandir}/man8/ocf-tester.8*
%{_mandir}/man8/sfex_init.8*
%doc doc/README.webapps
# For compatability with pre-existing agents
%dir %{_sysconfdir}/ha.d
%{_sysconfdir}/ha.d/shellfuncs
%dir %{_libdir}/heartbeat
%{_libdir}/heartbeat/ocf-shellfuncs
%{_libdir}/heartbeat/ocf-returncodes
%{_libdir}/heartbeat/send_arp
%{_libdir}/heartbeat/send_ua
%{_libdir}/heartbeat/sfex_daemon
%{_libdir}/heartbeat/findif
%{_libdir}/heartbeat/tickle_tcp

%files -n ldirectord
%defattr(-,root,root)
%doc ldirectord/ldirectord.cf
%{_mandir}/man8/ldirectord.8*
%dir %{_sysconfdir}/ha.d/resource.d
%{_sbindir}/ldirectord
%{_sbindir}/rcldirectord
%{_unitdir}/ldirectord.service
%exclude %{_sysconfdir}/init.d/ldirectord
%{_sysconfdir}/ha.d/resource.d/ldirectord
%config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord

%files -n monitoring-plugins-metadata
%defattr(-,root,root)
%dir %{_datadir}/nagios
%dir %{_datadir}/nagios/plugins-metadata
%attr(0644,root,root) %{_datadir}/nagios/plugins-metadata/*

%changelog
openSUSE Build Service is sponsored by