Sync from SUSE:ALP:Source:Standard:1.0 resource-agents revision ec272be4d1bc851aebe5a5df6badfcfb

This commit is contained in:
Adrian Schröter 2023-06-06 15:23:55 +02:00
commit 5dacbe7dfc
15 changed files with 3558 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,35 @@
From f55ef2a4297f1d2003424cce55a39017f8481ca3 Mon Sep 17 00:00:00 2001
From: Diego Akechi <dakechi@suse.com>
Date: Wed, 14 Aug 2019 11:47:03 +0200
Subject: [PATCH] LVM: Default partial_activation to true in SLE HAE
---
heartbeat/LVM | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/heartbeat/LVM b/heartbeat/LVM
index 287856e5..65a94b36 100755
--- a/heartbeat/LVM
+++ b/heartbeat/LVM
@@ -34,7 +34,8 @@
OCF_RESKEY_volgrpname_default=""
OCF_RESKEY_exclusive_default="false"
OCF_RESKEY_tag_default="pacemaker"
-OCF_RESKEY_partial_activation_default="false"
+# True by default in SLE HAE
+OCF_RESKEY_partial_activation_default="true"
: ${OCF_RESKEY_volgrpname=${OCF_RESKEY_volgrpname_default}}
: ${OCF_RESKEY_exclusive=${OCF_RESKEY_exclusive_default}}
@@ -109,7 +110,7 @@ If "exclusive" is set on a non clustered volume group, this overrides the tag to
<longdesc lang="en">
If set, the volume group will be activated partially even with some
physical volumes missing. It helps to set to true when using mirrored
-logical volumes.
+logical volumes. Enabled by default.
</longdesc>
<shortdesc lang="en">Activate VG partially when missing PVs</shortdesc>
<content type="string" default="${OCF_RESKEY_partial_activation_default}" />
--
2.16.4

View File

@ -0,0 +1,25 @@
From 0fe969d6b2a7269aba16f676558927f76fc38dd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Wed, 1 Feb 2017 14:52:01 +0100
Subject: [PATCH 2/5] nfsserver: fix path to sm-notify
---
heartbeat/nfsserver | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
index bac5bbbb..6e32d37a 100755
--- a/heartbeat/nfsserver
+++ b/heartbeat/nfsserver
@@ -27,7 +27,7 @@ do
done
DEFAULT_NOTIFY_CMD=`which sm-notify`
-DEFAULT_NOTIFY_CMD=${DEFAULT_NOTIFY_CMD:-"/sbin/sm-notify"}
+DEFAULT_NOTIFY_CMD=${DEFAULT_NOTIFY_CMD:-"/usr/sbin/sm-notify"}
DEFAULT_NOTIFY_FOREGROUND="false"
DEFAULT_RPCPIPEFS_DIR="/var/lib/nfs/rpc_pipefs"
EXEC_MODE=0
--
2.13.2

View File

@ -0,0 +1,28 @@
From e8d2bf94bccd1a4884b519af203f3741ad2121a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Wed, 1 Feb 2017 14:52:50 +0100
Subject: [PATCH 3/5] ldirectord: don't create subsys lock
---
ldirectord/init.d/ldirectord.in | 2 --
1 file changed, 2 deletions(-)
diff --git a/ldirectord/init.d/ldirectord.in b/ldirectord/init.d/ldirectord.in
index 9d8083e4..f7ab5525 100755
--- a/ldirectord/init.d/ldirectord.in
+++ b/ldirectord/init.d/ldirectord.in
@@ -60,11 +60,9 @@ action() {
case "$1" in
start)
action "Starting ldirectord" $DAEMON start
- touch /var/lock/subsys/ldirectord
;;
stop)
action "Stopping ldirectord" $DAEMON stop
- rm -f /var/lock/subsys/ldirectord
;;
restart)
action "Restarting ldirectord" $DAEMON restart
--
2.13.2

View File

@ -0,0 +1,69 @@
From 1072e6d34fd9edb374385d7430471257335984c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Thu, 18 May 2017 00:18:14 +0200
Subject: [PATCH 4/5] Revert "Low: build: Move binaries in /usr/lib/heartbeat
to /usr/libexec/heartbeat to avoid multi-lib inconsistencies"
This reverts commit 1e79b7831d9daf9cbfa852f0d6f909d2f7ec4a2a.
---
heartbeat/Makefile.am | 2 +-
heartbeat/ocf-directories.in | 2 +-
resource-agents.spec.in | 2 +-
tools/Makefile.am | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/heartbeat/Makefile.am b/heartbeat/Makefile.am
index fd3ca454..4950c6e5 100644
--- a/heartbeat/Makefile.am
+++ b/heartbeat/Makefile.am
@@ -25,7 +25,7 @@ EXTRA_DIST = $(ocf_SCRIPTS) $(ocfcommon_DATA) \
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/linux-ha
-halibdir = $(libexecdir)/heartbeat
+halibdir = $(libdir)/heartbeat
ocfdir = $(OCF_RA_DIR_PREFIX)/heartbeat
diff --git a/heartbeat/ocf-directories.in b/heartbeat/ocf-directories.in
index d8df035e..f734162e 100644
--- a/heartbeat/ocf-directories.in
+++ b/heartbeat/ocf-directories.in
@@ -11,7 +11,7 @@ exec_prefix=@exec_prefix@
: ${HA_RSCTMP:=@HA_RSCTMPDIR@}
: ${HA_RSCTMP_OLD:=@HA_VARRUNDIR@/heartbeat/rsctmp}
: ${HA_FIFO:=@localstatedir@/lib/heartbeat/fifo}
-: ${HA_BIN:=@libexecdir@/heartbeat}
+: ${HA_BIN:=@libdir@/heartbeat}
: ${HA_SBIN_DIR:=@sbindir@}
: ${HA_DATEFMT:="%b %d %T "}
: ${HA_DEBUGLOG:=/dev/null}
diff --git a/resource-agents.spec.in b/resource-agents.spec.in
index 78021f1d..cde87b15 100644
--- a/resource-agents.spec.in
+++ b/resource-agents.spec.in
@@ -289,7 +289,7 @@
%dir %{_sysconfdir}/ha.d
%{_sysconfdir}/ha.d/shellfuncs
-%{_libexecdir}/heartbeat
+%{_libdir}/heartbeat
%if %{with rgmanager}
%post -n resource-agents
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 1186967c..71292bf3 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -23,7 +23,7 @@ SUBDIRS = ocft
AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include
-halibdir = $(libexecdir)/heartbeat
+halibdir = $(libdir)/heartbeat
EXTRA_DIST = ocf-tester.8 sfex_init.8
--
2.13.2

View File

@ -0,0 +1,40 @@
From fa566f94cf5a491ce5f06e9b9edcc5d39edd05f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Thu, 18 May 2017 00:11:10 +0200
Subject: [PATCH 6/6] Revert "ocf_log: use same log format as pacemaker"
This reverts commit 75816393878bf063a8c3404b5c747868024e1097.
---
heartbeat/ocf-directories.in | 2 +-
heartbeat/ocf-shellfuncs.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/heartbeat/ocf-directories.in b/heartbeat/ocf-directories.in
index f734162e..7246e088 100644
--- a/heartbeat/ocf-directories.in
+++ b/heartbeat/ocf-directories.in
@@ -13,7 +13,7 @@ exec_prefix=@exec_prefix@
: ${HA_FIFO:=@localstatedir@/lib/heartbeat/fifo}
: ${HA_BIN:=@libdir@/heartbeat}
: ${HA_SBIN_DIR:=@sbindir@}
-: ${HA_DATEFMT:="%b %d %T "}
+: ${HA_DATEFMT:="%Y/%m/%d_%T "}
: ${HA_DEBUGLOG:=/dev/null}
: ${HA_RESOURCEDIR:=$HA_DIR/resource.d}
: ${HA_DOCDIR:=@datadir@/doc/heartbeat}
diff --git a/heartbeat/ocf-shellfuncs.in b/heartbeat/ocf-shellfuncs.in
index 4a74e201..a0716bb6 100644
--- a/heartbeat/ocf-shellfuncs.in
+++ b/heartbeat/ocf-shellfuncs.in
@@ -231,7 +231,7 @@ __ha_log() {
[ -n "$HA_LOGFILE" ]
then
: appending to $HA_LOGFILE
- echo `hadate`" $HA_LOGTAG: ${*}" >> $HA_LOGFILE
+ echo "$HA_LOGTAG: "`hadate`"${*}" >> $HA_LOGFILE
fi
if
[ -z "$HA_LOGFACILITY" -a -z "$HA_LOGFILE" ] && ! [ "$ignore_stderr" = "true" ]
--
2.12.2

View File

@ -0,0 +1,27 @@
--- configure.ac.orig 2022-10-25 07:51:48.911093203 +0200
+++ configure.ac 2022-10-25 07:53:34.987867250 +0200
@@ -530,24 +530,12 @@
AM_CONDITIONAL(BUILD_AZURE_EVENTS_AZ, test $BUILD_AZURE_EVENTS_AZ -eq 1)
BUILD_GCP_PD_MOVE=1
-if test -z "$PYTHON" || test $BUILD_OCF_PY -eq 0; then
- BUILD_GCP_PD_MOVE=0
- AC_MSG_WARN("Not building gcp-pd-move")
-fi
AM_CONDITIONAL(BUILD_GCP_PD_MOVE, test $BUILD_GCP_PD_MOVE -eq 1)
BUILD_GCP_VPC_MOVE_ROUTE=1
-if test -z "$PYTHON" || test "x${HAVE_PYMOD_PYROUTE2}" != xyes || test $BUILD_OCF_PY -eq 0; then
- BUILD_GCP_VPC_MOVE_ROUTE=0
- AC_MSG_WARN("Not building gcp-vpc-move-route")
-fi
AM_CONDITIONAL(BUILD_GCP_VPC_MOVE_ROUTE, test $BUILD_GCP_VPC_MOVE_ROUTE -eq 1)
BUILD_GCP_VPC_MOVE_VIP=1
-if test -z "$PYTHON" || test $BUILD_OCF_PY -eq 0; then
- BUILD_GCP_VPC_MOVE_VIP=0
- AC_MSG_WARN("Not building gcp-vpc-move-vip")
-fi
AM_CONDITIONAL(BUILD_GCP_VPC_MOVE_VIP, test $BUILD_GCP_VPC_MOVE_VIP -eq 1)
AC_PATH_PROGS(ROUTE, route)

21
_service Normal file
View File

@ -0,0 +1,21 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/ClusterLabs/resource-agents.git</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="filename">resource-agents</param>
<param name="versionformat">@PARENT_TAG@+git@TAG_OFFSET@.%h</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="revision">main</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">resource-agents*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">resource-agents</param>
</service>
</services>

6
_servicedata Normal file
View File

@ -0,0 +1,6 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/ClusterLabs/resource-agents.git</param>
<param name="changesrevision">b02b06c437b1d8cb1dcfe8ace47c2efc4a0e476c</param>
</service>
</servicedata>

BIN
monitoring-plugins-metadata.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

95
nfsnotify.patch Normal file
View File

@ -0,0 +1,95 @@
--- heartbeat/nfsnotify.in.orig 2021-12-06 11:36:48.000000000 +0100
+++ heartbeat/nfsnotify.in 2022-01-19 15:14:17.424694351 +0100
@@ -34,9 +34,11 @@
OCF_RESKEY_source_host_default=""
OCF_RESKEY_notify_args_default=""
+OCF_RESKEY_statd_path_default="/var/lib/nfs/statd"
: ${OCF_RESKEY_source_host=${OCF_RESKEY_source_host_default}}
: ${OCF_RESKEY_notify_args=${OCF_RESKEY_notify_args_default}}
+: ${OCF_RESKEY_statd_path=${OCF_RESKEY_statd_path_default}}
#######################################################################
@@ -50,7 +52,6 @@
NFSNOTIFY_TMP_DIR="${HA_RSCTMP}/nfsnotify_${OCF_RESOURCE_INSTANCE}/"
HA_STATD_PIDFILE="$NFSNOTIFY_TMP_DIR/rpc.statd_${OCF_RESOURCE_INSTANCE}.pid"
HA_STATD_PIDFILE_PREV="$NFSNOTIFY_TMP_DIR/rpc.statd_${OCF_RESOURCE_INSTANCE}.pid.prev"
-STATD_PATH="/var/lib/nfs/statd"
SM_NOTIFY_BINARY="${sbindir}/sm-notify"
IS_RENOTIFY=0
@@ -78,6 +79,15 @@
<content type="string" default="${OCF_RESKEY_source_host_default}" />
</parameter>
+<parameter name="statd_path" unique="0" required="0">
+<longdesc lang="en">
+Path to the directory in which the statd state lives. This needs
+to be on shared storage.
+</longdesc>
+<shortdesc lang="en">statd state directory path</shortdesc>
+<content type="string" default="${OCF_RESKEY_statd_path_default}" />
+</parameter>
+
<parameter name="notify_args" unique="0" required="0">
<longdesc lang="en">
Additional arguments to send to the sm-notify command. By default
@@ -91,6 +101,15 @@
<content type="string" default="${OCF_RESKEY_notify_args_default}" />
</parameter>
+<parameter name="statd_path" unique="0" required="0">
+<longdesc lang="en">
+Path to the directory in which the statd state lives. This needs
+to be on shared storage.
+</longdesc>
+<shortdesc lang="en">statd state directory path</shortdesc>
+<content type="string" default="${OCF_RESKEY_statd_path_default}" />
+</parameter>
+
</parameters>
<actions>
@@ -246,12 +265,12 @@
is_renotify=1
fi
- statd_backup="$STATD_PATH/nfsnotify.bu"
- copy_statd "$STATD_PATH" "$statd_backup"
+ statd_backup="$OCF_RESKEY_statd_path/nfsnotify.bu"
+ copy_statd "$OCF_RESKEY_statd_path" "$statd_backup"
if [ -z "$OCF_RESKEY_source_host" ]; then
if [ "$is_renotify" -eq 0 ]; then
- cur_statd="$STATD_PATH"
+ cur_statd="$OCF_RESKEY_statd_path"
else
cur_statd="$statd_backup"
fi
@@ -271,13 +290,13 @@
# have the first sm-notify use the actual statd directory so the
# notify list can be managed properly.
if [ "$is_renotify" -eq 0 ]; then
- cur_statd="$STATD_PATH"
+ cur_statd="$OCF_RESKEY_statd_path"
# everything after the first notify we are considering a renotification
# which means we don't use the real statd directory.
is_renotify=1
else
# use our copied statd directory for the remaining ip addresses
- cur_statd="$STATD_PATH/nfsnotify_${OCF_RESOURCE_INSTANCE}_${ip}"
+ cur_statd="$OCF_RESKEY_statd_path/nfsnotify_${OCF_RESOURCE_INSTANCE}_${ip}"
copy_statd "$statd_backup" "$cur_statd"
fi
@@ -312,7 +331,7 @@
which restorecon > /dev/null 2>&1 && selinuxenabled
SELINUX_ENABLED=$?
if [ $SELINUX_ENABLED -eq 0 ]; then
- export SELINUX_LABEL="$(ls -dZ $STATD_PATH | grep -o '\S\+:\S\+:\S\+')"
+ export SELINUX_LABEL="$(ls -dZ $OCF_RESKEY_statd_path | grep -o '\S\+:\S\+:\S\+')"
fi
case $__OCF_ACTION in

12
portblock.patch Normal file
View File

@ -0,0 +1,12 @@
--- heartbeat/portblock.orig 2022-01-19 15:27:39.056294933 +0100
+++ heartbeat/portblock 2022-01-19 17:43:18.986060453 +0100
@@ -299,7 +299,8 @@
tickle_remote()
{
[ -z "$OCF_RESKEY_tickle_dir" ] && return
- echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
+ [ -f "/proc/sys/net/ipv4/tcp_tw_recycle" ] && echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
+ [ -f "/proc/sys/net/ipv4/tcp_tw_reuse" ] && echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
f=$OCF_RESKEY_tickle_dir/$OCF_RESKEY_ip
[ -r $f ] || return
$TICKLETCP -n 3 < $f

BIN
resource-agents-4.12.0+git30.7fd7c8fa.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

2897
resource-agents.changes Normal file

File diff suppressed because it is too large Load Diff

274
resource-agents.spec Normal file
View File

@ -0,0 +1,274 @@
#
# spec file for package resource-agents
#
# Copyright (c) 2023 SUSE LLC
#
# 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.12.0+git30.7fd7c8fa
Release: 0
Summary: 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: 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: Revert ocf_log: use same log format at pacemaker
Patch6: 0006-Revert-ocf_log-use-same-log-format-as-pacemaker.patch
# PATCH-FIX-OPENSUSE:
Patch7: 0007-Request-to-add-gcp-vpc-move-route.patch
Patch8: nfsnotify.patch
Patch9: portblock.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cluster-glue-devel
BuildRequires: docbook-xsl-stylesheets
BuildRequires: docbook_4
BuildRequires: libxslt
BuildRequires: pkgconfig
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(glib-2.0)
Requires: /usr/bin/logger
Obsoletes: heartbeat-resources
Provides: %{name}-devel = %{version}
Provides: heartbeat-resources
# Merging the aws-vpc-move-ip package as the upstream RA will be adopted.
Provides: aws-vpc-move-ip = 0.2.20171113
Obsoletes: aws-vpc-move-ip <= 0.2.20171113
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 zfs
Summary: resource-agent for ZFS support
License: GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
Group: Productivity/Clustering/HA
Requires: %{name}
Provides: %{name}:%{_mandir}/man7/ocf_heartbeat_ZFS.*
Provides: %{name}:%{_prefix}/lib/ocf/resource.d/heartbeat/ZFS
%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 zfs
Containing the resource agent and documentation for ZFS support
%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 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: GPL-2.0-or-later AND LGPL-2.1-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
%patch6 -p1
%patch7 -p0
%patch8 -p0
%patch9 -p0
%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 \
--enable-libnet=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
find %{buildroot} -type f -name "*.la" -delete -print
# Unset execute permissions from things that shouln't have it
find %{buildroot} "(" -name "ocf-*" -o -name "*.dtd" ")" -type f -exec chmod a-x "{}" "+"
chmod 0755 %{buildroot}%{_sbindir}/ocf-tester
chmod 0755 %{buildroot}%{_sbindir}/ocft
mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
install -m 644 systemd/resource-agents.conf %{buildroot}%{_prefix}/lib/tmpfiles.d
(
cd %{buildroot}/%{_libdir}/heartbeat
for f in ocf-returncodes ocf-shellfuncs
do
ln -s %{_prefix}/lib/ocf/lib/heartbeat/$f
done
)
# install nagios plugins XML metadata
tar -xjf %{SOURCE1}
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
# Create a symlink for backward compat of suse:aws-vpc-move-ip
(
mkdir -p %{buildroot}%{_prefix}/lib/ocf/resource.d/suse
cd %{buildroot}%{_prefix}/lib/ocf/resource.d/suse
ln -s %{_prefix}/lib/ocf/resource.d/heartbeat/aws-vpc-move-ip aws-vpc-move-ip
)
%post
%service_add_post resource-agents-deps.target
%tmpfiles_create %_tmpfilesdir/resource-agents.conf
%preun
%service_del_preun resource-agents-deps.target
%postun
%service_del_postun resource-agents-deps.target
%pre
%service_add_pre resource-agents-deps.target
%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
%_tmpfilesdir/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
%{_prefix}/lib/ocf/resource.d/suse
%{_prefix}/lib/ocf/resource.d/heartbeat
%exclude %{_prefix}/lib/ocf/resource.d/heartbeat/ZFS
%{_prefix}/lib/ocf/lib/heartbeat
%{_sbindir}/ocf-tester
%{_sbindir}/ocft
%{_sbindir}/sfex_init
%{_sbindir}/sfex_stat
%{_includedir}/heartbeat
%{_unitdir}/resource-agents-deps.target
%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*
%exclude %{_mandir}/man7/ocf_heartbeat_ZFS.*
%{_mandir}/man8/ocf-tester.8*
%{_mandir}/man8/sfex_init.8*
%doc doc/README.webapps
# For compatability with pre-existing agents
%dir %{_sysconfdir}/ha.d
%config %{_sysconfdir}/ha.d/shellfuncs
%dir %{_libdir}/heartbeat
%{_libdir}/heartbeat/*
%{_datadir}/pkgconfig/resource-agents.pc
%files zfs
%{_prefix}/lib/ocf/resource.d/heartbeat/ZFS
%{_mandir}/man7/ocf_heartbeat_ZFS.*
%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