From 5d987ab524963bb3993757ea5b31544b0d06eb0b Mon Sep 17 00:00:00 2001
From: Kipp Cannon <kipp.cannon@ligo.org>
Date: Thu, 27 Sep 2018 19:31:49 +0900
Subject: [PATCH] update ax_python_glue.m4 macro package

---
 gstlal-burst/gnuscripts/ax_python_glue.m4     | 22 +++++++++++++------
 .../gnuscripts/ax_python_glue.m4              | 22 +++++++++++++------
 gstlal-inspiral/gnuscripts/ax_python_glue.m4  | 22 +++++++++++++------
 gstlal-ugly/gnuscripts/ax_python_glue.m4      | 22 +++++++++++++------
 gstlal/gnuscripts/ax_python_glue.m4           | 22 +++++++++++++------
 5 files changed, 75 insertions(+), 35 deletions(-)

diff --git a/gstlal-burst/gnuscripts/ax_python_glue.m4 b/gstlal-burst/gnuscripts/ax_python_glue.m4
index 1ac53bcc28..b15aa2194a 100644
--- a/gstlal-burst/gnuscripts/ax_python_glue.m4
+++ b/gstlal-burst/gnuscripts/ax_python_glue.m4
@@ -6,12 +6,20 @@ AC_DEFUN([AX_PYTHON_GLUE],[
 	AX_PYTHON_MODULE([glue])
 	if test "x$HAVE_PYMOD_GLUE" == "xyes" ; then
 		AC_MSG_CHECKING(glue version)
-		GLUE_VERSION=`$PYTHON -c "from glue import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('glue-release-', '').split('-')[[:2]])"`
-		if test "x${GLUE_VERSION}" == "x0.0" ; then
-			GLUE_VERSION=
-			AC_MSG_RESULT([unknown])
-		else
-			AC_MSG_RESULT($GLUE_VERSION)
-		fi
+		GLUE_VERSION=`$PYTHON -c "from glue import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($GLUE_VERSION)
+	fi
+])
+
+AC_DEFUN([AX_PYTHON_LIGO_SEGMENTS],[
+	if test -z $PYTHON ; then
+		PYTHON="python"
+	fi
+	PYTHON_NAME=`basename $PYTHON`
+	AX_PYTHON_MODULE([ligo.segments])
+	if test "x$HAVE_PYMOD_LIGO_SEGMENTS" == "xyes" ; then
+		AC_MSG_CHECKING(ligo.segments version)
+		LIGO_SEGMENTS_VERSION=`$PYTHON -c "from ligo.segments import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($LIGO_SEGMENTS_VERSION)
 	fi
 ])
diff --git a/gstlal-calibration/gnuscripts/ax_python_glue.m4 b/gstlal-calibration/gnuscripts/ax_python_glue.m4
index 1ac53bcc28..b15aa2194a 100644
--- a/gstlal-calibration/gnuscripts/ax_python_glue.m4
+++ b/gstlal-calibration/gnuscripts/ax_python_glue.m4
@@ -6,12 +6,20 @@ AC_DEFUN([AX_PYTHON_GLUE],[
 	AX_PYTHON_MODULE([glue])
 	if test "x$HAVE_PYMOD_GLUE" == "xyes" ; then
 		AC_MSG_CHECKING(glue version)
-		GLUE_VERSION=`$PYTHON -c "from glue import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('glue-release-', '').split('-')[[:2]])"`
-		if test "x${GLUE_VERSION}" == "x0.0" ; then
-			GLUE_VERSION=
-			AC_MSG_RESULT([unknown])
-		else
-			AC_MSG_RESULT($GLUE_VERSION)
-		fi
+		GLUE_VERSION=`$PYTHON -c "from glue import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($GLUE_VERSION)
+	fi
+])
+
+AC_DEFUN([AX_PYTHON_LIGO_SEGMENTS],[
+	if test -z $PYTHON ; then
+		PYTHON="python"
+	fi
+	PYTHON_NAME=`basename $PYTHON`
+	AX_PYTHON_MODULE([ligo.segments])
+	if test "x$HAVE_PYMOD_LIGO_SEGMENTS" == "xyes" ; then
+		AC_MSG_CHECKING(ligo.segments version)
+		LIGO_SEGMENTS_VERSION=`$PYTHON -c "from ligo.segments import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($LIGO_SEGMENTS_VERSION)
 	fi
 ])
diff --git a/gstlal-inspiral/gnuscripts/ax_python_glue.m4 b/gstlal-inspiral/gnuscripts/ax_python_glue.m4
index 1ac53bcc28..b15aa2194a 100644
--- a/gstlal-inspiral/gnuscripts/ax_python_glue.m4
+++ b/gstlal-inspiral/gnuscripts/ax_python_glue.m4
@@ -6,12 +6,20 @@ AC_DEFUN([AX_PYTHON_GLUE],[
 	AX_PYTHON_MODULE([glue])
 	if test "x$HAVE_PYMOD_GLUE" == "xyes" ; then
 		AC_MSG_CHECKING(glue version)
-		GLUE_VERSION=`$PYTHON -c "from glue import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('glue-release-', '').split('-')[[:2]])"`
-		if test "x${GLUE_VERSION}" == "x0.0" ; then
-			GLUE_VERSION=
-			AC_MSG_RESULT([unknown])
-		else
-			AC_MSG_RESULT($GLUE_VERSION)
-		fi
+		GLUE_VERSION=`$PYTHON -c "from glue import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($GLUE_VERSION)
+	fi
+])
+
+AC_DEFUN([AX_PYTHON_LIGO_SEGMENTS],[
+	if test -z $PYTHON ; then
+		PYTHON="python"
+	fi
+	PYTHON_NAME=`basename $PYTHON`
+	AX_PYTHON_MODULE([ligo.segments])
+	if test "x$HAVE_PYMOD_LIGO_SEGMENTS" == "xyes" ; then
+		AC_MSG_CHECKING(ligo.segments version)
+		LIGO_SEGMENTS_VERSION=`$PYTHON -c "from ligo.segments import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($LIGO_SEGMENTS_VERSION)
 	fi
 ])
diff --git a/gstlal-ugly/gnuscripts/ax_python_glue.m4 b/gstlal-ugly/gnuscripts/ax_python_glue.m4
index 1ac53bcc28..b15aa2194a 100644
--- a/gstlal-ugly/gnuscripts/ax_python_glue.m4
+++ b/gstlal-ugly/gnuscripts/ax_python_glue.m4
@@ -6,12 +6,20 @@ AC_DEFUN([AX_PYTHON_GLUE],[
 	AX_PYTHON_MODULE([glue])
 	if test "x$HAVE_PYMOD_GLUE" == "xyes" ; then
 		AC_MSG_CHECKING(glue version)
-		GLUE_VERSION=`$PYTHON -c "from glue import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('glue-release-', '').split('-')[[:2]])"`
-		if test "x${GLUE_VERSION}" == "x0.0" ; then
-			GLUE_VERSION=
-			AC_MSG_RESULT([unknown])
-		else
-			AC_MSG_RESULT($GLUE_VERSION)
-		fi
+		GLUE_VERSION=`$PYTHON -c "from glue import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($GLUE_VERSION)
+	fi
+])
+
+AC_DEFUN([AX_PYTHON_LIGO_SEGMENTS],[
+	if test -z $PYTHON ; then
+		PYTHON="python"
+	fi
+	PYTHON_NAME=`basename $PYTHON`
+	AX_PYTHON_MODULE([ligo.segments])
+	if test "x$HAVE_PYMOD_LIGO_SEGMENTS" == "xyes" ; then
+		AC_MSG_CHECKING(ligo.segments version)
+		LIGO_SEGMENTS_VERSION=`$PYTHON -c "from ligo.segments import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($LIGO_SEGMENTS_VERSION)
 	fi
 ])
diff --git a/gstlal/gnuscripts/ax_python_glue.m4 b/gstlal/gnuscripts/ax_python_glue.m4
index 1ac53bcc28..b15aa2194a 100644
--- a/gstlal/gnuscripts/ax_python_glue.m4
+++ b/gstlal/gnuscripts/ax_python_glue.m4
@@ -6,12 +6,20 @@ AC_DEFUN([AX_PYTHON_GLUE],[
 	AX_PYTHON_MODULE([glue])
 	if test "x$HAVE_PYMOD_GLUE" == "xyes" ; then
 		AC_MSG_CHECKING(glue version)
-		GLUE_VERSION=`$PYTHON -c "from glue import git_version ; print '%s.%s' % tuple((git_version.tag or '0-0').replace('glue-release-', '').split('-')[[:2]])"`
-		if test "x${GLUE_VERSION}" == "x0.0" ; then
-			GLUE_VERSION=
-			AC_MSG_RESULT([unknown])
-		else
-			AC_MSG_RESULT($GLUE_VERSION)
-		fi
+		GLUE_VERSION=`$PYTHON -c "from glue import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($GLUE_VERSION)
+	fi
+])
+
+AC_DEFUN([AX_PYTHON_LIGO_SEGMENTS],[
+	if test -z $PYTHON ; then
+		PYTHON="python"
+	fi
+	PYTHON_NAME=`basename $PYTHON`
+	AX_PYTHON_MODULE([ligo.segments])
+	if test "x$HAVE_PYMOD_LIGO_SEGMENTS" == "xyes" ; then
+		AC_MSG_CHECKING(ligo.segments version)
+		LIGO_SEGMENTS_VERSION=`$PYTHON -c "from ligo.segments import __version__ ; print '.'.join(__version__.strip().split('.'))"`
+		AC_MSG_RESULT($LIGO_SEGMENTS_VERSION)
 	fi
 ])
-- 
GitLab