packaging: Create include/version.h to define CTDB_VERSION_STRING
authorAmitay Isaacs <amitay@gmail.com>
Tue, 30 Oct 2012 00:47:24 +0000 (11:47 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 30 Oct 2012 00:55:59 +0000 (11:55 +1100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
packaging/mkversion.sh

index 7d12f680e25713864594d4ad9e67bf34d399bb31..18b432a30a195d6ea05cadc473df17dcbe5257a8 100755 (executable)
 # Common code to generate CTDB version string
 #
 
+OUTPUT=$1
+
+if [ -z "$OUTPUT" ]; then
+    OUTPUT="include/version.h"
+fi
+
 # We use tags and determine the version, as follows:
 # ctdb-0.9.1  (First release of 0.9).
 # ctdb-0.9.23 (23rd minor release of the 112 version)
@@ -47,4 +53,12 @@ case "$TAG" in
        echo Invalid tag "$TAG" >&2
        ;;
 esac
+
+cat > "$OUTPUT" <<EOF
+/* This file is auto-genrated by packaging/mkversion.sh */
+
+#define CTDB_VERSION_STRING "$VERSION"
+
+EOF
+
 echo $VERSION