re-sync with upstream

This commit is contained in:
Andrew Beekhof 2013-06-20 16:29:04 +10:00
parent 86911946e9
commit 0ee2414f9e
2 changed files with 3745 additions and 142 deletions

3677
pacemaker-7d8acec.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,28 +2,16 @@
%global uname hacluster
%global pcmk_docdir %{_docdir}/%{name}
%global specversion 2
%global specversion 3
%global upstream_version 781a388
%global upstream_prefix ClusterLabs-pacemaker
# Compatibility macros for distros (fedora) that don't provide Python macros by default
# Do this instead of trying to conditionally include {_rpmconfigdir}/macros.python
%{!?py_ver: %{expand: %%global py_ver %%(echo `python -c "import sys; print sys.version[:3]"`)}}
%{!?py_prefix: %{expand: %%global py_prefix %%(echo `python -c "import sys; print sys.prefix"`)}}
%{!?py_libdir: %{expand: %%global py_libdir %%{expand:%%%%{py_prefix}/%%%%{_lib}/python%%%%{py_ver}}}}
%{!?py_sitedir: %{expand: %%global py_sitedir %%{expand:%%%%{py_libdir}/site-packages}}}
%global py_site %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
# Turn off the auto compilation of python files not in the site-packages directory
# Needed so that the -devel package is multilib compliant
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Compatibility macro wrappers for legacy RPM versions that do not
# support conditional builds
%{!?bcond_without: %{expand: %%global bcond_without() %%{expand:%%%%{!?_without_%%{1}:%%%%global with_%%{1} 1}}}}
%{!?bcond_with: %{expand: %%global bcond_with() %%{expand:%%%%{?_with_%%{1}:%%%%global with_%%{1} 1}}}}
%{!?with: %{expand: %%global with() %%{expand:%%%%{?with_%%{1}:1}%%%%{!?with_%%{1}:0}}}}
%{!?without: %{expand: %%global without() %%{expand:%%%%{?with_%%{1}:0}%%%%{!?with_%%{1}:1}}}}
%global cs_major %(pkg-config corosync --modversion | awk -F . '{print $1}')
%global cs_minor %(pkg-config corosync --modversion | awk -F . '{print $2}')
%global rawhide %(test ! -e /etc/yum.repos.d/fedora-rawhide.repo; echo $?)
@ -32,22 +20,11 @@
# Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
# to disable or enable specific features
# Supported cluster stacks, must support at least one
%bcond_without corosync
%bcond_with heartbeat
%bcond_with cman
# Legacy stonithd fencing agents
%bcond_with stonithd
# ESMTP is not available in RHEL, only in EPEL. Allow people to build
# the RPM without ESMTP in case they choose not to use EPEL packages
%bcond_with esmtp
%bcond_with snmp
# Build with/without support for profiling tools
%bcond_with profiling
%bcond_with gcov
# We generate docs using Publican, Asciidoc and Inkscape, but they're not available everywhere
%bcond_without doc
@ -55,7 +32,7 @@
# Use a different versioning scheme
%bcond_with pre_release
# Support Upstart job
# Ship an Upstart job file
%bcond_with upstart_job
%if %{with profiling}
@ -82,6 +59,7 @@ Group: System Environment/Daemons
# wget --no-check-certificate -O ClusterLabs-pacemaker-${VER}.tar.gz https://github.com/ClusterLabs/pacemaker/tarball/${VER}
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
Patch0: pacemaker-1.1.8-cast-align.patch
Patch1: pacemaker-7d8acec.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
AutoReqProv: on
Requires: resource-agents
@ -90,29 +68,15 @@ Requires: %{name}-cluster-libs = %{version}-%{release}
Requires: %{name}-cli = %{version}-%{release}
Requires: python >= 2.4
%if %{defined systemd_requires}
%systemd_requires
%endif
%if 0%{?rhel} > 0
ExclusiveArch: i686 x86_64
%endif
%if %{defined _unitdir}
# Needed for systemd unit
Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%if %{with heartbeat}
Requires(pre): cluster-glue
%endif
%if %{with snmp}
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%endif
%if 0%{?suse_version}
# net-snmp-devel on SLES10 does not suck in tcpd-devel automatically
BuildRequires: tcpd-devel
# Suse splits this off into a separate package
Requires: python-curses python-xml
BuildRequires: python-curses python-xml
@ -130,6 +94,14 @@ BuildRequires: resource-agents
BuildRequires: libqb-devel > 0.11.0
Requires: libqb > 0.11.0
# Enables optional functionality
BuildRequires: ncurses-devel openssl-devel libselinux-devel docbook-style-xsl
BuildRequires: bison byacc flex help2man
%if %{defined _unitdir}
BuildRequires: systemd-devel
%endif
%if 0%{?suse_version} >= 1100
# Renamed since opensuse-11.0
BuildRequires: libgnutls-devel
@ -137,13 +109,6 @@ BuildRequires: libgnutls-devel
BuildRequires: gnutls-devel
%endif
# Enables optional functionality
BuildRequires: ncurses-devel openssl-devel libselinux-devel docbook-style-xsl
BuildRequires: bison byacc flex help2man
%if %{with cman}
%if 0%{?fedora} > 0
%if 0%{?fedora} < 17
BuildRequires: clusterlib-devel
@ -156,29 +121,8 @@ BuildRequires: clusterlib-devel
%endif
%endif
%endif
%if %{with esmtp}
BuildRequires: libesmtp-devel
%endif
%if %{with snmp}
%ifarch alpha %{ix86} x86_64
BuildRequires: lm_sensors-devel
%endif
BuildRequires: net-snmp-devel
%endif
%if %{with corosync}
Requires: corosync
BuildRequires: corosynclib-devel
%endif
%if %{with heartbeat}
# Do not require heartbeat, the admin should select which stack to use and install it
BuildRequires: cluster-glue-libs-devel heartbeat-devel heartbeat-libs >= 3.0.0
%endif
%if %{with stonithd}
BuildRequires: cluster-glue-libs-devel
@ -197,17 +141,17 @@ BuildRequires: publican inkscape asciidoc
%description
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
manager for Corosync, CMAN and/or Linux-HA.
It supports "n-node" clusters with significant capabilities for
managing resources and dependencies.
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) : heartbeat cman corosync doc publican snmp esmtp pre_release
--with(out) : stonithd doc profiling pre_release upstart_job
%package cli
License: GPLv2+ and LGPLv2+
@ -218,7 +162,7 @@ Requires: perl-TimeDate
%description cli
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
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,
@ -231,7 +175,7 @@ Group: System Environment/Daemons
%description -n %{name}-libs
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
manager for Corosync, CMAN and/or Linux-HA.
The %{name}-libs package contains shared libraries needed for cluster
nodes and those just running the CLI tools.
@ -244,22 +188,25 @@ Requires: %{name}-libs = %{version}-%{release}
%description -n %{name}-cluster-libs
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
manager for Corosync, CMAN and/or Linux-HA.
The %{name}-cluster-libs package contains cluster-aware shared
libraries needed for nodes that will form part of the cluster nodes.
%package -n %{name}-remote
%package remote
License: GPLv2+ and LGPLv2+
Summary: Pacemaker remote daemon for non-cluster nodes
Group: System Environment/Daemons
Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-cli = %{version}-%{release}
Requires: resource-agents
%if %{defined systemd_requires}
%systemd_requires
%endif
%description -n %{name}-remote
%description remote
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
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
@ -274,16 +221,11 @@ Requires: %{name}-libs = %{version}-%{release}
Requires: %{name}-cluster-libs = %{version}-%{release}
Requires: libtool-ltdl-devel libqb-devel libuuid-devel
Requires: libxml2-devel libxslt-devel bzip2-devel glib2-devel
%if %{with corosync}
Requires: corosynclib-devel
%endif
%if %{with heartbeat}
Requires: cluster-glue-libs-devel heartbeat-devel
%endif
%description -n %{name}-libs-devel
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
manager for Corosync, CMAN and/or Linux-HA.
The %{name}-libs-devel package contains headers and shared libraries
for developing tools for Pacemaker.
@ -308,12 +250,13 @@ Group: Documentation
Documentation for Pacemaker.
Pacemaker is an advanced, scalable High-Availability cluster resource
manager for Linux-HA (Heartbeat) and/or Corosync.
manager for Corosync, CMAN and/or Linux-HA.
%prep
%setup -q -n %{upstream_prefix}-%{upstream_version}
%patch0 -p1 -R
%patch1 -p1
# Force the local time
#
@ -326,19 +269,9 @@ find . -exec touch \{\} \;
%build
./autogen.sh
%if %{with snmp}
eval `objdump --headers --private-headers /usr/bin/perl | grep RPATH | awk '{print "export LD_LIBRARY_PATH="$2}'`
%endif
# RHEL <= 5 does not support --docdir
docdir=%{pcmk_docdir} %{configure} \
%{!?with_heartbeat: --without-heartbeat} \
%{!?with_corosync: --without-ais} \
%{!?with_esmtp: --without-esmtp} \
%{!?with_snmp: --without-snmp} \
%{?with_cman: --with-cman} \
%{?with_profiling: --with-profiling} \
%{?with_gcov: --with-gcov} \
--with-initdir=%{_initrddir} \
--localstatedir=%{_var} \
--with-version=%{version}-%{release}
@ -375,7 +308,13 @@ find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
# Do not package these either
rm -f %{buildroot}/%{_libdir}/service_crm.so
%if %{with gcov}
# Don't ship init scripts for systemd based platforms
%if %{defined _unitdir}
rm -f %{buildroot}/%{_initrddir}/pacemaker
rm -f %{buildroot}/%{_initrddir}/pacemaker_remote
%endif
%if %{with profiling}
GCOV_BASE=%{buildroot}/%{_var}/lib/pacemaker/gcov
mkdir -p $GCOV_BASE
find . -name '*.gcno' -type f | while read F ; do
@ -389,17 +328,22 @@ done
rm -rf %{buildroot}
%post
%if %{defined _unitdir}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
/sbin/chkconfig --add pacemaker || :
%systemd_post pacemaker.service
%preun
/sbin/service pacemaker stop || :
if [ $1 -eq 0 ]; then
# Package removal, not upgrade
/sbin/chkconfig --del pacemaker || :
fi
%systemd_preun pacemaker.service
%postun
%systemd_postun_with_restart pacemaker.service
%post remote
%systemd_post pacemaker_remote.service
%preun remote
%systemd_preun pacemaker_remote.service
%postun remote
%systemd_postun_with_restart pacemaker_remote.service
%pre -n %{name}-libs
@ -415,19 +359,6 @@ exit 0
%postun -n %{name}-cluster-libs -p /sbin/ldconfig
%post -n %{name}-remote
%if %{defined _unitdir}
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
/sbin/chkconfig --add pacemaker_remote || :
%preun -n %{name}-remote
if [ $1 -eq 0 ]; then
# Package removal, not upgrade
/sbin/service pacemaker_remote stop &>/dev/null || :
/sbin/chkconfig --del pacemaker_remote || :
fi
%files
###########################################################
%defattr(-,root,root)
@ -435,13 +366,12 @@ fi
%exclude %{_datadir}/pacemaker/tests
%config(noreplace) %{_sysconfdir}/sysconfig/pacemaker
%if %{with corosync}
%{_sbindir}/pacemakerd
%{_initrddir}/pacemaker
%endif
%if %{defined _unitdir}
%{_unitdir}/pacemaker.service
%else
%{_initrddir}/pacemaker
%endif
%{_datadir}/pacemaker
@ -450,10 +380,6 @@ fi
%exclude %{_sbindir}/pacemaker_remoted
%{_libexecdir}/pacemaker/*
%if %{with heartbeat}
%{_libdir}/heartbeat/*
%endif
%{_sbindir}/crm_attribute
%{_sbindir}/crm_master
%{_sbindir}/crm_node
@ -465,19 +391,13 @@ fi
%{_bindir}/disable_rgmanager
%{_sbindir}/stonith_admin
%if %{with heartbeat}
%{_sbindir}/crm_uuid
%endif
%doc %{_mandir}/man7/*
%doc %{_mandir}/man8/attrd_updater.*
%doc %{_mandir}/man8/crm_attribute.*
%doc %{_mandir}/man8/crm_node.*
%doc %{_mandir}/man8/crm_master.*
%doc %{_mandir}/man8/fence_pcmk.*
%if %{with corosync}
%doc %{_mandir}/man8/pacemakerd.*
%endif
%doc %{_mandir}/man8/stonith_admin.*
%doc COPYING
@ -494,13 +414,11 @@ fi
%dir /usr/lib/ocf/resource.d
/usr/lib/ocf/resource.d/pacemaker
%if %{with corosync}
%if 0%{?cs_major} < 2
%if 0%{?cs_minor} < 8
%{_libexecdir}/lcrso/pacemaker.lcrso
%endif
%endif
%endif
%if %{with upstart_job}
%config(noreplace) %{_sysconfdir}/init/pacemaker.conf
@ -529,9 +447,7 @@ fi
%exclude %{_mandir}/man8/crm_node.*
%exclude %{_mandir}/man8/crm_master.*
%exclude %{_mandir}/man8/fence_pcmk.*
%if %{with corosync}
%exclude %{_mandir}/man8/pacemakerd.*
%endif
%exclude %{_mandir}/man8/pacemaker_remoted.*
%exclude %{_mandir}/man8/stonith_admin.*
@ -560,13 +476,15 @@ fi
%doc COPYING.LIB
%doc AUTHORS
%files -n %{name}-remote
%files remote
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/sysconfig/pacemaker
%{_initrddir}/pacemaker_remote
%if %{defined _unitdir}
%{_unitdir}/pacemaker_remote.service
%else
%{_initrddir}/pacemaker_remote
%endif
%{_sbindir}/pacemaker_remoted
@ -580,7 +498,7 @@ fi
%files cts
%defattr(-,root,root)
%{py_sitedir}/cts
%{py_site}/cts
%{_datadir}/pacemaker/tests/cts
%{_libexecdir}/pacemaker/lrmd_test
%doc COPYING.LIB
@ -592,7 +510,7 @@ fi
%{_datadir}/pacemaker/tests
%{_includedir}/pacemaker
%{_libdir}/*.so
%if %{with gcov}
%if %{with profiling}
%{_var}/lib/pacemaker
%endif
%{_libdir}/pkgconfig/*.pc
@ -600,6 +518,14 @@ fi
%doc AUTHORS
%changelog
* Thu Jun 20 2013 Andrew Beekhof <abeekhof@redhat.com> - 1.1.9-3
- Update to upstream 7d8acec
- See included ChangeLog file or https://raw.github.com/ClusterLabs/pacemaker/master/ChangeLog for full details
+ Feature: Turn off auto-respawning of systemd services when the cluster starts them
+ Fix: crmd: Ensure operations for cleaned up resources don't block recovery
+ Fix: logging: If SIGTRAP is sent before tracing is turned on, turn it on instead of crashing
* Mon Jun 17 2013 Andrew Beekhof <abeekhof@redhat.com> - 1.1.9-2
- Update for new upstream tarball: 781a388
- See included ChangeLog file or https://raw.github.com/ClusterLabs/pacemaker/master/ChangeLog for full details