From 2fde02e5024b1ed88fbe3576d8f5bf5ca1d1dad4 Mon Sep 17 00:00:00 2001
From: jce <jce@unknown>
Date: Sun, 26 Jan 2003 11:12:29 +0000
Subject: [PATCH] Modified configure.ac to use the META file for
 version/revision number and added definition of PROJECT... These are steps to
 get make rpm to work.

---
 META         | 11 +++++++++++
 configure.ac | 36 ++++++++++++++++++++++++++----------
 2 files changed, 37 insertions(+), 10 deletions(-)
 create mode 100644 META

diff --git a/META b/META
new file mode 100644
index 00000000000..fcf7f4dd9a5
--- /dev/null
+++ b/META
@@ -0,0 +1,11 @@
+##
+# $Id$
+##
+# Metadata for RPM/TAR makefile targets
+##
+  Meta:		1
+  Name:		slurm
+  Major:		0
+  Minor:		1
+  Version:	0.1
+  Release:	1
diff --git a/configure.ac b/configure.ac
index 2d10d9f9184..61446a18f41 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,23 +8,39 @@ AC_CONFIG_SRCDIR([configure.ac])
 AC_CONFIG_AUX_DIR(auxdir)
 AC_CANONICAL_TARGET([])
 
-# determine project/version 
-# XXX generate VERSION information automatically at some point
-SLURM_MAJOR=0
-SLURM_MINOR=1
-SLURM_VERSION="$SLURM_MAJOR.$SLURM_MINOR"
+#
+# Determine project/version from META file.
+# These are substituted into the Makefile and config.h.
+#
+PROJECT="`perl -ne 'print,exit if s/^\s*NAME:\s*(\S*).*/\1/i' $srcdir/META`"
+AC_DEFINE_UNQUOTED(PROJECT, "$PROJECT", [Define the project's name.])
+AC_SUBST(PROJECT)
+
+# Automake desires "PACKAGE" variable instead of PROJECT
+PACKAGE=$PROJECT
 
-VERSION=$SLURM_VERSION
+# rpm make target needs Version in META, not major and minor version nubmers
+VERSION="`perl -ne 'print,exit if s/^\s*VERSION:\s*(\S*).*/\1/i' $srcdir/META`"
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the project's version.])
 AC_SUBST(VERSION)
 
-AC_DEFINE_UNQUOTED(SLURM_VERSION, "$SLURM_VERSION", [slurm version number])
-AC_SUBST(SLURM_VERSION)
-AC_DEFINE_UNQUOTED(SLURM_MAJOR, "$SLURM_MAJOR", [slurm major version number])
+SLURM_MAJOR="`perl -ne 'print,exit if s/^\s*MAJOR:\s*(\S*).*/\1/i' $srcdir/META`"
+AC_DEFINE_UNQUOTED(SLURM_MAJOR, "$SLURM_MAJOR", [Define the project's major version.])
 AC_SUBST(SLURM_MAJOR)
-AC_DEFINE_UNQUOTED(SLURM_MINOR, "$SLURM_MINOR", [slurm minor version number])
+
+SLURM_MINOR="`perl -ne 'print,exit if s/^\s*MINOR:\s*(\S*).*/\1/i' $srcdir/META`"
+AC_DEFINE_UNQUOTED(SLURM_MINOR, "$SLURM_MINOR", [Define the project's minor version.])
 AC_SUBST(SLURM_MINOR)
 
+#SLURM_VERSION="$SLURM_MAJOR.$SLURM_MINOR"
+
+#VERSION=$SLURM_VERSION
+#AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the project's version.])
+#AC_SUBST(VERSION)
+
+RELEASE="`perl -ne 'print,exit if s/^\s*RELEASE:\s*(\S*).*/\1/i' $srcdir/META`"
+AC_DEFINE_UNQUOTED(RELEASE, "$RELEASE", [Define the project's release.])
+AC_SUBST(RELEASE)
 
 dnl Initialize Automake
 dnl
-- 
GitLab