%global debug_package %{nil} Name: fence-agents-epel Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.10.0 Release: 1%{?dist} License: GPLv2+ and LGPLv2+ BuildArch: noarch Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents Source0: %{url}/archive/refs/tags/v%{version}.tar.gz %if 0%{?rhel} == 7 %ifarch s390x %define rhel7_s390x 1 %endif %endif %if 0%{?rhel} == 9 %ifarch ppc64le s390x %define rhel9_ppc64le_s390x 1 %endif %endif # Build dependencies ## man pages generating BuildRequires: libxslt ## Python dependencies %if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version} BuildRequires: python3-devel python3-httplib2 python3-pexpect python3-pycurl python3-requests %endif Requires: fence-agents-common = %{version}-%{release} %if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version} Requires: python3-pycurl %else Requires: python-pycurl %endif %description Fence agents for PVE, raritan, rcd_serial, virsh # turn off the brp-python-bytecompile script # (for F28+ or equivalent, the latter is the preferred form) %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompilespace:.*$!!g') #undefine __brp_python_bytecompile %prep %setup -q -n fence-agents-%{version} %autopatch -p1 %build %if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version} export PYTHON="%{__python3}" %endif %install rm -rf %{buildroot} mkdir -p %{buildroot}/%{_sbindir} install -m 0755 %{_builddir}/fence-agents-%{version}/agents/pve/fence_pve.py %{buildroot}%{_sbindir}/fence_pve install -m 0755 %{_builddir}/fence-agents-%{version}/agents/raritan/fence_raritan.py %{buildroot}%{_sbindir}/fence_raritan install -m 0755 %{_builddir}/fence-agents-%{version}/agents/rcd_serial/fence_rcd_serial.py %{buildroot}%{_sbindir}/fence_rcd_serial install -m 0755 %{_builddir}/fence-agents-%{version}/agents/virsh/fence_virsh.py %{buildroot}%{_sbindir}/fence_virsh sed -i "s|@PYTHON@ -tt|%{__python3}|" %{buildroot}%{_sbindir}/fence* # bytecompile Python source code in a non-standard location %if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 %py_byte_compile %{__python3} %{buildroot}%{_sbindir}/fence* %endif ## tree fix up # fix libfence permissions chmod 0755 %{buildroot}%{_sbindir}/fence_{pve,raritan,rcd_serial,virsh} # remove docs rm -rf %{buildroot}/usr/share/doc/fence-agents # remove .a files rm -f %{buildroot}/%{_libdir}/%{name}/*.*a %post ccs_update_schema > /dev/null 2>&1 ||: # https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi %files %{_sbindir}/fence_pve #%{_mandir}/man8/fence_pve.8* %{_sbindir}/fence_raritan #%{_mandir}/man8/fence_raritan.8* %{_sbindir}/fence_rcd_serial #%{_mandir}/man8/fence_rcd_serial.8* %{_sbindir}/fence_virsh #%{_mandir}/man8/fence_virsh.8* %changelog * Sun Jul 24 2022 Example - 4.10.0-1 - Initial build