Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

304 lines (255 sloc) 7.82 KB
# 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.
%global rcver @rcver@
%global alphatag @alphatag@
%global numcomm @numcomm@
%global dirty @dirty@
# Since this spec file supports multiple distributions, ensure we
# use the correct group for each.
# SSLeay (required by ldirectord)
%if 0%{?suse_version}
%global SSLeay perl-Net_SSLeay
%global SSLeay perl-Net-SSLeay
# determine the ras-set to process based on configure invokation
%bcond_@rgmanager@ rgmanager
%bcond_@linux-ha@ linuxha
Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts
Version: @version@
Release: @specver@%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+ and LGPLv2+
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
Group: System Environment/Base
Group: Productivity/Clustering/HA
Source0: %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.bz2
Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version}
## Setup/build bits
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
# Build dependencies
BuildRequires: automake autoconf pkgconfig
BuildRequires: perl python-devel
BuildRequires: libxslt glib2-devel
BuildRequires: which
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
BuildRequires: cluster-glue-libs-devel
BuildRequires: docbook-style-xsl docbook-dtds
%if 0%{?rhel} == 0
BuildRequires: libnet-devel
%if 0%{?suse_version}
%if 0%{?suse_version} >= 1140
BuildRequires: libnet1
BuildRequires: libnet
BuildRequires: libglue-devel
BuildRequires: libxslt docbook_4 docbook-xsl-stylesheets
## Runtime deps
## These apply to rgmanager agents only to guarantee agents
## are functional
%if %{with rgmanager}
# system tools shared by several agents
Requires: /bin/bash /bin/grep /bin/sed /bin/gawk
Requires: /bin/ps /usr/bin/pkill /bin/hostname
Requires: /sbin/fuser
Requires: /sbin/findfs /bin/mount
Requires: /sbin/quotaon /sbin/quotacheck
Requires: /sbin/fsck
Requires: /sbin/fsck.ext2 /sbin/fsck.ext3 /sbin/fsck.ext4
Requires: /sbin/fsck.xfs
Requires: /sbin/ip /usr/sbin/ethtool
Requires: /sbin/rdisc /usr/sbin/arping /bin/ping /bin/ping6
Requires: /sbin/lvm
Requires: /sbin/mount.nfs /sbin/mount.nfs4 /sbin/mount.cifs
Requires: /usr/sbin/rpc.nfsd /sbin/rpc.statd /usr/sbin/rpc.mountd
A set of scripts to interface with several services to operate in a
High Availability environment for both Pacemaker and rgmanager
service managers.
%if %{with linuxha}
%package -n ldirectord
License: GPLv2+
Summary: A Monitoring Daemon for Maintaining High Availability Resources
%if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
Group: System Environment/Daemons
Group: Productivity/Clustering/HA
Obsoletes: heartbeat-ldirectord <= %{version}
Provides: heartbeat-ldirectord = %{version}
Requires: %{SSLeay} perl-libwww-perl perl-MailTools
Requires: ipvsadm logrotate
%if 0%{?fedora_version}
Requires: perl-Net-IMAP-Simple-SSL
Requires(post): /sbin/chkconfig
%description -n ldirectord
The Linux Director Daemon (ldirectord) was written by Jacob Rief.
ldirectord is a stand alone daemon for monitoring the services on real
servers. Currently, HTTP, HTTPS, and FTP services are supported.
lditrecord is simple to install and works with the heartbeat code
See 'ldirectord -h' and linux-ha/doc/ldirectord for more information.
%if 0%{?suse_version} == 0 && 0%{?fedora} == 0 && 0%{?centos_version} == 0 && 0%{?rhel} == 0
%{error:Unable to determine the distribution/version. This is generally caused by missing /etc/rpm/macros.dist. Please install the correct build packages or define the required macros manually.}
exit 1
%setup -q -n %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
if [ ! -f configure ]; then
%if 0%{?fedora} >= 11 || 0%{?centos_version} > 5 || 0%{?rhel} > 5
CFLAGS="$(echo '%{optflags}')"
%global conf_opt_fatal "--enable-fatal-warnings=no"
%global conf_opt_fatal "--enable-fatal-warnings=yes"
%if %{with rgmanager}
%global rasset rgmanager
%if %{with linuxha}
%global rasset linux-ha
%if %{with rgmanager} && %{with linuxha}
%global rasset all
export CFLAGS
%configure \
%{?conf_opt_rsctmpdir:%conf_opt_rsctmpdir} \
%{conf_opt_fatal} \
--with-pkg-name=%{name} \
%if %{defined jobs}
JFLAGS="$(echo '-j%{jobs}')"
JFLAGS="$(echo '%{_smp_mflags}')"
make $JFLAGS
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
## tree fixup
# remove docs (there is only one and they should come from doc sections in files)
rm -rf %{buildroot}/usr/share/doc/resource-agents
%if %{with linuxha}
%if 0%{?suse_version}
test -d %{buildroot}/sbin || mkdir %{buildroot}/sbin
cd %{buildroot}/sbin
ln -sf /%{_sysconfdir}/init.d/ldirectord rcldirectord
) || true
rm -rf %{buildroot}
%if %{with linuxha}
%doc doc/README.webapps
%doc %{_datadir}/%{name}/ra-api-1.dtd
%if %{with rgmanager}
%if %{with linuxha}
%dir /usr/lib/ocf
%dir /usr/lib/ocf/resource.d
%dir /usr/lib/ocf/lib
%if %{with rgmanager}
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/ocft
%dir %attr (1755, root, root) %{_var}/run/resource-agents
# For compatability with pre-existing agents
%dir %{_sysconfdir}/ha.d
%post -n resource-agents
if [ $1 = 2 ]; then
if [ -d %{_var}/run/heartbeat/rsctmp ]; then
cp -fpr %{_var}/run/heartbeat/rsctmp/* %{_var}/run/resource-agents/ 1>/dev/null 2>&1
rm -fr %{_var}/run/heartbeat/rsctmp
%if %{with rgmanager}
ccs_update_schema > /dev/null 2>&1 ||:
%if 0%{?suse_version}
%preun -n ldirectord
%stop_on_removal ldirectord
%postun -n ldirectord
%if 0%{?fedora}
%preun -n ldirectord
/sbin/chkconfig --del ldirectord
%postun -n ldirectord -p /sbin/ldconfig
%post -n ldirectord
/sbin/chkconfig --add ldirectord
%files -n ldirectord
%doc ldirectord/ COPYING
%config(noreplace) %{_sysconfdir}/logrotate.d/ldirectord
%dir %{_sysconfdir}/ha.d
%dir %{_sysconfdir}/ha.d/resource.d
%if 0%{?suse_version}
%if 0%{?fedora}
* @date@ Autotools generated version <> - @version@-@specver@-@numcomm@.@alphatag@.@dirty@
- Autotools generated version
Jump to Line
Something went wrong with that request. Please try again.