Description: use debian/changelog as source for version instead of git
 Also force the name of the root project to avoid it to be copied from the directory name
Author: Vincent Danjean <Vincent.Danjean@ens-lyon.org>
Forwarded: not-needed
Last-Updated: 2016-07-05
--- a/build.gradle
+++ b/build.gradle
@@ -48,9 +48,18 @@
     targetCompatibility = '17'
 }
 
+def getDebianVersion() {
+    def dpkgStdOut = new ByteArrayOutputStream()
+    exec {
+        commandLine "dpkg-parsechangelog", "-S", "Version"
+        standardOutput = dpkgStdOut
+    }
+    return dpkgStdOut.toString().trim().replaceFirst(/([+]dfsg[.0-9]*)?-[^-]+$/, "")
+}
+
 final isRelease = Boolean.getBoolean("release")
-final gitVersion = gitVersion().replaceAll(".dirty", "")
-version = isRelease ? gitVersion : gitVersion + "-SNAPSHOT"
+final debianVersion = getDebianVersion()
+version = debianVersion
 
 logger.info("build for version:" + version)
 group = 'com.github.samtools'
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1 @@
+rootName=htsjdk
