2024-03-27 14:52:07 +08:00
|
|
|
%global longcommit cf5c2208bad2db2dff9b09624b89b05415c3bc11
|
2023-02-02 14:08:34 +08:00
|
|
|
%global shortcommit %(echo %{longcommit}|cut -c1-8)
|
|
|
|
|
%global modified %(echo %{longcommit}-|cut -f2 -d-)
|
2020-11-05 17:52:57 +08:00
|
|
|
%global github_owner Clusterlabs
|
2024-04-16 22:24:50 +08:00
|
|
|
%global buildnum 2
|
2024-03-27 14:52:07 +08:00
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
%global watchdog_timeout_default 5
|
|
|
|
|
|
2024-03-27 14:52:07 +08:00
|
|
|
# Be careful with sync_resource_startup_default
|
|
|
|
|
# being enabled. This configuration has
|
|
|
|
|
# to be in sync with configuration in pacemaker
|
|
|
|
|
# where it is called sbd_sync - assure by e.g.
|
|
|
|
|
# mutual rpm dependencies.
|
2023-02-02 14:08:34 +08:00
|
|
|
%bcond_without sync_resource_startup_default
|
2024-03-27 14:52:07 +08:00
|
|
|
# Syncing enabled per default will lead to
|
|
|
|
|
# syncing enabled on upgrade without adaption
|
|
|
|
|
# of the config.
|
|
|
|
|
# Setting can still be overruled via sysconfig.
|
|
|
|
|
# The setting in the config-template packaged
|
|
|
|
|
# will follow the default if below is is left
|
|
|
|
|
# empty. But it is possible to have the setting
|
|
|
|
|
# in the config-template deviate from the default
|
|
|
|
|
# by setting below to an explicit 'yes' or 'no'.
|
|
|
|
|
%global sync_resource_startup_sysconfig ""
|
2020-11-05 17:52:57 +08:00
|
|
|
|
|
|
|
|
Name: sbd
|
|
|
|
|
Summary: Storage-based death
|
2024-03-27 14:52:07 +08:00
|
|
|
License: GPL-2.0-or-later
|
2020-11-05 17:52:57 +08:00
|
|
|
Group: System Environment/Daemons
|
2024-03-27 14:52:07 +08:00
|
|
|
Version: 1.5.2
|
2021-12-16 17:18:00 +08:00
|
|
|
Release: %{buildnum}
|
2020-11-05 17:52:57 +08:00
|
|
|
Url: https://github.com/%{github_owner}/%{name}
|
2023-02-02 14:08:34 +08:00
|
|
|
Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz
|
2022-03-28 16:11:09 +08:00
|
|
|
Patch0: 0001-Fix-the-problem-of-service-error-when-uninstalling.patch
|
2024-03-27 14:52:07 +08:00
|
|
|
Patch1: 0001-Fix-query-watchdog-avoid-issues-on-heap-allocation-f.patch
|
|
|
|
|
Patch2: 0002-Refactor-sbd-md-alloc-de-alloc-reverse-order.patch
|
|
|
|
|
Patch3: 0003-spec-convert-license-naming-to-SPDX.patch
|
2024-04-16 22:24:50 +08:00
|
|
|
Patch4: 0004-test-load-libaio.so-instead-of-libaio.so.1.patch
|
2020-11-05 17:52:57 +08:00
|
|
|
BuildRequires: autoconf
|
|
|
|
|
BuildRequires: automake
|
|
|
|
|
BuildRequires: libuuid-devel
|
|
|
|
|
BuildRequires: glib2-devel
|
|
|
|
|
BuildRequires: libaio-devel
|
|
|
|
|
BuildRequires: corosynclib-devel
|
|
|
|
|
BuildRequires: pacemaker-libs-devel > 1.1.12
|
|
|
|
|
BuildRequires: libtool
|
|
|
|
|
BuildRequires: libuuid-devel
|
|
|
|
|
BuildRequires: libxml2-devel
|
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
|
BuildRequires: systemd
|
2023-02-02 14:08:34 +08:00
|
|
|
BuildRequires: make
|
2024-03-27 14:52:07 +08:00
|
|
|
Conflicts: fence-agents-sbd < 4.5.0
|
|
|
|
|
Conflicts: pacemaker-libs < 2.1.0
|
2020-11-05 17:52:57 +08:00
|
|
|
|
2024-03-06 14:02:00 +08:00
|
|
|
ExclusiveArch: x86_64 aarch64 riscv64 loongarch64 ppc64le
|
2020-11-05 17:52:57 +08:00
|
|
|
%if %{defined systemd_requires}
|
|
|
|
|
%systemd_requires
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%description
|
2024-03-27 14:52:07 +08:00
|
|
|
|
2020-11-05 17:52:57 +08:00
|
|
|
This package contains the storage-based death functionality.
|
2024-03-27 14:52:07 +08:00
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
Available rpmbuild rebuild options:
|
|
|
|
|
--with(out) : sync_resource_startup_default
|
|
|
|
|
|
2024-03-27 14:52:07 +08:00
|
|
|
%package tests
|
2023-02-02 14:08:34 +08:00
|
|
|
Summary: Storage-based death environment for regression tests
|
2024-03-27 14:52:07 +08:00
|
|
|
License: GPL-2.0-or-later
|
2020-11-05 17:52:57 +08:00
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
%description tests
|
|
|
|
|
This package provides an environment + testscripts for
|
|
|
|
|
regression-testing sbd.
|
2020-11-05 17:52:57 +08:00
|
|
|
|
|
|
|
|
%prep
|
2023-02-02 14:08:34 +08:00
|
|
|
%autosetup -p1 -n %{name}-%{longcommit}
|
2020-11-05 17:52:57 +08:00
|
|
|
|
|
|
|
|
%build
|
2023-02-02 14:08:34 +08:00
|
|
|
./autogen.sh
|
|
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
|
|
|
|
|
%configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \
|
|
|
|
|
--with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \
|
|
|
|
|
--with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} \
|
|
|
|
|
--with-runstatedir=%{_rundir}
|
2020-11-05 17:52:57 +08:00
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
|
|
%install
|
2024-03-27 14:52:07 +08:00
|
|
|
|
2020-11-05 17:52:57 +08:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
|
|
|
|
|
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/stonith
|
2024-03-27 14:52:07 +08:00
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
install -D -m 0755 tests/regressions.sh $RPM_BUILD_ROOT/usr/share/sbd/regressions.sh
|
2020-11-05 17:52:57 +08:00
|
|
|
%if %{defined _unitdir}
|
|
|
|
|
install -D -m 0644 src/sbd.service $RPM_BUILD_ROOT/%{_unitdir}/sbd.service
|
|
|
|
|
install -D -m 0644 src/sbd_remote.service $RPM_BUILD_ROOT/%{_unitdir}/sbd_remote.service
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
|
|
|
|
install -m 644 src/sbd.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/sbd
|
|
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
# 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
|
|
|
|
|
|
2020-11-05 17:52:57 +08:00
|
|
|
%clean
|
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
2024-03-27 14:52:07 +08:00
|
|
|
|
2020-11-05 17:52:57 +08:00
|
|
|
%if %{defined _unitdir}
|
|
|
|
|
%post
|
|
|
|
|
%systemd_post sbd.service
|
|
|
|
|
%systemd_post sbd_remote.service
|
|
|
|
|
if [ $1 -ne 1 ] ; then
|
|
|
|
|
if systemctl --quiet is-enabled sbd.service 2>/dev/null
|
|
|
|
|
then
|
|
|
|
|
systemctl --quiet reenable sbd.service 2>/dev/null || :
|
|
|
|
|
fi
|
|
|
|
|
if systemctl --quiet is-enabled sbd_remote.service 2>/dev/null
|
|
|
|
|
then
|
|
|
|
|
systemctl --quiet reenable sbd_remote.service 2>/dev/null || :
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun sbd.service
|
|
|
|
|
%systemd_preun sbd_remote.service
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%systemd_postun sbd.service
|
|
|
|
|
%systemd_postun sbd_remote.service
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/sbd
|
|
|
|
|
%{_sbindir}/sbd
|
2023-02-02 14:08:34 +08:00
|
|
|
%{_datadir}/sbd
|
|
|
|
|
%{_datadir}/pkgconfig/sbd.pc
|
|
|
|
|
%exclude %{_datadir}/sbd/regressions.sh
|
2020-11-05 17:52:57 +08:00
|
|
|
%doc %{_mandir}/man8/sbd*
|
|
|
|
|
%if %{defined _unitdir}
|
|
|
|
|
%{_unitdir}/sbd.service
|
|
|
|
|
%{_unitdir}/sbd_remote.service
|
|
|
|
|
%endif
|
|
|
|
|
%doc COPYING
|
|
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
%files tests
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%dir %{_datadir}/sbd
|
|
|
|
|
%{_datadir}/sbd/regressions.sh
|
|
|
|
|
%{_libdir}/libsbdtestbed*
|
|
|
|
|
|
2020-11-05 17:52:57 +08:00
|
|
|
%changelog
|
2024-04-16 22:24:50 +08:00
|
|
|
* Thu Apr 25 2024 zouzhimin <zouzhimin@kylinos.cn> - 1.5.2-2
|
|
|
|
|
- test: load libaio.so instead of libaio.so.1
|
|
|
|
|
|
2024-03-27 14:52:07 +08:00
|
|
|
* Wed Mar 27 2024 bizhiyuan <bizhiyuan@kylinos.cn> - 1.5.2-1
|
|
|
|
|
- Update to 1.5.2
|
|
|
|
|
|
2024-03-06 14:02:00 +08:00
|
|
|
* Wed Mar 6 2024 xurui <rui.xu@shingroup.cn> - 1.5.1-4
|
|
|
|
|
- Add ppc64le to ExclusiveArch
|
|
|
|
|
|
2023-11-24 13:34:46 +08:00
|
|
|
* Fri Nov 24 2023 xuxiaojuan <xuxiaojuan@kylinos.cn> - 1.5.1-3
|
|
|
|
|
- Add loongarch64 to ExclusiveArch
|
|
|
|
|
|
2023-06-04 07:39:12 +00:00
|
|
|
* Mon Jun 05 2023 laokz <zhangkai@iscas.ac.cn> - 1.5.1-2
|
|
|
|
|
- Add riscv64 to ExclusiveArch
|
|
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
* Thu Feb 02 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 1.5.1-1
|
|
|
|
|
- Update package to version 1.5.1
|
|
|
|
|
|
2022-03-28 16:11:09 +08:00
|
|
|
* Mon Mar 28 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 1.4.0-17
|
|
|
|
|
- Fix the problem of service error when uninstalling
|
|
|
|
|
|
2023-02-02 14:08:34 +08:00
|
|
|
* Thu Dec 16 2021 liqiuyu <liqiuyu@kylinos.cn> - 1.4.0-16
|
2021-12-16 17:18:00 +08:00
|
|
|
- Remove the release suffix
|
|
|
|
|
|
2020-11-05 17:52:57 +08:00
|
|
|
* Fri Oct 30 2020 jiangxinyu <jiangxinyu@kylinos.cn> - 1.4.0-15
|
|
|
|
|
- Init sbd project
|