File pacemaker.spec of Package pacemaker.3577
#
# spec file for package pacemaker
#
# Copyright (c) 2016 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/
#
# Globals and defines to control package behavior (configure these as desired)
## User and group to use for nonprivileged services
%global uname hacluster
%global gname haclient
## Where to install Pacemaker documentation
%global pcmk_docdir %{_docdir}/%{name}
## GitHub entity that distributes source (for ease of using a fork)
%global github_owner ClusterLabs
## Upstream pacemaker version, and its package version (specversion
## can be incremented to build packages reliably considered "newer"
## than previously built packages with the same pcmkversion)
%global pcmkversion 1.1.13
%global specversion 1
## Upstream commit (or git tag, such as "Pacemaker-" plus the
## {pcmkversion} macro for an official release) to use for this package
%global commit HEAD
# Define globals for convenient use later
## Workaround to use parentheses in other globals
%global lparen (
%global rparen )
## Short version of git commit
%define shortcommit %(c=%{commit}; case ${c} in
Pacemaker-*%{rparen} echo ${c:10};;
*%{rparen} echo ${c:0:7};; esac)
## Whether this is a release candidate
%define pre_release %(s=%{shortcommit}; [ ${s: -4:3} != -rc ]; echo $?)
## Whether this is a development branch
%define post_release %([ %{commit} = Pacemaker-%{shortcommit} ]; echo $?)
## Turn off auto-compilation of python files outside site-packages directory,
## so that the -devel package is multilib-compliant
%define __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
## Heuristic used to infer bleeding-edge deployments that are
## less likely to have working versions of the documentation tools
#%define bleeding %(test ! -e /etc/yum.repos.d/fedora-rawhide.repo; echo $?)
%define bleeding 0
## Corosync version
#%define cs_version %(pkg-config corosync --modversion 2>/dev/null | awk -F . '{print $1}')
%define cs_version 2
## Where to install python site libraries (currently, this uses the unversioned
## python_sitearch macro to get the default system python, but at some point,
## we should explicitly choose python2_sitearch or python3_sitearch -- or both)
%define py_site %{?python_sitearch}%{!?python_sitearch:%(
python -c 'from distutils.sysconfig import get_python_lib as gpl; print(gpl(1))' 2>/dev/null)}
## Whether this platform defaults to using CMAN
%define cman_native (0%{?el6} || (0%{?fedora} > 0 && 0%{?fedora} < 17))
## Whether this platform defaults to using systemd as an init system
## (needs to be evaluated prior to BuildRequires being enumerated and
## installed as it's intended to conditionally select some of these, and
## for that there are only few indicators with varying reliability:
## - presence of systemd-defined macros (when building in a full-fledged
## environment, which is not the case with ordinary mock-based builds)
## - systemd-aware rpm as manifested with the presence of particular
## macro (rpm itself will trivially always be present when building)
## - existence of /usr/lib/os-release file, which is something heavily
## propagated by systemd project
## - when not good enough, there's always a possibility to check
## particular distro-specific macros (incl. version comparison)
%define systemd_native (%{?_unitdir:1}%{?!_unitdir:0}%{nil \
} || %{?__transaction_systemd_inhibit:1}%{?!__transaction_systemd_inhibit:0}%{nil \
} || %(test -f /usr/lib/os-release; test $? -ne 0; echo $?))
# Definitions for backward compatibility with older RPM versions
## Ensure %license macro behaves consistently (older RPM will otherwise
## overwrite %license once it encounters "License:"). Courtesy Jason Tibbitts:
## https://pkgs.fedoraproject.org/cgit/rpms/epel-rpm-macros.git/tree/macros.zzz-epel?h=el6&id=e1adcb77
%if !%{defined _licensedir}
%define description %{lua:
rpm.define("license %doc")
print("%description")
}
%endif
# Define conditionals so that "rpmbuild --with <feature>" and
# "rpmbuild --without <feature>" can enable and disable specific features
## Add option to enable support for stonith/external fencing agents
%bcond_without stonithd
## Add option to create binaries suitable for use with profiling tools
%bcond_with profiling
## Add option to create binaries with coverage analysis
%bcond_with coverage
## Add option to skip generating documentation
## (the build tools aren't available everywhere)
%bcond_with doc
## Add option to prefix package version with "0."
## (so later "official" packages will be considered updates)
%bcond_with pre_release
## Add option to ship Upstart job files
%bcond_with upstart_job
## Add option to turn off CMAN support on CMAN-native platforms
%bcond_with cman
# Keep sane profiling data if requested
%if %{with profiling}
## Disable -debuginfo package and stripping binaries/libraries
%define debug_package %{nil}
%endif
# Define the release version
%if %{with pre_release} || 0%{pre_release}
%if 0%{pre_release}
%define pcmk_release 0.%{specversion}.%(s=%{shortcommit}; echo ${s: -3})
%else
%define pcmk_release 0.%{specversion}.%{shortcommit}.git
%endif
%else
%if 0%{post_release}
%define pcmk_release %{specversion}.%{shortcommit}.git
%else
%define pcmk_release %{specversion}
%endif
%endif
#%if 0%{?suse_version}
#%define _libexecdir %{_libdir}
#%endif
%define with_corosync_support 1
%define with_heartbeat_support 0
%define with_nagios 1
%define with_snmp 1
%define with_esmtp 1
%define with_acl 1
%define with_cibsecrets 1
%define enable_lib_cluster_pkg 0
%define enable_fatal_warnings 1
%define with_regression_tests 0
%if ! %{defined _rundir}
%define _rundir %{_localstatedir}/run
%endif
Name: pacemaker
#Version: %{pcmkversion}
Version: 1.1.13
Release: 0
#Release: %{pcmk_release}%{?dist}
Summary: Scalable High-Availability cluster resource manager
License: GPL-2.0 and GPL-2.0+ and LGPL-2.1+
Group: Productivity/Clustering/HA
# AGPL-3.0 licensed extra/clustermon.sh is not present in the binary
Url: http://www.clusterlabs.org
# eg. https://github.com/ClusterLabs/pacemaker/archive/8ae45302394b039fb098e150f156df29fc0cb576/pacemaker-8ae4530.tar.gz
#Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Source0: %{name}.tar.bz2
Source1: crm_report.in
Source100: pacemaker.rpmlintrc
Patch1: bug-806256_pacemaker-log-level-notice.patch
Patch2: bug-728579_pacemaker-stonith-dev-id.patch
Patch3: pacemaker-NodeUtilization-RA.patch
Patch4: pacemaker-cibsecret-tool-temp-disabled.patch
Patch5: pacemaker-nagios-plugin-dir.patch
Patch6: bug-812269_pacemaker-fencing-device-register-messages.patch
Patch7: pacemaker-Wno-format-signedness.patch
Patch8: bug-943295_pacemaker-lrmd-log-notice.patch
Patch9: pacemaker-crmd-notification-timeout.patch
Patch10: bug-942491_pacemaker-pengine-multiple-active-block-group.patch
Patch11: bug-942491_pacemaker-pengine-multiple-active-block-group-test.patch
Patch12: pacemaker-cib-do-not-terminate.patch
Patch13: pacemaker-systemd-metadata-timeouts.patch
Patch14: pacemaker-systemd-log-failed-operation-segfault.patch
Patch15: bug-956459_pacemaker-ping-metadata-host_list.patch
Patch16: pacemaker-controld-wait-fencing.patch
Patch17: pacemaker-HealthCPU-top-percent-sign.patch
Patch18: bug-962309_pacemaker-fencing-agent-stderr.patch
Patch19: pacemaker-fencing-delete-rsc-attribute-update-device.patch
Patch20: pacemaker-attrd-cache-connection-flags.patch
Patch21: pacemaker-fencing-topology-1.patch
Patch22: pacemaker-fencing-topology-2.patch
Patch23: bug-962309_pacemaker-fencing-remap-agent-error-codes.patch
Patch24: pacemaker-update-PCMK-MIB.patch
Patch25: pacemaker-crm_resource-uninitialized-memory.patch
Patch26: pacemaker-crm_resource-compile-issue.patch
Patch27: pacemaker-crmd-valid-fd.patch
Patch28: pacemaker-fencing-commands-use-after-free.patch
Patch29: bug-938545_pacemaker-pengine-concurrent-fencing.patch
Patch30: bug-938545_pacemaker-pengine-concurrent-fencing-test.patch
Patch31: bug-938545_pacemaker-fencing-concurrent-fencing.patch
Patch32: pacemaker-attrd-client-name.patch
Patch33: pacemaker-libcrmcommon-compressed-message-header.patch
Patch34: pacemaker-systemd-ordered-shutdown-resource.patch
Patch35: pacemaker-libcommon-dlsym-error.patch
Patch36: bug-961392_pacemaker-crm_shadow-sh-noprofile.patch
Patch37: bug-938545_pacemaker-fencing-concurrent-device-active-pids.patch
Patch38: bug-938545_pacemaker-fencing-concurrent-device-active-ops.patch
Patch39: bug-981489_pacemaker-attrd-remote-node-peer-cache.patch
Patch40: bug-971129_pacemaker-pengine-clone-update-actions-condition.patch
Patch41: bug-964183_pacemaker-liblrmd-use-after-free.patch
Patch42: bug-964183_pacemaker-crmd-use-after-free.patch
Patch43: bug-964183_pacemaker-crmd-remote-proxy-disconnect.patch
Patch44: pacemaker-libcluster-crm_peer_uname-invalid-uuid.patch
Patch45: pacemaker-crm_shadow-display.patch
Patch46: pacemaker-cib-dryrun-notification.patch
Patch47: pacemaker-systemd-stop-before-rsyslog.patch
Patch48: bug-964183_pacemaker-crmd-remote-disconnect-use-after-free.patch
Patch49: pacemaker-libservices-stat-before-pipe.patch
Patch50: pacemaker-libservices-pipe-error-handling.patch
Patch51: bug-964183_pacemaker-remote-client-ip.patch
Patch52: bug-967388_pacemaker-remote-new-client-notify.patch
Patch53: bug-964183_pacemaker-remote-sockaddr-refactor.patch
Patch54: pacemaker-cpg-group-name.patch
Patch55: pacemaker-crm_resource-restart-segfault.patch
Patch56: pacemaker-resources-default-globally_unique.patch
Patch57: bug-967775_pacemaker-libcib-determine-node-type.patch
Patch58: pacemaker-pengine-ordering-demote-failed-moving-containers.patch
Patch59: pacemaker-pengine-ordering-demote-failed-moving-containers-test.patch
Patch60: bug-971129_pacemaker-assert-stateful-clone-not-demote.patch
Patch61: pacemaker-attrd-exit-crash.patch
Patch62: pacemaker-libtransition-unpack_action-memory-leak.patch
Patch63: bug-974108-pacemaker_cib-fencing-set-status-callback.patch
Patch64: bug-972187_pacemaker-pengine-multiple-monitor-one-failed.patch
Patch65: bug-972187_pacemaker-pengine-multiple-monitor-one-failed-test.patch
Patch66: bug-976271_pacemaker-ping-fping6.patch
Patch67: bug-974108-pacemaker-fencing-by-nodeid.patch
Patch68: bug-977675_pacemaker-pengine-asymmetrical-order-move.patch
Patch69: bug-977675_pacemaker-pengine-asymmetrical-order-move-update-tests.patch
Patch70: bug-977675_pacemaker-pengine-asymmetrical-order-move-test.patch
Patch71: bug-977800_pacemaker-pengine-anti-colocation-master.patch
Patch72: bug-977800_pacemaker-pengine-anti-colocation-master-test.patch
Patch73: bug-977800_pacemaker-pengine-anti-colocation-slave.patch
Patch74: bug-977800_pacemaker-pengine-anti-colocation-slave-test.patch
Patch75: bug-975079_pacemaker-SysInfo-#health_disk.patch
Patch76: pacemaker-services-cleaup-actions.patch
Patch77: bug-977258_pacemaker-pengine-env-CRM_meta_timeout.patch
Patch78: bug-977258_pacemaker-pengine-env-CRM_meta_timeout-tests-1.patch
Patch79: bug-977258_pacemaker-pengine-env-CRM_meta_timeout-tests-2.patch
Patch80: pacemaker-log-correct-directory.patch
Patch81: pacemaker-libservices-systemd-log-warning.patch
Patch82: bug-977258_pacemaker-crmd-start-delay-action-timeout.patch
Patch83: pacemaker-libcommon-procfs-pid.patch
Patch84: pacemaker-resources-OCF-version-tagging.patch
Patch85: pacemaker-crm_mon-time-format-x32.patch
Patch86: pacemaker-attrd-validate-request.patch
Patch87: bug-977201_pacemaker-controld-dlm-stateful_merge_wait-1.patch
Patch88: bug-976865_pacemaker-remote-cancel-op.patch
Patch89: bug-977201_pacemaker-controld-dlm-stateful_merge_wait-2.patch
Patch90: bug-977201_pacemaker-stonith_admin-history-all-nodes.patch
Patch91: bug-977201_pacemaker-controld-dlm-stateful_merge_wait-3.patch
Patch92: bug-977201_pacemaker-controld-self-fencing.patch
Patch93: pacemaker-pengine-ms-resource-state.patch
Patch94: pacemaker-pengine-ms-resource-state-tests.patch
Patch95: pacemaker-crm_resource-target-role-promotion.patch
Patch96: pacemaker-pengine-order-stop-stonith.patch
Patch97: pacemaker-attrd-leak-memory-malformed-update-request.patch
Patch98: pacemaker-libcrmcommon-crm_time_t-initialized-1.patch
Patch99: pacemaker-pengine-set-unfencing.patch
Patch100: pacemaker-pengine-message-stonith-disabled.patch
Patch101: bug-981489_pacemaker-lrmd-handle-shutdown-cleanly.patch
Patch102: bug-981489_pacemaker-lrmd-proxied-IPC-providers-clients-opaque.patch
Patch103: bug-981489_pacemaker-constants-lrmd-IPC-operations.patch
Patch104: bug-981489_pacemaker-cts-remote-failure-with-kill.patch
Patch105: bug-981489_pacemaker-lrmd-IPC-operations-shutdown.patch
Patch106: bug-981489_pacemaker-crmd-support-graceful-remote-stops.patch
Patch107: bug-981489_pacemaker-remote-support-graceful-stops.patch
Patch108: bug-981489_pacemaker-pengine-shutdown-attribute-remote-node.patch
Patch109: bug-981489_pacemaker-crmd-set-shutdown-attribute-remote-request.patch
Patch110: bug-981489_pacemaker-crmd-log-graceful-proxy-shutdown.patch
Patch111: bug-981489_pacemaker-crmd-set-remote-flag-shutdown.patch
Patch112: bug-981489_pacemaker-crmd-clear-remote-node-attributes-on-disconnect.patch
Patch113: pacemaker-pengine-record-failed-op.patch
Patch114: pacemaker-cts-DummySD-stop.patch
Patch115: pacemaker-pengine-memory-leak-invalid-constraint-set.patch
Patch116: pacemaker-pengine-error-handling-unpack-location-set.patch
Patch117: pacemaker-pengine-use-after-free-location.patch
Patch118: pacemaker-crm_mon-memory-leak-unpack-constraints.patch
Patch119: pacemaker-liblrmd-memory-leak-closing-deleting-lrmd-connection.patch
Patch120: pacemaker-crmd-memory-leak-sending-fencing-alert.patch
Patch121: pacemaker-crmd-resource-agent-name-caching-metadata.patch
Patch122: pacemaker-crmd-timeout-older-peers-cancelling-resource-operation.patch
Patch123: pacemaker-libcrmcommon-crm_time_t-initialized-2.patch
Patch124: pacemaker-crm_resource-restart-count-starting-resources.patch
Patch125: pacemaker-crm_resource-restart-remember-existing-target-role.patch
Patch126: pacemaker-crm_resource-restart-memory-leaks.patch
Patch127: pacemaker-crm_resource-restart-resources-node.patch
Patch128: pacemaker-crm_resource-restart-resource-in-group.patch
Patch129: bug-986056_pacemaker-attrd-segfault-on-exit.patch
Patch130: pacemaker-pengine-update-dependant-actions-of-un-runnable-clones.patch
Patch131: pacemaker-pengine-update-dependant-actions-of-un-runnable-clones-test.patch
Patch132: pacemaker-crm_resource-T-option.patch
Patch133: pacemaker-lib-z-specifier.patch
Patch134: bug-981489_pacemaker-crmd-log-graceful-remote-shutdown.patch
Patch135: pacemaker-systemd-unit-name-ending-in-socket.patch
Patch136: bug-986201_pacemaker-pengine-tools-print-pending-state.patch
Patch137: bug-986201_pacemaker-pengine-tools-print-pending-state-tests.patch
Patch138: bug-986265_pacemaker-fence_legacy-hostlist.patch
Patch139: pacemaker-systemd-list-socket-units.patch
Patch140: bug-986931_pacemaker-crm_mon-crm_diff_update_v2-log-1.patch
Patch141: bug-987348_pacemaker-ping-sensible-error-tmp-full.patch
Patch142: pacemaker-crmd-load-reduced-carries-out-action.patch
Patch143: bug-986931_pacemaker-crm_mon-crm_diff_update_v2-log-2.patch
Patch144: pacemaker-libcrmcommon-xml-format-specifier-log-message.patch
Patch145: pacemaker-libcrmcommon-xml-log-comments.patch
Patch146: pacemaker-crmd-transitions-for-CIB-comment-changes.patch
Patch147: pacemaker-libcrmcommon-xml-find_element.patch
Patch148: pacemaker-libcrmcommon-xml-comments-v2-diffs.patch
Patch149: bug-995365_pacemaker-cts-restart-systemd-journald.patch
Patch150: pacemaker-libpengine-pe_order_same_node.patch
Patch151: pacemaker-pengine-transition-loop-start-then-stop-unfencing.patch
Patch152: pacemaker-pengine-transition-loop-start-then-stop-unfencing-update-tests.patch
Patch153: pacemaker-pengine-transition-loop-start-then-stop-unfencing-test.patch
Patch154: pacemaker-crmd-dc-lrm-state.patch
Patch155: pacemaker-fencing-cib-signon-stonithd-name.patch
Patch156: pacemaker-libcib-deletion-notice-registration.patch
Patch157: pacemaker-crmd-down-event-log.patch
Patch158: pacemaker-lrmd-libcluster-g_hash_table_foreach-null-table.patch
Patch159: pacemaker-pengine-null-dereference-same-node-ordering.patch
Patch160: pacemaker-pengine-OCF_RESKEY_CRM_meta_notify_active-multistate-resources.patch
Patch161: pacemaker-pengine-OCF_RESKEY_CRM_meta_notify_active-multistate-resources-update-tests.patch
Patch162: pacemaker-crm_mon-xml-schema-multiple-active.patch
Patch163: pacemaker-lib-memory-allocation-errors.patch
Patch164: pacemaker-crmd-clear-remote-node-operation-when-comes-up.patch
Patch165: pacemaker-crmd-set-R_SHUTDOWN.patch
Patch166: bug-987348-pacemaker-ping-avoid-temporary-files-fping-1.patch
Patch167: pacemaker-crmd-resend-shutdown-request.patch
Patch168: bug-987348-pacemaker-ping-avoid-temporary-files-fping-2.patch
Patch169: bug-1000743_pacemaker-pengine-shutdown-maintenance-node.patch
Patch170: bug-1000743_pacemaker-pengine-shutdown-maintenance-node-test.patch
Patch171: pacemaker-crm_mon-CRM_notify_recipient-null.patch
Patch172: pacemaker-libfencing-report-node-ID.patch
Patch173: bug-986644_pacemaker-remote-recv-msg-timeouts.patch
Patch174: bug-986644_pacemaker-libcrmcommon-errors-waiting-for-data.patch
Patch175: pacemaker-pacemaker.service-stonithd.patch
Patch176: pacemaker-libpengine-startup-fencing-warning-once.patch
Patch177: pacemaker-crm_standby-version-help-without-cluster.patch
Patch178: pacemaker-mcp-sysconfig-doc-1.patch
Patch179: pacemaker-mcp-sysconfig-doc-2.patch
Patch180: pacemaker-mcp-sysconfig-doc-3.patch
Patch181: pacemaker-ClusterMon-matching-process.patch
Patch182: bug-1003565_pacemaker-crmd-record-pending-op.patch
Patch183: pacemaker-attrd_updater-HAVE_ATOMIC_ATTRD.patch
Patch184: pacemaker-various-issues-valgrind-coverity.patch
Patch185: pacemaker-mcp-sysconfig-doc-4.patch
Patch186: bug-1007433_pacemaker-libcrmcommon-CVE-2016-7035-improper-IPC-guarding.patch
Patch187: bug-1009076_pacemaker-cluster-remote-LRM-API-versions-diverge.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: pacemaker-ticket-support = 2.0
Conflicts: heartbeat < 3.0
Conflicts: libheartbeat2 < 3.0.0
Requires: %{name}-cli = %{version}-%{release}
Requires: libpacemaker3 = %{version}-%{release}
%if %{enable_lib_cluster_pkg}
Requires: libpacemaker3-cluster = %{version}-%{release}
%endif
Requires: psmisc
Requires: resource-agents
Recommends: crmsh
Recommends: fence-agents
Recommends: libdlm
Recommends: sbd
Suggests: graphviz
%if %{defined systemd_requires}
%systemd_requires
%endif
# Pacemaker targets compatibility with python 2.6+ and 3.2+
Requires: python >= 2.6
BuildRequires: python-devel >= 2.6
# Pacemaker requires a minimum libqb functionality
Requires: libqb >= 0.13.0
BuildRequires: libqb-devel >= 0.13.0
# Basics required for the build (even if usually satisfied through other BRs)
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: grep
BuildRequires: sed
# Required for core functionality
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: libtool-ltdl-devel
BuildRequires: libuuid-devel
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
#BuildRequires: bzip2-devel
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(glib-2.0)
# Required for agent_config.h which specifies the correct scratch directory
BuildRequires: resource-agents
# Enables optional functionality
BuildRequires: bison
#BuildRequires: byacc
%if 0%{?suse_version} > 1100
BuildRequires: docbook-xsl-stylesheets
%else
BuildRequires: docbook-style-xsl
%endif
BuildRequires: flex
BuildRequires: help2man
%if 0%{?suse_version} > 1210
BuildRequires: libgnutls-devel
%else
BuildRequires: gnutls-devel
%endif
BuildRequires: ncurses-devel
BuildRequires: pkgconfig(dbus-1)
#%if %{systemd_native}
BuildRequires: pkgconfig(systemd)
#%endif
%if %{with cman} && %{cman_native}
BuildRequires: clusterlib-devel
# pacemaker initscript: cman initscript, fence_tool (+ some soft-dependencies)
# "post" scriptlet: ccs_update_schema
Requires: cman
%endif
%if %{with_corosync_support}
Requires: corosync
#BuildRequires: corosynclib-devel
BuildRequires: pkgconfig(corosync)
%endif
%if %{with_heartbeat_support}
BuildRequires: heartbeat-devel
Requires: heartbeat
%endif
%if %{with stonithd}
%if 0%{?suse_version}
BuildRequires: libglue-devel
%else
BuildRequires: cluster-glue-libs-devel
%endif
%endif
## (note no avoiding effect when building through non-customized mock)
#%if !%{bleeding}
%if !0%{?bleeding}
%if %{with doc}
BuildRequires: asciidoc
BuildRequires: inkscape
BuildRequires: publican
%endif
%endif
%if %{with_snmp}
BuildRequires: net-snmp-devel
%endif
%if %{with_esmtp}
BuildRequires: libesmtp-devel
%endif
%if %{with_regression_tests}
BuildRequires: procps
BuildRequires: python-curses
BuildRequires: python-xml
%endif
%description
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
It supports more than 16 node clusters with significant capabilities
for managing resources and dependencies.
It will run scripts at initialization, when machines go up or down,
when related resources fail and can be configured to periodically check
resource health.
Available rpmbuild rebuild options:
--with(out) : cman coverage doc stonithd pre_release profiling upstart_job
%package cli
Summary: Command line tools for controlling Pacemaker clusters
Group: Productivity/Clustering/HA
Requires: libpacemaker3 = %{version}-%{release}
Requires: logrotate
Requires: perl-TimeDate
%description cli
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
The %{name}-cli package contains command line tools that can be used
to query and control the cluster from machines that may, or may not,
be part of the cluster.
%package -n libpacemaker3
Summary: Core Pacemaker libraries
Group: Productivity/Clustering/HA
%description -n libpacemaker3
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
The libpacemaker3 package contains shared libraries needed for cluster
nodes and those just running the CLI tools.
%if %{enable_lib_cluster_pkg}
%package -n libpacemaker3-cluster
Summary: Cluster Libraries used by Pacemaker
Group: Productivity/Clustering/HA
Requires: libpacemaker3 = %{version}-%{release}
%description -n libpacemaker3-cluster
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
The libpacemaker3-cluster package contains cluster-aware shared
libraries needed for nodes that will form part of the cluster nodes.
%endif
%package remote
Summary: Pacemaker remote daemon for non-cluster nodes
Group: Productivity/Clustering/HA
Requires: %{name}-cli = %{version}-%{release}
Requires: libpacemaker3 = %{version}-%{release}
Requires: resource-agents
%if %{defined systemd_requires}
%systemd_requires
%endif
%description remote
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
The %{name}-remote package contains the Pacemaker Remote daemon
which is capable of extending pacemaker functionality to remote
nodes not running the full corosync/cluster stack.
%package -n libpacemaker-devel
Summary: Pacemaker development package
Group: Development/Libraries/C and C++
Requires: %{name}-cts = %{version}-%{release}
Requires: glib2-devel
Requires: libpacemaker3 = %{version}-%{release}
%if %{enable_lib_cluster_pkg}
Requires: libpacemaker3-cluster = %{version}-%{release}
%endif
Requires: libqb-devel
Requires: libtool-ltdl-devel
Requires: libuuid-devel
Requires: libxml2-devel
Requires: libxslt-devel
Requires: pkgconfig
#Requires: bzip2-devel
Requires: pkgconfig(bzip2)
#Requires: corosynclib-devel
Requires: pkgconfig(corosync)
%if %with_regression_tests
# For the regression tests, we can run them only if all pacemaker
# packages are installed, so we pull that in here for the regression
# builds; this is supposed to be disabled for shipping code.
Requires: pacemaker
%endif
%description -n libpacemaker-devel
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
The libpacemaker-devel package contains headers and shared libraries
for developing tools for Pacemaker.
%package cts
Summary: Test framework for cluster-related technologies like Pacemaker
Group: Productivity/Clustering/HA
Requires: libpacemaker3 = %{version}-%{release}
Requires: python >= 2.6
# systemd python bindings are separate package in some distros
%if %{defined systemd_requires}
%if 0%{?fedora} > 20
Requires: systemd-python
%endif
%if 0%{?rhel} > 6
Requires: systemd-python
%endif
%endif
%description cts
Test framework for cluster-related technologies like Pacemaker
%if %{with doc}
%package doc
Summary: Documentation for Pacemaker
Group: Productivity/Clustering/HA
%description doc
Documentation for Pacemaker.
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Corosync, CMAN and/or Linux-HA.
%endif
%prep
#%setup -q -n %{name}-%{commit}
%setup -q -n %{name}
%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
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch69 -p1
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
%patch78 -p1
%patch79 -p1
%patch80 -p1
%patch81 -p1
%patch82 -p1
%patch83 -p1
%patch84 -p1
%patch85 -p1
%patch86 -p1
%patch87 -p1
%patch88 -p1
%patch89 -p1
%patch90 -p1
%patch91 -p1
%patch92 -p1
%patch93 -p1
%patch94 -p1
%patch95 -p1
%patch96 -p1
%patch97 -p1
%patch98 -p1
%patch99 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch118 -p1
%patch119 -p1
%patch120 -p1
%patch121 -p1
%patch122 -p1
%patch123 -p1
%patch124 -p1
%patch125 -p1
%patch126 -p1
%patch127 -p1
%patch128 -p1
%patch129 -p1
%patch130 -p1
%patch131 -p1
%patch132 -p1
%patch133 -p1
%patch134 -p1
%patch135 -p1
%patch136 -p1
%patch137 -p1
%patch138 -p1
%patch139 -p1
%patch140 -p1
%patch141 -p1
%patch142 -p1
%patch143 -p1
%patch144 -p1
%patch145 -p1
%patch146 -p1
%patch147 -p1
%patch148 -p1
%patch149 -p1
%patch150 -p1
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch158 -p1
%patch159 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1
%patch163 -p1
%patch164 -p1
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
%patch170 -p1
%patch171 -p1
%patch172 -p1
%patch173 -p1
%patch174 -p1
%patch175 -p1
%patch176 -p1
%patch177 -p1
%patch178 -p1
%patch179 -p1
%patch180 -p1
%patch181 -p1
%patch182 -p1
%patch183 -p1
%patch184 -p1
%patch185 -p1
%patch186 -p1
%patch187 -p1
# Force the local time
#
# 'git' sets the file date to the date of the last commit.
# This can result in files having been created in the future
# when building on machines in timezones 'behind' the one the
# commit occurred in - which seriously confuses 'make'
find . -exec touch \{\} \;
%build
# Early versions of autotools (e.g. RHEL <= 5) do not support --docdir
export docdir=%{pcmk_docdir}
./autogen.sh
%{configure} \
%{?with_profiling: --with-profiling} \
%{?with_coverage: --with-coverage} \
%{!?with_cman: --without-cman} \
%if !%{with_heartbeat_support}
--without-heartbeat \
%endif
%if %{with_nagios}
--with-nagios=true \
%endif
%if %{with_snmp}
--with-snmp=true \
%endif
%if %{with_esmtp}
--with-esmtp=true \
%endif
%if %{with_acl}
--with-acl=true \
%endif
%if %{with_cibsecrets}
--with-cibsecrets=true \
%endif
%if !%{enable_fatal_warnings}
--enable-fatal-warnings=no \
%endif
%{!?with_doc: --with-brand=} \
--with-initdir=%{_initrddir} \
--localstatedir=%{_var} \
--with-version=%{version}-%{release}
%if 0%{?suse_version} >= 1200
# Fedora handles rpath removal automagically
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%endif
make %{_smp_mflags} V=1 all
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} docdir=%{pcmk_docdir} V=1 install
#mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
install -d -m755 %{buildroot}%{_localstatedir}/adm/fillup-templates
#install -m 644 mcp/pacemaker.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/pacemaker
install -m 644 mcp/pacemaker.sysconfig %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.pacemaker
#install -m 644 tools/crm_mon.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/crm_mon
install -m 644 tools/crm_mon.sysconfig %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.crm_mon
install -d -m755 %{buildroot}%{_localstatedir}/lib/pacemaker/cores
%if %{with upstart_job}
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/init
install -m 644 mcp/pacemaker.upstart ${RPM_BUILD_ROOT}%{_sysconfdir}/init/pacemaker.conf
install -m 644 mcp/pacemaker.combined.upstart ${RPM_BUILD_ROOT}%{_sysconfdir}/init/pacemaker.combined.conf
install -m 644 tools/crm_mon.upstart ${RPM_BUILD_ROOT}%{_sysconfdir}/init/crm_mon.conf
%endif
# Scripts that should be executable
chmod a+x %{buildroot}/%{_datadir}/pacemaker/tests/cts/CTSlab.py
# These are not actually scripts
find %{buildroot} -name '*.xml' -type f -print0 | xargs -0 chmod a-x
find %{buildroot} -name '*.xsl' -type f -print0 | xargs -0 chmod a-x
find %{buildroot} -name '*.rng' -type f -print0 | xargs -0 chmod a-x
find %{buildroot} -name '*.dtd' -type f -print0 | xargs -0 chmod a-x
# Don't package static libs
find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
# Do not package these either
rm -f %{buildroot}/%{_libdir}/service_crm.so
# Don't ship init scripts for systemd based platforms
%if %{defined _unitdir}
rm -f %{buildroot}/%{_initrddir}/pacemaker
rm -f %{buildroot}/%{_initrddir}/pacemaker_remote
ln -s service %{buildroot}%{_sbindir}/rcpacemaker
ln -s service %{buildroot}%{_sbindir}/rcpacemaker_remote
ln -s service %{buildroot}%{_sbindir}/rccrm_mon
%endif
mv %{buildroot}%{_sbindir}/crm_report %{buildroot}%{_sbindir}/crm_report.pacemaker
install -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/crm_report
# Don't ship fence_pcmk where it has no use
%if %{without cman}
rm -f %{buildroot}/%{_sbindir}/fence_pcmk
%endif
%if %{with coverage}
GCOV_BASE=%{buildroot}/%{_var}/lib/pacemaker/gcov
mkdir -p $GCOV_BASE
find . -name '*.gcno' -type f | while read F ; do
D=`dirname $F`
mkdir -p ${GCOV_BASE}/$D
cp $F ${GCOV_BASE}/$D
done
%endif
%pre
%if %{defined _unitdir}
%service_add_pre pacemaker.service
%endif
%post
%if %{defined _unitdir}
#%systemd_post pacemaker.service
%service_add_post pacemaker.service
%else
/sbin/chkconfig --add pacemaker || :
%if %{with cman} && %{cman_native}
# make fence_pcmk in cluster.conf valid instantly otherwise tools like ccs may
# choke (until schema gets auto-regenerated on the next start of cluster),
# per the protocol shared with other packages contributing to cluster.rng
/usr/sbin/ccs_update_schema >/dev/null 2>&1 || :
%endif
%endif
%preun
%if %{defined _unitdir}
#%systemd_preun pacemaker.service
%service_del_preun pacemaker.service
%else
/sbin/service pacemaker stop >/dev/null 2>&1 || :
if [ $1 -eq 0 ]; then
# Package removal, not upgrade
/sbin/chkconfig --del pacemaker || :
fi
%endif
%postun
%if %{defined _unitdir}
#%systemd_postun_with_restart pacemaker.service
%service_del_postun pacemaker.service
%endif
%pre remote
%if %{defined _unitdir}
%service_add_pre pacemaker_remote.service
%endif
%post remote
%if %{defined _unitdir}
#%systemd_post pacemaker_remote.service
%service_add_post pacemaker_remote.service
%else
/sbin/chkconfig --add pacemaker_remote || :
%endif
%preun remote
%if %{defined _unitdir}
#%systemd_preun pacemaker_remote.service
%service_del_preun pacemaker_remote.service
%else
/sbin/service pacemaker_remote stop >/dev/null 2>&1 || :
if [ $1 -eq 0 ]; then
# Package removal, not upgrade
/sbin/chkconfig --del pacemaker_remote || :
fi
%endif
%postun remote
%if %{defined _unitdir}
#%systemd_postun_with_restart pacemaker_remote.service
%service_del_postun pacemaker_remote.service
%endif
%pre cli
%if %{defined _unitdir}
%service_add_pre crm_mon.service
%endif
%post cli
%fillup_only pacemaker
%if %{defined _unitdir}
#%systemd_post crm_mon.service
%service_add_post crm_mon.service
%endif
%fillup_only crm_mon
%preun cli
%if %{defined _unitdir}
#%systemd_preun crm_mon.service
%service_del_preun crm_mon.service
%endif
%postun cli
%if %{defined _unitdir}
#%systemd_postun_with_restart crm_mon.service
%service_del_postun crm_mon.service
%endif
%pre -n libpacemaker3
getent group %{gname} >/dev/null || groupadd -r %{gname} -g 189
getent passwd %{uname} >/dev/null || useradd -r -g %{gname} -u 189 -s /sbin/nologin -c "cluster user" %{uname}
exit 0
%post -n libpacemaker3 -p /sbin/ldconfig
%postun -n libpacemaker3 -p /sbin/ldconfig
%if %{enable_lib_cluster_pkg}
%post -n libpacemaker3-cluster -p /sbin/ldconfig
%postun -n libpacemaker3-cluster -p /sbin/ldconfig
%endif
%if %{with_regression_tests}
%post -n libpacemaker-devel
if [ ! -e /tmp/.pcmk_regression_tests_ran ]; then
touch /tmp/.pcmk_regression_tests_ran
# Needed so that the shell doesn't get stuck on escape
# sequences
export TERM=dumb
%{_datadir}/pacemaker/tests/cli/regression.sh || true
%{_datadir}/pacemaker/tests/pengine/regression.sh -V || true
echo Now running shell regression tests ; date
if ! %{_datadir}/pacemaker/tests/shell/regression.sh ; then
echo "Shell tests failed."
cat crmtestout/regression.out
fi
fi
%endif
%files
###########################################################
%defattr(-,root,root)
#%config(noreplace) %{_sysconfdir}/sysconfig/pacemaker
%{_sbindir}/pacemakerd
%if %{defined _unitdir}
%{_unitdir}/pacemaker.service
%{_sbindir}/rcpacemaker
%else
%{_initrddir}/pacemaker
%endif
%exclude %{_libexecdir}/pacemaker/lrmd_test
%exclude %{_sbindir}/pacemaker_remoted
%dir %{_libexecdir}/pacemaker
%{_libexecdir}/pacemaker/*
%{_sbindir}/crm_node
%{_sbindir}/fence_legacy
%if %{with cman}
%{_sbindir}/fence_pcmk
%endif
%{_sbindir}/stonith_admin
%doc %{_mandir}/man7/crmd.*
%doc %{_mandir}/man7/pengine.*
%doc %{_mandir}/man7/stonithd.*
%if %{without cman} || !%{cman_native}
%doc %{_mandir}/man7/ocf_pacemaker_controld.*
%endif
%doc %{_mandir}/man7/ocf_pacemaker_o2cb.*
%doc %{_mandir}/man7/ocf_pacemaker_remote.*
%doc %{_mandir}/man8/crm_node.*
%if %{with cman}
%doc %{_mandir}/man8/fence_pcmk.*
%endif
%doc %{_mandir}/man8/fence_legacy.*
%doc %{_mandir}/man8/pacemakerd.*
%doc %{_mandir}/man8/stonith_admin.*
#%license licenses/GPLv2
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cib
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/pengine
%if %{without cman} || !%{cman_native}
/usr/lib/ocf/resource.d/pacemaker/controld
%endif
/usr/lib/ocf/resource.d/pacemaker/o2cb
/usr/lib/ocf/resource.d/pacemaker/remote
/usr/lib/ocf/resource.d/.isolation
%if "%{?cs_version}" != "UNKNOWN"
%if 0%{?cs_version} < 2
%{_libexecdir}/lcrso/pacemaker.lcrso
%endif
%endif
%if %{with upstart_job}
%config(noreplace) %{_sysconfdir}/init/pacemaker.conf
%config(noreplace) %{_sysconfdir}/init/pacemaker.combined.conf
%endif
%files cli
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/logrotate.d/pacemaker
#%config(noreplace) %{_sysconfdir}/sysconfig/crm_mon
%if %{defined _unitdir}
%{_unitdir}/crm_mon.service
%{_sbindir}/rccrm_mon
%endif
%if %{with upstart_job}
%config(noreplace) %{_sysconfdir}/init/crm_mon.conf
%endif
%{_sbindir}/attrd_updater
%{_sbindir}/cibadmin
%{_sbindir}/crm_attribute
%{_sbindir}/crm_diff
%{_sbindir}/crm_error
%{_sbindir}/crm_failcount
%{_sbindir}/crm_master
%{_sbindir}/crm_mon
%{_sbindir}/crm_resource
%{_sbindir}/crm_standby
%{_sbindir}/crm_verify
%{_sbindir}/crmadmin
%{_sbindir}/iso8601
%{_sbindir}/crm_shadow
%{_sbindir}/crm_simulate
%{_sbindir}/crm_report
%{_sbindir}/crm_report.pacemaker
%{_sbindir}/crm_ticket
%exclude %{_datadir}/pacemaker/tests
%{_datadir}/pacemaker
%{_datadir}/snmp/mibs/PCMK-MIB.txt
%exclude /usr/lib/ocf/resource.d/pacemaker/controld
%exclude /usr/lib/ocf/resource.d/pacemaker/o2cb
%exclude /usr/lib/ocf/resource.d/pacemaker/remote
%dir /usr/lib/ocf
%dir /usr/lib/ocf/resource.d
/usr/lib/ocf/resource.d/pacemaker
%config(noreplace) %{_localstatedir}/adm/fillup-templates/sysconfig.pacemaker
%config(noreplace) %{_localstatedir}/adm/fillup-templates/sysconfig.crm_mon
%doc %{_mandir}/man7/*
%exclude %{_mandir}/man7/crmd.*
%exclude %{_mandir}/man7/pengine.*
%exclude %{_mandir}/man7/stonithd.*
%exclude %{_mandir}/man7/ocf_pacemaker_controld.*
%exclude %{_mandir}/man7/ocf_pacemaker_o2cb.*
%exclude %{_mandir}/man7/ocf_pacemaker_remote.*
%doc %{_mandir}/man8/*
%exclude %{_mandir}/man8/crm_node.*
%exclude %{_mandir}/man8/fence_pcmk.*
%exclude %{_mandir}/man8/fence_legacy.*
%exclude %{_mandir}/man8/pacemakerd.*
%exclude %{_mandir}/man8/pacemaker_remoted.*
%exclude %{_mandir}/man8/stonith_admin.*
#%license licenses/GPLv2
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/blackbox
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/pacemaker/cores
%files -n libpacemaker3
%defattr(-,root,root)
%{_libdir}/libcib.so.*
%{_libdir}/liblrmd.so.*
%{_libdir}/libcrmservice.so.*
%{_libdir}/libcrmcommon.so.*
%{_libdir}/libpe_status.so.*
%{_libdir}/libpe_rules.so.*
%{_libdir}/libpengine.so.*
%{_libdir}/libstonithd.so.*
%{_libdir}/libtransitioner.so.*
#%license licenses/LGPLv2.1
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%{_libdir}/libcrmcluster.so.*
%if %{enable_lib_cluster_pkg}
%files -n libpacemaker3-cluster
%defattr(-,root,root)
%{_libdir}/libcrmcluster.so.*
#%license licenses/LGPLv2.1
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%endif
%files remote
%defattr(-,root,root)
#%config(noreplace) %{_sysconfdir}/sysconfig/pacemaker
%if %{defined _unitdir}
%{_unitdir}/pacemaker_remote.service
%{_sbindir}/rcpacemaker_remote
%else
%{_initrddir}/pacemaker_remote
%endif
%{_sbindir}/pacemaker_remoted
%{_mandir}/man8/pacemaker_remoted.*
#%license licenses/GPLv2
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%if %{with doc}
%files doc
%defattr(-,root,root)
%doc %{pcmk_docdir}
#%license licenses/CC-BY-SA-4.0
%endif
%files cts
%defattr(-,root,root)
#%{py_site}/cts
%{py_sitedir}/cts
%{_datadir}/pacemaker/tests/cts
%{_libexecdir}/pacemaker/lrmd_test
#%license licenses/GPLv2
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%files -n libpacemaker-devel
%defattr(-,root,root)
%exclude %{_datadir}/pacemaker/tests/cts
%{_datadir}/pacemaker/tests
%{_includedir}/pacemaker
%{_libdir}/*.so
%if %{with coverage}
%{_var}/lib/pacemaker/gcov
%endif
%{_libdir}/pkgconfig/*.pc
#%license licenses/LGPLv2.1
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%changelog