File sbd.spec of Package sbd

# spec file for package sbd
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2013 Lars Marowsky-Bree
# 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

#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
  %define _fillupdir /var/adm/fillup-templates

Name:           sbd
Version:        1.4.0+20190926.79835b5
Release:        0
Summary:        Storage-based death
License:        GPL-2.0-or-later
Group:          Productivity/Clustering/HA
Source:         %{name}-%{version}.tar.xz
Patch1:         bsc#1140065-Fix-sbd-cluster-exit-if-cmap-is-disconnected.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  e2fsprogs-devel
BuildRequires:  libaio-devel
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(corosync)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libqb)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(pacemaker)
BuildRequires:  pkgconfig(pacemaker-cib)
BuildRequires:  pkgconfig(uuid)
Requires(post): %fillup_prereq
Conflicts:      ClusterTools2 < 2.3.2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package contains the storage-based death functionality.

%autosetup -n %{name}-%{version} -p1

autoreconf -fvi
make %{?_smp_mflags}

%make_install LIBDIR=%{_libdir}
install -D -m 0755 src/ %{buildroot}%{_datadir}/sbd/
install -D -m 0644 src/sbd.service %{buildroot}/%{_unitdir}/sbd.service
install -D -m 0644 src/sbd_remote.service %{buildroot}/%{_unitdir}/sbd_remote.service
ln -s service %{buildroot}%{_sbindir}/rcsbd
ln -s service %{buildroot}%{_sbindir}/rcsbd_remote
mkdir -p %{buildroot}%{_fillupdir}
install -m 0644 src/sbd.sysconfig %{buildroot}%{_fillupdir}/sysconfig.sbd

%service_add_post sbd.service sbd_remote.service

if [ ! -e %{_sysconfdir}/sysconfig/sbd ]; then
    %fillup_only sbd

%service_add_pre sbd.service sbd_remote.service

%service_del_preun -n sbd.service sbd_remote.service

%service_del_postun -n sbd.service sbd_remote.service