[project @ 2004-09-19 09:41:29 by panne]
authorpanne <unknown>
Sun, 19 Sep 2004 09:41:29 +0000 (09:41 +0000)
committerpanne <unknown>
Sun, 19 Sep 2004 09:41:29 +0000 (09:41 +0000)
Use version info from configure.ac

ghc/VERSION [deleted file]
ghc/VERSION.in [new file with mode: 0644]
ghc/configure.ac
ghc/docs/users_guide/ug-book.xml.in [moved from ghc/docs/users_guide/ug-book.xml with 87% similarity]
ghc/ghc.spec.in
ghc/mk/version.mk

diff --git a/ghc/VERSION b/ghc/VERSION
deleted file mode 100644 (file)
index 9dfd07b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-The Glasgow Haskell Compiler, version 6.3
diff --git a/ghc/VERSION.in b/ghc/VERSION.in
new file mode 100644 (file)
index 0000000..3abedb6
--- /dev/null
@@ -0,0 +1 @@
+The @PACKAGE_NAME@, version @PACKAGE_VERSION@
index 040041d..ea1353e 100644 (file)
@@ -2,10 +2,17 @@
 AC_INIT([Glasgow Haskell Compiler], [6.3], [glasgow-haskell-bugs@haskell.org], [ghc])
 AC_CONFIG_SRCDIR([ghc.spec.in])
 
-# Compute the version number and the release, they are needed by the .spec file.
-AC_SUBST([version], [[`sed 's/.* version \([0-9][0-9.]*\).*/\1/' VERSION`]])
+# Calculate project version as an integer, using 2 digits for minor version
+case $PACKAGE_VERSION in
+  *.?)  ProjectVersionInt=`echo "$PACKAGE_VERSION" | sed 's,^\(.*\)\.\(.\)$,\10\2,'` ;;
+  *.??) ProjectVersionInt=`echo "$PACKAGE_VERSION" | sed 's,^\(.*\)\.\(..\)$,\1\2,'` ;;
+  *) AC_MSG_ERROR([bad package version $PACKAGE_VERSION]) ;;
+esac
+AC_SUBST([ProjectVersionInt])
+
+# Hmmm, we fix the RPM release number to 1 here... Is this convenient?
 AC_SUBST([release], [1])
 
 # Write the results...
-AC_CONFIG_FILES([ghc.spec])
+AC_CONFIG_FILES([ghc.spec VERSION docs/users_guide/ug-book.xml])
 AC_OUTPUT
similarity index 87%
rename from ghc/docs/users_guide/ug-book.xml
rename to ghc/docs/users_guide/ug-book.xml.in
index fc736ca..01b8bf4 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 <bookinfo>
-<title>The Glasgow Haskell Compiler User's Guide, Version 6.3</title>
+<title>The @PACKAGE_NAME@ User's Guide, Version @PACKAGE_VERSION@</title>
 <author><othername>The GHC Team</othername></author>
 <address>
 <email>glasgow-haskell-&lcub;bugs,users&rcub;-request@haskell.org</email>
index 61cb9ca..ac2968d 100644 (file)
@@ -8,7 +8,7 @@
 # This file is subject to the same free software license as GHC.
 
 %define name    ghc
-%define version @version@
+%define version @PACKAGE_VERSION@
 %define release @release@
 
 Name:           %{name}
index b3b12a5..ec5ef86 100644 (file)
@@ -36,8 +36,8 @@
 
 ProjectName       = The Glorious Glasgow Haskell Compilation System
 ProjectNameShort  = ghc
-ProjectVersion    = 6.3
-ProjectVersionInt = 603
+ProjectVersion    = @PACKAGE_VERSION@
+ProjectVersionInt = @ProjectVersionInt@
 ProjectPatchLevel = 0
 
 # Interface file version (hi-boot files only)