From 08868fef603ce5dd82b8417d6c2bb16c9ee6b001 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Wed, 30 Oct 2024 13:56:21 -0400 Subject: [PATCH] Bring spec file in line with upstream changes. - Related: RHEL-61383 --- pacemaker.spec | 134 +++++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 82 deletions(-) diff --git a/pacemaker.spec b/pacemaker.spec index b5ea731..f8f1cb6 100644 --- a/pacemaker.spec +++ b/pacemaker.spec @@ -15,7 +15,7 @@ %global gname haclient ## Where to install Pacemaker documentation -%if 0%{?rhel} +%if 0%{?rhel} > 7 %global pcmk_docdir %{_docdir}/%{name}-doc %else %global pcmk_docdir %{_docdir}/%{name} @@ -48,14 +48,16 @@ ## Since git v2.11, the extent of abbreviation is autoscaled by default ## (used to be constant of 7), so we need to convey it for non-tags, too. +%if (0%{?fedora} >= 26) || (0%{?rhel} >= 9) %global commit_abbrev 9 +%endif # Define conditionals so that "rpmbuild --with " and # "rpmbuild --without " can enable and disable specific features -## Add option to enable support for stonith/external fencing agents -%bcond_with stonithd +## Add option for Linux-HA (stonith/external) fencing agent support +%bcond_with linuxha ## Add option for whether to support storing sensitive information outside CIB %if (0%{?fedora} && 0%{?fedora} <= 33) || (0%{?rhel} && 0%{?rhel} <= 8) @@ -84,14 +86,16 @@ ## to synchronization improves safety, without requiring higher-level tools ## to be aware of the setting or requiring users to modify configurations ## after upgrading to versions that support synchronization. +%if 0%{?rhel} && 0%{?rhel} > 8 %bcond_without sbd_sync +%else +%bcond_with sbd_sync +%endif ## Add option to prefix package version with "0." ## (so later "official" packages will be considered updates) %bcond_with pre_release -## NOTE: skip --with upstart_job - ## Add option to turn off hardening of libraries and daemon executables %bcond_without hardening @@ -102,11 +106,6 @@ %bcond_with legacy_links %endif -## Nagios source control identifiers -%global nagios_name nagios-agents-metadata -%global nagios_hash 105ab8a7b2c16b9a29cf1c1596b80136eeef332b -%global nagios_archive_github_url %{nagios_hash}#/%{nagios_name}-%{nagios_hash}.tar.gz - # Define globals for convenient use later ## Portion of export/dist tarball name after "pacemaker-", and release version @@ -118,9 +117,15 @@ %define pcmk_release %{specversion} %endif +%if 0%{?fedora} > 20 || 0%{?rhel} > 7 ## Base GnuTLS cipher priorities (presumably only the initial, required keyword) ## overridable with "rpmbuild --define 'pcmk_gnutls_priorities PRIORITY-SPEC'" %define gnutls_priorities %{?pcmk_gnutls_priorities}%{!?pcmk_gnutls_priorities:@SYSTEM} +%endif + +%if 0%{?fedora} > 22 || 0%{?rhel} > 7 +%global supports_recommends 1 +%endif ## Different distros name certain packages differently ## (note: corosync libraries also differ, but all provide corosync-devel) @@ -129,7 +134,6 @@ %global pkgname_bzip2_devel bzip2-devel %global pkgname_docbook_xsl docbook-style-xsl %global pkgname_gettext gettext-devel -%global pkgname_gnutls_devel gnutls-devel %global pkgname_shadow_utils shadow-utils %global pkgname_procps procps-ng %global pkgname_glue_libs cluster-glue-libs @@ -138,12 +142,12 @@ ## Distro-specific configuration choices ### Use 2.0-style output when other distro packages don't support current output -%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} <= 8 ) +%if ( 0%{?fedora} && 0%{?fedora} <=35 ) || ( 0%{?rhel} && 0%{?rhel} <= 8 ) %global compat20 --enable-compat-2.0 %endif ### Default concurrent-fencing to true when distro prefers that -%if 0%{?rhel} +%if 0%{?rhel} >= 7 %global concurrent_fencing --with-concurrent-fencing-default=true %endif @@ -213,14 +217,16 @@ Url: https://www.clusterlabs.org/ # # You can use "spectool -s 0 pacemaker.spec" (rpmdevtools) to show final URL. Source0: https://codeload.github.com/%{github_owner}/%{name}/tar.gz/%{archive_github_url} -Source1: https://codeload.github.com/%{github_owner}/%{nagios_name}/tar.gz/%{nagios_archive_github_url} -Source2: pacemaker.sysusers +Source1: pacemaker.sysusers # upstream commits Requires: resource-agents Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} Requires: %{name}-cluster-libs%{?_isa} = %{version}-%{release} Requires: %{name}-cli = %{version}-%{release} +%if %{with linuxha} +Requires: %{python_name}-%{name} = %{version}-%{release} +%endif %{?systemd_requires} %if %{defined centos} @@ -236,8 +242,8 @@ BuildRequires: %{python_name}-devel BuildRequires: %{python_name}-setuptools # Pacemaker requires a minimum libqb functionality -Requires: libqb >= 0.17.0 -BuildRequires: libqb-devel >= 0.17.0 +Requires: libqb >= 1.0.1 +BuildRequires: pkgconfig(libqb) >= 1.0.1 # Required basic build tools BuildRequires: autoconf @@ -251,20 +257,20 @@ BuildRequires: libtool BuildRequires: %{?pkgname_libtool_devel} %endif BuildRequires: make -BuildRequires: pkgconfig +BuildRequires: pkgconfig >= 0.28 BuildRequires: sed # Required for core functionality BuildRequires: pkgconfig(glib-2.0) >= 2.42 -BuildRequires: libxml2-devel >= 2.6.0 +BuildRequires: pkgconfig(gnutls) >= 3.1.7 +BuildRequires: pkgconfig(libxml-2.0) >= 2.9.2 BuildRequires: libxslt-devel -BuildRequires: libuuid-devel +BuildRequires: pkgconfig(uuid) BuildRequires: %{pkgname_bzip2_devel} # Enables optional functionality -BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(dbus-1) >= 1.5.12 BuildRequires: %{pkgname_docbook_xsl} -BuildRequires: %{pkgname_gnutls_devel} BuildRequires: help2man BuildRequires: ncurses-devel BuildRequires: pam-devel @@ -272,6 +278,7 @@ BuildRequires: %{pkgname_gettext} >= 0.18 # Required for "make check" BuildRequires: libcmocka-devel >= 1.1.0 +BuildRequires: %{python_name}-psutil BuildRequires: pkgconfig(systemd) @@ -281,7 +288,7 @@ BuildRequires: git Requires: corosync >= 2.0.0 BuildRequires: corosync-devel >= 2.0.0 -%if %{with stonithd} +%if %{with linuxha} BuildRequires: %{pkgname_glue_libs}-devel %endif @@ -301,12 +308,6 @@ Provides: pacemaker-ticket-support = 2.0 Provides: pcmk-cluster-manager = %{version}-%{release} Provides: pcmk-cluster-manager%{?_isa} = %{version}-%{release} -# Bundled bits -## Pacemaker uses the crypto/md5-buffer module from gnulib -%if 0%{?fedora} || 0%{?rhel} -Provides: bundled(gnulib) = 20200404 -%endif - %description Pacemaker is an advanced, scalable High-Availability cluster resource manager. @@ -319,20 +320,21 @@ when related resources fail and can be configured to periodically check resource health. Available rpmbuild rebuild options: - --with(out) : cibsecrets hardening nls pre_release profiling stonithd + --with(out) : cibsecrets hardening linuxha nls pre_release profiling %package cli License: GPL-2.0-or-later AND LGPL-2.1-or-later Summary: Command line tools for controlling Pacemaker clusters Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} +%if 0%{?supports_recommends} Recommends: pcmk-cluster-manager = %{version}-%{release} # For crm_report Recommends: tar Recommends: bzip2 +%endif Requires: perl-TimeDate Requires: %{pkgname_procps} Requires: psmisc -Requires: %{python_name}-psutil Requires(post):coreutils %description cli @@ -393,7 +395,6 @@ License: GPL-2.0-or-later AND LGPL-2.1-or-later Summary: Pacemaker remote executor daemon for non-cluster nodes Requires: %{pkgname_pcmk_libs}%{?_isa} = %{version}-%{release} Requires: %{name}-cli = %{version}-%{release} -Requires: %{python_name}-%{name} = %{version}-%{release} Requires: resource-agents # -remote can be fully independent of systemd %{?systemd_ordering}%{!?systemd_ordering:%{?systemd_requires}} @@ -416,12 +417,12 @@ Requires: %{name}-cluster-libs%{?_isa} = %{version}-%{release} Requires: %{pkgname_bzip2_devel}%{?_isa} Requires: corosync-devel >= 2.0.0 Requires: glib2-devel%{?_isa} -Requires: libqb-devel%{?_isa} +Requires: libqb-devel%{?_isa} >= 1.0.1 %if %{defined pkgname_libtool_devel_arch} Requires: %{?pkgname_libtool_devel_arch} %endif Requires: libuuid-devel%{?_isa} -Requires: libxml2-devel%{?_isa} >= 2.6.0 +Requires: libxml2-devel%{?_isa} >= 2.9.2 Requires: libxslt-devel%{?_isa} %description -n %{pkgname_pcmk_libs}-devel @@ -437,13 +438,15 @@ Summary: Test framework for cluster-related technologies like Pacemaker Requires: %{python_path} Requires: %{pkgname_pcmk_libs} = %{version}-%{release} Requires: %{name}-cli = %{version}-%{release} +Requires: %{python_name}-%{name} = %{version}-%{release} Requires: %{pkgname_procps} Requires: psmisc +Requires: %{python_name}-psutil BuildArch: noarch # systemd Python bindings are a separate package in some distros %if %{defined systemd_requires} -%if %{defined fedora} || %{defined rhel} +%if 0%{?fedora} > 22 || 0%{?rhel} > 7 Requires: %{python_name}-systemd %endif %endif @@ -475,27 +478,8 @@ Schemas and upgrade stylesheets for Pacemaker Pacemaker is an advanced, scalable High-Availability cluster resource manager. -%package nagios-plugins-metadata -License: GPLv3 -Summary: Pacemaker Nagios Metadata -BuildArch: noarch -# NOTE below are the plugins this metadata uses. -# Requires: nagios-plugins-http -# Requires: nagios-plugins-ldap -# Requires: nagios-plugins-mysql -# Requires: nagios-plugins-pgsql -# Requires: nagios-plugins-tcp -Requires: pcmk-cluster-manager - -%description nagios-plugins-metadata -The metadata files required for Pacemaker to execute the nagios plugin -monitor resources. - %prep -%autosetup -a 1 -n %{name}-%{archive_version} -S git_am -p 1 -# in f33 s390x complains but shouldn't hurt globally -# as configure.ac is checking for support -sed -i configure.ac -e "s/-Wall/-Wall -Wno-format-truncation/" +%autosetup -n %{name}-%{archive_version} -S git_am -p 1 %build @@ -533,9 +517,6 @@ export LDFLAGS_HARDENED_LIB="%{?_hardening_ldflags}" --with-initdir=%{_initrddir} \ --with-runstatedir=%{_rundir} \ --localstatedir=%{_var} \ - --with-nagios \ - --with-nagios-metadata-dir=%{_datadir}/pacemaker/nagios/plugins-metadata/ \ - --with-nagios-plugin-dir=%{_libdir}/nagios/plugins/ \ --with-version=%{version}-%{release} make %{_smp_mflags} V=1 @@ -565,14 +546,12 @@ pushd python %py3_install popd -mkdir -p %{buildroot}%{_datadir}/pacemaker/nagios/plugins-metadata -for file in $(find %{nagios_name}-%{nagios_hash}/metadata -type f); do - install -m 644 $file %{buildroot}%{_datadir}/pacemaker/nagios/plugins-metadata -done - - mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/rpm-state/%{name} +%if %{with nls} +%find_lang %{name} +%endif + # Don't package libtool archives find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f @@ -580,7 +559,7 @@ find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f rm -f %{buildroot}/%{_sbindir}/fence_legacy rm -f %{buildroot}/%{_mandir}/man8/fence_legacy.* -install -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/pacemaker.conf +install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/pacemaker.conf %post %systemd_post pacemaker.service @@ -643,7 +622,7 @@ fi %systemd_postun_with_restart crm_mon.service %pre -n %{pkgname_pcmk_libs} -%sysusers_create_compat %{SOURCE2} +%sysusers_create_compat %{SOURCE1} exit 0 %ldconfig_scriptlets -n %{pkgname_pcmk_libs} @@ -652,18 +631,18 @@ exit 0 %files ########################################################### %config(noreplace) %{_sysconfdir}/sysconfig/pacemaker +%config(noreplace) %{_sysconfdir}/logrotate.d/pacemaker %{_sbindir}/pacemakerd %{_unitdir}/pacemaker.service -%exclude %{_datadir}/pacemaker/nagios/plugins-metadata/* - -%exclude %{_libexecdir}/pacemaker/cts-log-watcher %exclude %{_libexecdir}/pacemaker/cts-support %exclude %{_sbindir}/pacemaker-remoted -%exclude %{_sbindir}/pacemaker_remoted %{_libexecdir}/pacemaker/* +%if %{with linuxha} +%{_sbindir}/fence_legacy +%endif %{_sbindir}/fence_watchdog %doc %{_mandir}/man7/pacemaker-based.* @@ -672,6 +651,9 @@ exit 0 %doc %{_mandir}/man7/pacemaker-fenced.* %doc %{_mandir}/man7/ocf_pacemaker_controld.* %doc %{_mandir}/man7/ocf_pacemaker_remote.* +%if %{with linuxha} +%doc %{_mandir}/man8/fence_legacy.* +%endif %doc %{_mandir}/man8/fence_watchdog.* %doc %{_mandir}/man8/pacemakerd.* @@ -688,7 +670,6 @@ exit 0 %files cli %dir %attr (750, root, %{gname}) %{_sysconfdir}/pacemaker -%config(noreplace) %{_sysconfdir}/logrotate.d/pacemaker %config(noreplace) %{_sysconfdir}/sysconfig/crm_mon %{_unitdir}/crm_mon.service @@ -744,9 +725,6 @@ exit 0 %if %{with cibsecrets} %doc %{_mandir}/man8/cibsecret.* %endif -%exclude %{_mandir}/man8/fence_watchdog.* -%exclude %{_mandir}/man8/pacemakerd.* -%exclude %{_mandir}/man8/pacemaker-remoted.* %doc %{_mandir}/man8/iso8601.* %doc %{_mandir}/man8/stonith_admin.* @@ -797,7 +775,6 @@ exit 0 %{_unitdir}/pacemaker_remote.service %{_sbindir}/pacemaker-remoted -%{_sbindir}/pacemaker_remoted %{_mandir}/man8/pacemaker-remoted.* %license licenses/GPLv2 %doc COPYING @@ -811,7 +788,6 @@ exit 0 %{python3_sitelib}/pacemaker/_cts/ %{_datadir}/pacemaker/tests -%{_libexecdir}/pacemaker/cts-log-watcher %{_libexecdir}/pacemaker/cts-support %license licenses/GPLv2 @@ -843,12 +819,6 @@ exit 0 %{_datadir}/pacemaker/base %{_datadir}/pkgconfig/pacemaker-schemas.pc -%files nagios-plugins-metadata -%dir %{_datadir}/pacemaker/nagios -%dir %{_datadir}/pacemaker/nagios/plugins-metadata -%attr(0644,root,root) %{_datadir}/pacemaker/nagios/plugins-metadata/* -%license %{nagios_name}-%{nagios_hash}/COPYING - %changelog * Wed Oct 30 2024 Chris Lumens - 3.0.0-1 - Rebase on upstream 3.0.0 prerelease