7c6b52
###############################################################################
7c6b52
###############################################################################
7c6b52
##
7c6b52
##  Copyright (C) 2019 Red Hat, Inc.  All rights reserved.
7c6b52
##
7c6b52
##  This copyrighted material is made available to anyone wishing to use,
7c6b52
##  modify, copy, or redistribute it subject to the terms and conditions
7c6b52
##  of the GNU General Public License v.2.
7c6b52
##
7c6b52
###############################################################################
7c6b52
###############################################################################
7c6b52
7c6b52
Name:    fence-virt
7c6b52
Summary: A pluggable fencing framework for virtual machines
7c6b52
Version: 1.0.0
84ce09
Release: 6%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
7c6b52
License: GPLv2+
7c6b52
Group:   System Environment/Base
7c6b52
URL:     https://github.com/ClusterLabs/fence-virt
7c6b52
Source0: %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.bz2
ba9783
Patch0:  bz1927171-fence_xvm-fix-typo.patch
84ce09
Patch1:  bz2132010-fence_virt-add-note-reboot-action.patch
84ce09
Patch2:  bz2138825-fence_virtd-update-manpage.patch
84ce09
Patch3:  bz2144530-fence_virtd-warn-files-not-mode-600.patch
84ce09
Patch4:  bz2149649-fence_virtd-update-fence_virt.conf-manpage.patch
c28914
c28914
%if 0%{?rhel}
c28914
ExclusiveArch: i686 x86_64
c28914
%endif
c28914
7c6b52
%if 0%{?suse_version}
7c6b52
%define nss_devel mozilla-nss-devel
7c6b52
%define nspr_devel mozilla-nspr-devel
7c6b52
%define systemd_units systemd
7c6b52
%else
7c6b52
%define nss_devel nss-devel
7c6b52
%define nspr_devel nspr-devel
7c6b52
%define systemd_units systemd-units
7c6b52
%endif
c28914
7c6b52
BuildRequires: gcc
7c6b52
BuildRequires: corosynclib-devel libvirt-devel
7c6b52
BuildRequires: automake autoconf libtool libxml2-devel %{nss_devel} %{nspr_devel}
7c6b52
BuildRequires: flex bison libuuid-devel
c28914
7c6b52
BuildRequires:    systemd-units
7c6b52
Requires(post):   systemd-sysv systemd-units
7c6b52
Requires(preun):  systemd-units
7c6b52
Requires(postun): systemd-units
c28914
c28914
Conflicts:	fence-agents < 3.0.5-2
c28914
c28914
%prep
84ce09
%setup -q -n %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
84ce09
%patch0 -p1
84ce09
%patch1 -p1
84ce09
%patch2 -p1
84ce09
%patch3 -p1
84ce09
%patch4 -p1
c28914
c28914
%build
c28914
./autogen.sh
c28914
%{configure} --disable-libvirt-qmf-plugin --enable-cpg-plugin
c28914
make %{?_smp_mflags}
c28914
c28914
%install
c28914
rm -rf %{buildroot}
c28914
make install DESTDIR=%{buildroot}
c28914
c28914
# Systemd unit file
c28914
mkdir -p %{buildroot}/%{_unitdir}/
c28914
install -m 0644 fence_virtd.service %{buildroot}/%{_unitdir}/
c28914
7c6b52
rm -f %{buildroot}/%{_libdir}/%{name}/*.*a
c28914
c28914
%post
c28914
ccs_update_schema > /dev/null 2>&1 ||:
c28914
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
7c6b52
if [ $1 -eq 1 ]; then
7c6b52
    # Initial installation
c28914
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
c28914
fi
c28914
c28914
%preun
c28914
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
7c6b52
if [ $1 -eq 0 ]; then
c28914
    # Package removal, not upgrade
c28914
    /bin/systemctl --no-reload disable fence_virtd.service &> /dev/null || :
c28914
    /bin/systemctl stop fence_virtd.service &> /dev/null || :
c28914
fi
c28914
c28914
%postun
c28914
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
c28914
/bin/systemctl daemon-reload &> /dev/null || :
7c6b52
if [ $1 -ge 1 ]; then
c28914
    # Package upgrade, not uninstall
c28914
    /bin/systemctl try-restart fence_virtd.service &> /dev/null || :
c28914
fi
c28914
c28914
%triggerun -- fence_virtd < 0.3.0-1
c28914
# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Packages_migrating_to_a_systemd_unit_file_from_a_SysV_initscript
c28914
/usr/bin/systemd-sysv-convert --save fence_virtd &> /dev/null || :
c28914
/sbin/chkconfig --del fence_virtd &> /dev/null || :
c28914
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
c28914
/bin/systemctl try-restart fence_virtd.service &> /dev/null || :
c28914
7c6b52
%description
7c6b52
Fencing agent for virtual machines.
7c6b52
7c6b52
%files
7c6b52
%doc COPYING TODO README
7c6b52
%{_sbindir}/fence_virt
7c6b52
%{_sbindir}/fence_xvm
7c6b52
%{_mandir}/man8/fence_virt.*
7c6b52
%{_mandir}/man8/fence_xvm.*
c28914
7c6b52
%package -n fence-virtd
7c6b52
Summary: Daemon which handles requests from fence-virt
7c6b52
Group:   System Environment/Base
7c6b52
%description -n fence-virtd
7c6b52
This package provides the host server framework, fence_virtd,
7c6b52
for fence_virt.  The fence_virtd host daemon is resposible for
7c6b52
processing fencing requests from virtual machines and routing
7c6b52
the requests to the appropriate physical machine for action.
c28914
%files -n fence-virtd
c28914
%{_sbindir}/fence_virtd
c28914
%{_unitdir}/fence_virtd.service
c28914
%config(noreplace) %{_sysconfdir}/fence_virt.conf
c28914
%dir %{_libdir}/%{name}
7c6b52
%{_libdir}/%{name}/vsock.so
c28914
%{_mandir}/man5/fence_virt.conf.*
c28914
%{_mandir}/man8/fence_virtd.*
c28914
7c6b52
%package -n fence-virtd-multicast
7c6b52
Summary:  Multicast listener for fence-virtd
7c6b52
Group:	  System Environment/Base
7c6b52
Requires: fence-virtd
7c6b52
%description -n fence-virtd-multicast
7c6b52
Provides multicast listener capability for fence-virtd.
c28914
%files -n fence-virtd-multicast
c28914
%{_libdir}/%{name}/multicast.so
c28914
7c6b52
%package -n fence-virtd-serial
7c6b52
Summary:  Serial VMChannel listener for fence-virtd
7c6b52
Group:    System Environment/Base
7c6b52
Requires: libvirt >= 0.6.2
7c6b52
Requires: fence-virtd
7c6b52
%description -n fence-virtd-serial
7c6b52
Provides serial VMChannel listener capability for fence-virtd.
c28914
%files -n fence-virtd-serial
c28914
%{_libdir}/%{name}/serial.so
c28914
7c6b52
%package -n fence-virtd-tcp
7c6b52
Summary:  TCP listener for fence-virtd
7c6b52
Group:    System Environment/Base
7c6b52
Requires: fence-virtd
7c6b52
%description -n fence-virtd-tcp
7c6b52
Provides TCP listener capability for fence-virtd.
c28914
%files -n fence-virtd-tcp
c28914
%{_libdir}/%{name}/tcp.so
c28914
7c6b52
%package -n fence-virtd-libvirt
7c6b52
Summary:  Libvirt backend for fence-virtd
7c6b52
Group:    System Environment/Base
7c6b52
Requires: libvirt >= 0.6.0
7c6b52
Requires: fence-virtd
7c6b52
%description -n fence-virtd-libvirt
7c6b52
Provides fence_virtd with a connection to libvirt to fence
7c6b52
virtual machines.  Useful for running a cluster of virtual
7c6b52
machines on a desktop.
c28914
%files -n fence-virtd-libvirt
7c6b52
%{_libdir}/%{name}/virt.so
c28914
7c6b52
%package -n fence-virtd-cpg
7c6b52
Summary:  CPG/libvirt backend for fence-virtd
7c6b52
Group:    System Environment/Base
7c6b52
Requires: corosynclib
7c6b52
Requires: fence-virtd
7c6b52
%description -n fence-virtd-cpg
7c6b52
Provides fence_virtd with a connection to libvirt to fence
7c6b52
virtual machines. Uses corosync CPG to keep track of VM
7c6b52
locations to allow for non-local VMs to be fenced when VMs
7c6b52
are located on corosync cluster nodes.
c28914
%files -n fence-virtd-cpg
c28914
%{_libdir}/%{name}/cpg.so
c28914
c28914
%changelog
84ce09
* Fri Dec  2 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 1.0.0-6
84ce09
- fence_virtd: add info about multiple uuid/ip entries to manpage
84ce09
84ce09
  Resolves: rhbz#2149649
84ce09
84ce09
* Tue Nov 22 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 1.0.0-5
84ce09
- fence_virtd: warn if config or key file(s) are not mode 600
84ce09
84ce09
  Resolves: rhbz#bz2144530
84ce09
84ce09
* Mon Oct 31 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 1.0.0-4
84ce09
- fence_virtd: add link to uri examples and uri w/socket path
84ce09
  example for when VMS are run as non-root user to manpage
84ce09
84ce09
  Resolves: rhbz#2138825
84ce09
84ce09
* Wed Oct  5 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 1.0.0-3
84ce09
- fence_virt: add note that reboot-action doesnt power on nodes that
84ce09
  are powered off
84ce09
  Resolves: rhbz#2132010
84ce09
ba9783
* Fri Oct 15 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 1.0.0-2
ba9783
- fence_xvm: fix typo
ba9783
  Resolves: rhbz#1927171
ba9783
7c6b52
* Wed Mar 11 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 1.0.0-1
7c6b52
- Rebase to fence-virt-1.0.0
7c6b52
  Resolves: rhbz#1774394
7c6b52
8820d7
* Thu Jan 30 2020 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.4.0-9
8820d7
- fence_virtd: fix segfault when no domains are found
8820d7
  Resolves: rhbz#1766993
8820d7
0fcd25
* Tue Jul 23 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.4.0-7
0fcd25
- fence_xvm/fence_virt: dont report success for incorrect parameter
0fcd25
  Resolves: rhbz#1668357
0fcd25
0fcd25
* Tue Apr  9 2019 Oyvind Albrigtsen <oalbrigt@redhat.com> - 0.4.0-6
0fcd25
- Harden with -fPIE and -Wl,-z,now
0fcd25
  Resolves: rhbz#1624110
0fcd25
- Add CI gating tests
0fcd25
  Resolves: rhbz#1682883
0fcd25
c28914
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-4
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c28914
c28914
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-3
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c28914
c28914
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c28914
c28914
* Mon Jun 05 2017 Ryan McCabe <rmccabe@redhat.com> - 0.4.0-1
c28914
- Rebase to fence-virt-0.4.0
c28914
c28914
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-7
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
c28914
c28914
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-6
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
c28914
c28914
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-5
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c28914
c28914
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 0.3.2-4
c28914
- Rebuilt for GCC 5 C++11 ABI change
c28914
c28914
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-3
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
c28914
c28914
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-2
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
c28914
c28914
* Mon Nov 04 2013 Ryan McCabe <rmccabe@redhat.com> - 0.3.2-1
c28914
- New upstream version 0.3.2
c28914
c28914
* Sun Nov 03 2013 Ryan McCabe <rmccabe@redhat.com> - 0.3.1-1
c28914
- Drop executable flags of manual pages
c28914
- Fix for missed libvirtd events
c28914
- Fix for broken systemd service file
c28914
c28914
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-15
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
c28914
c28914
* Wed Jul 10 2013 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-14
c28914
- Fail properly when unable to bind the TCP listener socket.
c28914
- Resolves: rhbz#814515
c28914
c28914
* Tue May 07 2013 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-13
c28914
- Rebuild
c28914
c28914
* Tue May 07 2013 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-12
c28914
- Drop libvirt-qmf-plugin
c28914
c28914
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-11
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c28914
c28914
* Fri Nov 02 2012 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-10
c28914
- bswap fix for big endian
c28914
c28914
* Fri Nov 02 2012 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-9
c28914
- Return success if a domain exists but is already off.
c28914
c28914
* Thu Oct 25 2012 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-8
c28914
- Version bump
c28914
c28914
* Thu Oct 25 2012 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-7
c28914
- Fix uninitialized variable for the -w option.
c28914
c28914
* Mon Oct 15 2012 Ryan McCabe <rmccabe@redhat.com> - 0.3.0-6
c28914
- Add a -w (delay) option.
c28914
- Return failure when attempting to fence a nonexistent domain
c28914
- Improve man pages
c28914
c28914
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.0-5
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c28914
c28914
* Tue Mar 27 2012 Ryan McCabe <rmccabe@fedoraproject.org> 0.3.0-4
c28914
- Add QPid build fix patch from upstream.
c28914
c28914
* Fri Feb 10 2012 Lon Hohberger <lon@fedoraproject.org> 0.3.0-2
c28914
- Fix URL / Source0 lines
c28914
  Resolves: Fedora#706560
c28914
c28914
* Tue Feb 07 2012 Lon Hohberger <lhh@redhat.com> 0.3.0-1
c28914
- Rebase from upstream to 0.3.0
c28914
- Systemd unit file integration
c28914
- Pacemaker backend
c28914
- Various fixes for startup
c28914
- Rename libvirt-qpid to libvirt-qmf backend
c28914
- Updated default configuration for easier deployment on
c28914
  Fedora systems
c28914
c28914
* Tue Feb 07 2012 Lon Hohberger <lhh@redhat.com> - 0.2.3-6
c28914
- Bump and rebuild
c28914
c28914
* Tue Feb 07 2012 Lon Hohberger <lhh@redhat.com> - 0.2.3-5
c28914
- Fixup changelog
c28914
c28914
* Mon Feb 06 2012 Lon Hohberger <lhh@redhat.com> - 0.2.3-4
c28914
- Drop checkpoint backend since cman and openais are gone
c28914
c28914
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-3
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
c28914
c28914
* Fri Jul  8 2011 Fabio M. Di Nitto <fdinitto@redhat.com> - 0.2.3-2
c28914
- add post call to fence-virt to integrate with cluster 3.1.4
c28914
c28914
* Wed Jun 29 2011 Fabio M. Di Nitto <fdinitto@redhat.com> 0.2.3-1
c28914
- new upstream release fix compat regression
c28914
c28914
* Mon Jun 27 2011 Fabio M. Di Nitto <fdinitto@redhat.com> 0.2.2-1
c28914
- new upstream release
c28914
c28914
* Mon May 09 2011 Fabio M. Di Nitto <fdinitto@redhat.com> 0.2.1-5
c28914
- Rebuilt for libqmfconsole soname change
c28914
c28914
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-4
c28914
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
c28914
c28914
* Thu Apr 01 2010 Lon Hohberger <lhh@redhat.com> 0.2.1-3
c28914
- Update specfile to require correct qpid/qmf libraries
c28914
- Resolves: bz#565111
c28914
c28914
* Tue Feb 23 2010 Fabio M. Di Nitto <fdinitto@redhat.com> 0.2.1-2
c28914
- Update spec file to handle correctly versioned Requires
c28914
c28914
* Fri Jan 15 2010 Lon Hohberger <lhh@redhat.com> 0.2.1-1
c28914
- Update to latest upstream version
c28914
- Fix bug around status return codes for VMs which are 'off'
c28914
c28914
* Thu Jan 14 2010 Lon Hohberger <lhh@redhat.com> 0.2-1
c28914
- Update to latest upstream version
c28914
- Serial & VMChannel listener support
c28914
- Static permission map support
c28914
- Man pages
c28914
- Init script
c28914
- Various bugfixes
c28914
c28914
* Mon Sep 21 2009 Lon Hohberger <lhh@redhat.com> 0.1.3-1
c28914
- Update to latest upstream version
c28914
- Adds libvirt-qpid backend support
c28914
- Fixes UUID operation with libvirt backend
c28914
- Adds man page for fence_xvm and fence_virt
c28914
- Provides fence_xvm compatibility for cluster 3.0.6
c28914
c28914
* Mon Sep 21 2009 Lon Hohberger <lhh@redhat.com> 0.1.2-1
c28914
- Update to latest upstream version
c28914
- Fix build issue on i686
c28914
c28914
* Mon Sep 21 2009 Lon Hohberger <lhh@redhat.com> 0.1.1-1
c28914
- Update to latest upstream version
c28914
- Clean up spec file
c28914
c28914
* Mon Sep 21 2009 Lon Hohberger <lhh@redhat.com> 0.1-2
c28914
- Spec file cleanup
c28914
c28914
* Thu Sep 17 2009 Lon Hohberger <lhh@redhat.com> 0.1-1
c28914
- Initial build for rawhide