Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F5197292
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
25 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/.gitignore b/.gitignore
index 557c8e1c..ec0e8573 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,39 +1,41 @@
+/*/
autom4te.cache
config.log
configure
include/config.h*
Makefile
y.tab.*
*.o
*.lo
*.la
.deps
.libs
.*version
Makefile.in
*.swp
aclocal.m4
client/fence_virt
client/fence_xvm
common/libfence_virt.a
compile
config.guess
config.status
config.sub
config/config.c
config/libsimpleconfig.a
depcomp
fence_virtd.init
fence_virtd.service
+fence-virt.spec
include/stamp-h1
install-sh
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
server/fence_virtd
fence-virt-*
diff --git a/Makefile.am b/Makefile.am
index 79970f0f..ae59ebbd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,50 +1,127 @@
###############################################################################
###############################################################################
##
## Copyright (C) 2009-2019 Red Hat, Inc.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2.
##
###############################################################################
###############################################################################
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \
config.guess config.sub missing install-sh \
ltmain.sh compile config.h.in config.h.in~ \
autoscan.log configure.scan test-driver \
m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 \
m4/ltsugar.m4 m4/ltversion.m4 include/config.in*
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
+SPEC = $(PACKAGE_NAME).spec
+
+TARFILES = $(PACKAGE_NAME)-$(VERSION).tar.bz2 \
+ $(PACKAGE_NAME)-$(VERSION).tar.gz \
+ $(PACKAGE_NAME)-$(VERSION).tar.xz
+
EXTRA_DIST = autogen.sh .version architecture.txt \
fence_virtd.init.in fence_virtd.service.in \
fence_virt.txt README README.md TODO \
- include build-aux
+ include $(SPEC).in build-aux
SUBDIRS = config common client server man
all-local: fence_virtd.service
clean-local:
- rm -f fence_virtd.service
+ rm -f $(SPEC) fence_virtd.service
+
+distclean-local:
+ rm -f $(PACKAGE_NAME)-*.tar.* $(PACKAGE_NAME)-*.sha256* tag-*
fence_virtd.service: fence_virtd.service.in
SBINDIR="@sbindir@"; \
SCDIR="@sysconfdir@"; \
cat $^ > $@ ; \
echo "EnvironmentFile=-$$SCDIR/sysconfig/fence_virtd" >> $@ ;\
echo "ExecStart=$$SBINDIR/fence_virtd \$$FENCE_VIRTD_ARGS" >> $@
+## make rpm/srpm section.
+
+$(SPEC): $(SPEC).in .version config.status
+ rm -f $@-t $@
+ date="`LC_ALL=C $(UTC_DATE_AT)$(SOURCE_EPOCH) "+%a %b %d %Y"`" && \
+ if [ -f $(abs_srcdir)/.tarball-version ]; then \
+ gitver="`cat $(abs_srcdir)/.tarball-version`" && \
+ rpmver=$$gitver && \
+ alphatag="" && \
+ dirty="" && \
+ numcomm="0"; \
+ elif [ "`git log -1 --pretty=format:x . 2>&1`" = "x" ]; then \
+ gitver="`GIT_DIR=$(abs_srcdir)/.git git describe --abbrev=4 --match='v*' HEAD 2>/dev/null`" && \
+ rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \
+ alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \
+ vtag=`echo $$gitver | sed -e "s/-.*//g"` && \
+ numcomm=`GIT_DIR=$(abs_srcdir)/.git git rev-list $$vtag..HEAD | wc -l` && \
+ cd $(abs_srcdir) && \
+ git update-index --refresh > /dev/null 2>&1 || true && \
+ dirty=`git diff-index --name-only HEAD 2>/dev/null` && cd - 2>/dev/null; \
+ else \
+ gitver="`cd $(abs_srcdir); build-aux/git-version-gen .tarball-version .gitarchivever`" && \
+ rpmver=$$gitver && \
+ alphatag="" && \
+ dirty="" && \
+ numcomm="0"; \
+ fi && \
+ if [ -n "$$dirty" ]; then dirty="dirty"; else dirty=""; fi && \
+ if [ "$$numcomm" = "0" ]; then \
+ sed \
+ -e "s#@version@#$$rpmver#g" \
+ -e "s#%glo.*alpha.*##g" \
+ -e "s#%glo.*numcomm.*##g" \
+ -e "s#@dirty@#$$dirty#g" \
+ -e "s#@date@#$$date#g" \
+ $(abs_srcdir)/$@.in > $@-t; \
+ else \
+ sed \
+ -e "s#@version@#$$rpmver#g" \
+ -e "s#@alphatag@#$$alphatag#g" \
+ -e "s#@numcomm@#$$numcomm#g" \
+ -e "s#@dirty@#$$dirty#g" \
+ -e "s#@date@#$$date#g" \
+ $(abs_srcdir)/$@.in > $@-t; \
+ fi; \
+ if [ -z "$$dirty" ]; then sed -i -e "s#%glo.*dirty.*##g" $@-t; fi
+ sed -i -e "s#@defaultadmgroup@#$(DEFAULTADMGROUP)#g" $@-t
+ chmod a-w $@-t
+ mv $@-t $@
+ rm -f $@-t*
+
+$(TARFILES):
+ $(MAKE) dist
+
+RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
+ --define "_specdir $(abs_builddir)" \
+ --define "_builddir $(abs_builddir)" \
+ --define "_srcrpmdir $(abs_builddir)" \
+ --define "_rpmdir $(abs_builddir)"
+
+srpm: clean
+ $(MAKE) $(SPEC) $(TARFILES)
+ rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
+
+rpm: clean
+ $(MAKE) $(SPEC) $(TARFILES)
+ rpmbuild $(RPMBUILDOPTS) -ba $(SPEC)
+
# release/versioning
BUILT_SOURCES = .version
.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
echo $(SOURCE_EPOCH) > $(distdir)/source_epoch
diff --git a/configure.ac b/configure.ac
index 509e8e96..eff35ed1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,262 +1,300 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([fence-virt],
[m4_esyscmd([build-aux/git-version-gen .tarball-version .gitarchivever])],
[developers@clusterlabs.org])
# Don't let AC_PROC_CC (invoked by AC_USE_SYSTEM_EXTENSIONS) replace
# undefined CFLAGS with -g -O2, overriding our special OPT_CFLAGS.
: ${CFLAGS=""}
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([1.13 dist-bzip2 dist-xz color-tests -Wno-portability subdir-objects])
# sanitize paths
if test "$prefix" = "NONE"; then
prefix="/usr"
if test "$localstatedir" = "\${prefix}/var"; then
localstatedir="/var"
fi
if test "$sysconfdir" = "\${prefix}/etc"; then
sysconfdir="/etc"
fi
if test "$systemddir" = "NONE/lib/systemd/system"; then
systemddir=/lib/systemd/system
fi
if test "$libdir" = "\${exec_prefix}/lib"; then
if test -e /usr/lib64; then
libdir="/usr/lib64"
else
libdir="/usr/lib"
fi
fi
fi
LT_PREREQ([2.2.6])
# --enable-new-dtags: Use RUNPATH instead of RPATH.
# It is necessary to have this done before libtool does linker detection.
# See also: https://github.com/kronosnet/kronosnet/issues/107
# --as-needed: Modern systems have builtin ceil() making -lm superfluous but
# AC_SEARCH_LIBS can't detect this because it tests with a false prototype
AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags],
[AM_LDFLAGS=-Wl,--enable-new-dtags],
[AC_MSG_ERROR(["Linker support for --enable-new-dtags is required"])])
AX_CHECK_LINK_FLAG([-Wl,--as-needed], [AM_LDFLAGS="$AM_LDFLAGS -Wl,--as-needed"])
AM_LDFLAGS="$AM_LDFLAGS -fPIC -fPIE -Wl,-z,now"
AC_SUBST([AM_LDFLAGS])
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
LT_INIT
LDFLAGS="$saved_LDFLAGS"
AM_CFLAGS="-fPIC -fPIE -I\$(top_srcdir)/include -Wall -Wformat=2 -Wstrict-prototypes -Wshadow -Wno-unused -D_GNU_SOURCE"
AC_SUBST([AM_CFLAGS])
COMMON_LDFLAGS="-Wl,-wrap,syslog,-wrap,closelog"
AC_SUBST([COMMON_LDFLAGS])
COMMON_LIBS="-Wl,-Bstatic -L\$(top_builddir)/common -lfence_virt -Wl,-Bdynamic"
AC_SUBST([COMMON_LIBS])
CONFIG_LIBS="-L\$(top_builddir)/config -lsimpleconfig"
AC_SUBST([CONFIG_LIBS])
sysconf=$(eval echo $sysconfdir)
AC_DEFINE_UNQUOTED([SYSCONFDIR], ["$sysconf"], [Default config dir])
###
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([server/main.c])
AC_CONFIG_HEADER([include/config.h])
AC_CANONICAL_HOST
AC_LANG([C])
# Checks for programs.
AC_PROG_YACC
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LEX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
-
PKG_PROG_PKG_CONFIG
# Checks for libraries.
AX_PTHREAD(,[AC_MSG_ERROR([POSIX threads support is required])])
PKG_CHECK_MODULES([nss], [nss])
PKG_CHECK_MODULES([xml2], [libxml-2.0])
PKG_CHECK_MODULES([uuid], [uuid])
saved_LIBS="$LIBS"
LIBS=
AC_SEARCH_LIBS([dlopen], [dl dld], , [AC_MSG_ERROR([dlopen not found])])
AC_SUBST([dl_LIBS], [$LIBS])
LIBS="$saved_LIBS"
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([gettimeofday memmove memset select socket strcasecmp strchr strdup strerror])
#
# Modular build for fence_virtd to split up dependencies
# (default)
#
AC_ARG_ENABLE(modules,
[AS_HELP_STRING([--disable-modules],
[Disable modular build])],
[ modules=$enableval ], [ modules=yes ])
AM_CONDITIONAL([modularbuild], [test "x$modules" == "xyes"])
if test "x$modules" == "xyes"; then
AC_DEFINE_UNQUOTED([_MODULE], [1], [modular build])
fi
### The following options only are used when $modules="yes" ###
# Null plugin: Disabled by default
AC_ARG_ENABLE(null-plugin,
[AS_HELP_STRING([--enable-null-plugin],
[Enable null (no-op) backend plugin])],
[ modnull=$enableval ], [ modnull=no ])
AM_CONDITIONAL([modnull], [test "x$modnull" == "xyes"])
# libvirt plugin: Enabled by default
AC_ARG_ENABLE(libvirt-plugin,
[AS_HELP_STRING([--disable-libvirt-plugin],
[Disable local-mode libvirt backend plugin])],
[ modlibvirt=$enableval ], [ modlibvirt=yes ])
AM_CONDITIONAL([modlibvirt], [test "x$modlibvirt" == "xyes"])
if test "x$modlibvirt" == "xyes"; then
PKG_CHECK_MODULES([virt], [libvirt])
fi
# cpg plugin: Disabled by default
AC_ARG_ENABLE(cpg-plugin,
[AS_HELP_STRING([--enable-cpg-plugin],
[Enable CPG/libvirt backend plugin])],
[ modcpg=$enableval ], [ modcpg=no ])
AM_CONDITIONAL([modcpg], [test "x$modcpg" == "xyes"])
if test "x$modcpg" == "xyes"; then
PKG_CHECK_MODULES([cpg], [libcpg])
fi
# (broken!) libvirt-qmf plugin: Disabled by default
AC_ARG_ENABLE(libvirt-qmf-plugin,
[AS_HELP_STRING([--enable-libvirt-qmf-plugin],
[Enable libvirt-qmf backend plugin])],
[ modlibvirtqmf=$enableval ], [ modlibvirtqmf=no ])
AM_CONDITIONAL([modlibvirtqmf], [test "x$modlibvirtqmf" == "xyes"])
if test "x$modlibvirtqmf" == "xyes"; then
PKG_CHECK_MODULES([qpid], [qpid])
fi
# (broken with pcmk 2.0!) pm-fence plugin: Disabled by default
AC_ARG_ENABLE(pm-fence-plugin,
[AS_HELP_STRING([--enable-pm-fence-plugin],
[Enable pm-fence backend plugin])],
[ modpmfence=$enableval ], [ modpmfence=no ])
AM_CONDITIONAL([modpmfence], [test "x$modpmfence" == "xyes"])
if test "x$modpmfence" == "xyes"; then
PKG_CHECK_MODULES([cib], [pacemaker-cib])
PKG_CHECK_MODULES([ncurses], [ncurses])
PKG_CHECK_MODULES([glib2], [glib-2.0])
AC_SEARCH_LIBS([read_attr_delegate], [cib], [ ], [ AC_DEFINE_UNQUOTED([PM_1_0], [1], [pacemaker 1.0]) ])
fi
# multicast plugin: Enabled by default
AC_ARG_ENABLE(multicast-plugin,
[AS_HELP_STRING([--disable-multicast-plugin],
[Disable multicast listener plugin])],
[ modmulticast=$enableval ], [ modmulticast=yes ])
AM_CONDITIONAL([modmulticast], [test "x$modmulticast" == "xyes"])
# tcp plugin: Enabled by default
AC_ARG_ENABLE(tcp-plugin,
[AS_HELP_STRING([--disable-tcp-plugin],
[Disable TCP listener plugin])],
[ modtcp=$enableval ], [ modtcp=yes ])
AM_CONDITIONAL([modtcp], [test "x$modtcp" == "xyes"])
# serial/libvirt plugin: Enabled by default
AC_ARG_ENABLE(serial-plugin,
[AS_HELP_STRING([--disable-serial-plugin],
[Disable serial listener plugin])],
[ modserial=$enableval ], [ modserial=yes ])
AM_CONDITIONAL([modserial], [test "x$modserial" == "xyes"])
# vsock plugin: Enabled by default
AC_ARG_ENABLE(vsock-plugin,
[AS_HELP_STRING([--disable-vsock-plugin],
[Disable TCP listener plugin])],
[ modvsock=$enableval ], [ modvsock=yes ])
AM_CONDITIONAL([modvsock], [test "x$modvsock" == "xyes"])
#
# Compatibility symlink: enabled by default
#
AC_ARG_ENABLE(xvm-compat,
[AS_HELP_STRING([--disable-xvm-compat],
[Disable fence_xvm symlink compatibility])],
[ xvmcompat=$enableval ], [ xvmcompat=yes ])
AM_CONDITIONAL([xvmcompat], [test "x$xvmcompat" == "xyes"])
+AX_PROG_DATE
+AS_IF([test "$ax_cv_prog_date_gnu_date:$ax_cv_prog_date_gnu_utc" = yes:yes],
+ [UTC_DATE_AT="date -u -d@"],
+ [AS_IF([test "x$ax_cv_prog_date_bsd_date" = xyes],
+ [UTC_DATE_AT="date -u -r"],
+ [AC_MSG_ERROR([date utility unable to convert epoch to UTC])])])
+AC_SUBST([UTC_DATE_AT])
+
+AC_ARG_VAR([SOURCE_EPOCH],[last modification date of the source])
+AC_MSG_NOTICE([trying to determine source epoch])
+AC_MSG_CHECKING([for source epoch in \$SOURCE_EPOCH])
+AS_IF([test -n "$SOURCE_EPOCH"],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for source epoch in source_epoch file])
+ AS_IF([test -e "$srcdir/source_epoch"],
+ [read SOURCE_EPOCH <"$srcdir/source_epoch"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for source epoch baked in by gitattributes export-subst])
+ SOURCE_EPOCH='$Format:%at$' # template for rewriting by git-archive
+ AS_CASE([$SOURCE_EPOCH],
+ [?Format:*], # was not rewritten
+ [AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([for source epoch in \$SOURCE_DATE_EPOCH])
+ AS_IF([test "x$SOURCE_DATE_EPOCH" != x],
+ [SOURCE_EPOCH="$SOURCE_DATE_EPOCH"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_CHECKING([whether git log can provide a source epoch])
+ SOURCE_EPOCH=f${SOURCE_EPOCH#\$F} # convert into git log --pretty format
+ SOURCE_EPOCH=$(cd "$srcdir" && git log -1 --pretty=${SOURCE_EPOCH%$} 2>/dev/null)
+ AS_IF([test -n "$SOURCE_EPOCH"],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no, using current time and breaking reproducibility])
+ SOURCE_EPOCH=$(date +%s)])])],
+ [AC_MSG_RESULT([yes])]
+ )])
+ ])
+AC_MSG_NOTICE([using source epoch $($UTC_DATE_AT$SOURCE_EPOCH +'%F %T %Z')])
AC_CONFIG_FILES([Makefile
fence_virtd.init
man/Makefile
client/Makefile
common/Makefile
config/Makefile
server/Makefile])
-
if test "x$VERSION" = "xUNKNOWN"; then
AC_MSG_ERROR([m4_text_wrap([
configure was unable to determine the source tree's current version. This
generally happens when using git archive (or the github download button)
generated tarball/zip file. In order to workaround this issue, either use git
clone https://github.com/ClusterLabs/fence-virt.git or use an official release
tarball. Alternatively you can add a compatible version in a .tarball-version
file at the top of the source tree, wipe your autom4te.cache dir and generated
configure, and rerun autogen.sh.
], [ ], [ ], [76])])
fi
AC_OUTPUT
diff --git a/fence-virt.spec.in b/fence-virt.spec.in
new file mode 100644
index 00000000..42d8b274
--- /dev/null
+++ b/fence-virt.spec.in
@@ -0,0 +1,172 @@
+###############################################################################
+###############################################################################
+##
+## Copyright (C) 2019 Red Hat, Inc. All rights reserved.
+##
+## This copyrighted material is made available to anyone wishing to use,
+## modify, copy, or redistribute it subject to the terms and conditions
+## of the GNU General Public License v.2.
+##
+###############################################################################
+###############################################################################
+
+%global alphatag @alphatag@
+%global numcomm @numcomm@
+%global dirty @dirty@
+
+Name: fence-virt
+Summary: A pluggable fencing framework for virtual machines
+Version: @version@
+Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
+License: GPLv2+
+URL: https://github.com/ClusterLabs/fence-virt
+Source0: %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.bz2
+
+%if 0%{?suse_version}
+%define nss_devel mozilla-nss-devel
+%define nspr_devel mozilla-nspr-devel
+%define systemd_units systemd
+%else
+%define nss_devel nss-devel
+%define nspr_devel nspr-devel
+%define systemd_units systemd-units
+%endif
+
+BuildRequires: gcc
+BuildRequires: corosynclib-devel libvirt-devel
+BuildRequires: automake autoconf libtool libxml2-devel %{nss_devel} %{nspr_devel}
+BuildRequires: flex bison libuuid-devel
+
+BuildRequires: %{systemd_units}
+Requires(post): systemd-sysv %{systemd_units}
+Requires(preun): %{systemd_units}
+Requires(postun): %{systemd_units}
+
+Conflicts: fence-agents < 3.0.5-2
+
+%prep
+%setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
+
+%build
+./autogen.sh
+%{configure} --disable-libvirt-qmf-plugin --enable-cpg-plugin
+make %{?_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+
+# Systemd unit file
+mkdir -p %{buildroot}/%{_unitdir}/
+install -m 0644 fence_virtd.service %{buildroot}/%{_unitdir}/
+
+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
+
+%preun
+# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
+if [ $1 -eq 0 ] ; then
+ # Package removal, not upgrade
+ /bin/systemctl --no-reload disable fence_virtd.service &> /dev/null || :
+ /bin/systemctl stop fence_virtd.service &> /dev/null || :
+fi
+
+%postun
+# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd
+/bin/systemctl daemon-reload &> /dev/null || :
+if [ $1 -ge 1 ] ; then
+ # Package upgrade, not uninstall
+ /bin/systemctl try-restart fence_virtd.service &> /dev/null || :
+fi
+
+%triggerun -- fence_virtd < 0.3.0-1
+# https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Packages_migrating_to_a_systemd_unit_file_from_a_SysV_initscript
+/usr/bin/systemd-sysv-convert --save fence_virtd &> /dev/null || :
+/sbin/chkconfig --del fence_virtd &> /dev/null || :
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+/bin/systemctl try-restart fence_virtd.service &> /dev/null || :
+
+%description
+Fencing agent for virtual machines.
+
+%files
+%doc COPYING TODO README
+%{_sbindir}/fence_virt
+%{_sbindir}/fence_xvm
+%{_mandir}/man8/fence_virt.*
+%{_mandir}/man8/fence_xvm.*
+
+%package -n fence-virtd
+Summary: Daemon which handles requests from fence-virt
+%description -n fence-virtd
+This package provides the host server framework, fence_virtd,
+for fence_virt. The fence_virtd host daemon is resposible for
+processing fencing requests from virtual machines and routing
+the requests to the appropriate physical machine for action.
+%files -n fence-virtd
+%{_sbindir}/fence_virtd
+%{_unitdir}/fence_virtd.service
+%config(noreplace) %{_sysconfdir}/fence_virt.conf
+%dir %{_libdir}/%{name}
+%{_libdir}/%{name}/vsock.so
+%{_mandir}/man5/fence_virt.conf.*
+%{_mandir}/man8/fence_virtd.*
+
+%package -n fence-virtd-multicast
+Summary: Multicast listener for fence-virtd
+Requires: fence-virtd
+%description -n fence-virtd-multicast
+Provides multicast listener capability for fence-virtd.
+%files -n fence-virtd-multicast
+%{_libdir}/%{name}/multicast.so
+
+%package -n fence-virtd-serial
+Summary: Serial VMChannel listener for fence-virtd
+Requires: libvirt >= 0.6.2
+Requires: fence-virtd
+%description -n fence-virtd-serial
+Provides serial VMChannel listener capability for fence-virtd.
+%files -n fence-virtd-serial
+%{_libdir}/%{name}/serial.so
+
+%package -n fence-virtd-tcp
+Summary: TCP listener for fence-virtd
+Requires: fence-virtd
+%description -n fence-virtd-tcp
+Provides TCP listener capability for fence-virtd.
+%files -n fence-virtd-tcp
+%{_libdir}/%{name}/tcp.so
+
+%package -n fence-virtd-libvirt
+Summary: Libvirt backend for fence-virtd
+Requires: libvirt >= 0.6.0
+Requires: fence-virtd
+%description -n fence-virtd-libvirt
+Provides fence_virtd with a connection to libvirt to fence
+virtual machines. Useful for running a cluster of virtual
+machines on a desktop.
+%files -n fence-virtd-libvirt
+%{_libdir}/%{name}/virt.so
+
+%package -n fence-virtd-cpg
+Summary: CPG/libvirt backend for fence-virtd
+Requires: corosynclib
+Requires: fence-virtd
+%description -n fence-virtd-cpg
+Provides fence_virtd with a connection to libvirt to fence
+virtual machines. Uses corosync CPG to keep track of VM
+locations to allow for non-local VMs to be fenced when VMs
+are located on corosync cluster nodes.
+%files -n fence-virtd-cpg
+%{_libdir}/%{name}/cpg.so
+
+%changelog
+* @date@ Autotools generated version <nobody@nowhere.org> - @version@-@specver@-@numcomm@.@alphatag@.@dirty@
+- Autotools generated version
diff --git a/m4/ax_prog_date.m4 b/m4/ax_prog_date.m4
new file mode 100644
index 00000000..c85f0f24
--- /dev/null
+++ b/m4/ax_prog_date.m4
@@ -0,0 +1,137 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_prog_date.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PROG_DATE()
+#
+# DESCRIPTION
+#
+# This macro tries to determine the type of the date (1) command and some
+# of its non-standard capabilities.
+#
+# The type is determined as follow:
+#
+# * If the version string contains "GNU", then:
+# - The variable ax_cv_prog_date_gnu is set to "yes".
+# - The variable ax_cv_prog_date_type is set to "gnu".
+#
+# * If date supports the "-v 1d" option, then:
+# - The variable ax_cv_prog_date_bsd is set to "yes".
+# - The variable ax_cv_prog_date_type is set to "bsd".
+#
+# * If both previous checks fail, then:
+# - The variable ax_cv_prog_date_type is set to "unknown".
+#
+# The following capabilities of GNU date are checked:
+#
+# * If date supports the --date arg option, then:
+# - The variable ax_cv_prog_date_gnu_date is set to "yes".
+#
+# * If date supports the --utc arg option, then:
+# - The variable ax_cv_prog_date_gnu_utc is set to "yes".
+#
+# The following capabilities of BSD date are checked:
+#
+# * If date supports the -v 1d option, then:
+# - The variable ax_cv_prog_date_bsd_adjust is set to "yes".
+#
+# * If date supports the -r arg option, then:
+# - The variable ax_cv_prog_date_bsd_date is set to "yes".
+#
+# All the aforementioned variables are set to "no" before a check is
+# performed.
+#
+# LICENSE
+#
+# Copyright (c) 2017 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 3
+
+AC_DEFUN([AX_PROG_DATE], [dnl
+ AC_CACHE_CHECK([for GNU date], [ax_cv_prog_date_gnu], [
+ ax_cv_prog_date_gnu=no
+ if date --version 2>/dev/null | head -1 | grep -q GNU
+ then
+ ax_cv_prog_date_gnu=yes
+ fi
+ ])
+ AC_CACHE_CHECK([for BSD date], [ax_cv_prog_date_bsd], [
+ ax_cv_prog_date_bsd=no
+ if date -v 1d > /dev/null 2>&1
+ then
+ ax_cv_prog_date_bsd=yes
+ fi
+ ])
+ AC_CACHE_CHECK([for date type], [ax_cv_prog_date_type], [
+ ax_cv_prog_date_type=unknown
+ if test "x${ax_cv_prog_date_gnu}" = "xyes"
+ then
+ ax_cv_prog_date_type=gnu
+ elif test "x${ax_cv_prog_date_bsd}" = "xyes"
+ then
+ ax_cv_prog_date_type=bsd
+ fi
+ ])
+ AS_VAR_IF([ax_cv_prog_date_gnu], [yes], [
+ AC_CACHE_CHECK([whether GNU date supports --date], [ax_cv_prog_date_gnu_date], [
+ ax_cv_prog_date_gnu_date=no
+ if date --date=@1512031231 > /dev/null 2>&1
+ then
+ ax_cv_prog_date_gnu_date=yes
+ fi
+ ])
+ AC_CACHE_CHECK([whether GNU date supports --utc], [ax_cv_prog_date_gnu_utc], [
+ ax_cv_prog_date_gnu_utc=no
+ if date --utc > /dev/null 2>&1
+ then
+ ax_cv_prog_date_gnu_utc=yes
+ fi
+ ])
+ ])
+ AS_VAR_IF([ax_cv_prog_date_bsd], [yes], [
+ AC_CACHE_CHECK([whether BSD date supports -r], [ax_cv_prog_date_bsd_date], [
+ ax_cv_prog_date_bsd_date=no
+ if date -r 1512031231 > /dev/null 2>&1
+ then
+ ax_cv_prog_date_bsd_date=yes
+ fi
+ ])
+ ])
+ AS_VAR_IF([ax_cv_prog_date_bsd], [yes], [
+ AC_CACHE_CHECK([whether BSD date supports -v], [ax_cv_prog_date_bsd_adjust], [
+ ax_cv_prog_date_bsd_adjust=no
+ if date -v 1d > /dev/null 2>&1
+ then
+ ax_cv_prog_date_bsd_adjust=yes
+ fi
+ ])
+ ])
+])dnl AX_PROG_DATE
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Aug 14, 12:03 PM (16 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2207555
Default Alt Text
(25 KB)
Attached To
Mode
rF Fence Agents
Attached
Detach File
Event Timeline
Log In to Comment