Automatically set the version in setup.py from the changelog.
authorCameron Dale <camrdale@gmail.com>
Thu, 21 Feb 2008 19:10:38 +0000 (11:10 -0800)
committerCameron Dale <camrdale@gmail.com>
Thu, 21 Feb 2008 19:10:38 +0000 (11:10 -0800)
debian/control
setup.py

index 8f97946..b10043f 100644 (file)
@@ -5,7 +5,7 @@ Maintainer: Cameron Dale <camrdale@gmail.com>
 Homepage: http://www.camrdale.org/apt-dht.html
 Standards-Version: 3.7.3
 Build-Depends: debhelper (>= 5.0.37.2)
-Build-Depends-Indep: python-dev, python-support (>= 0.5.4), docbook-to-man
+Build-Depends-Indep: python-dev, python-support (>= 0.5.4), docbook-to-man, python-debian (>= 0.1.4)
 Vcs-Git: git://git.camrdale.org/git/apt-dht.git
 Vcs-Browser: http://git.camrdale.org/?p=apt-dht.git;a=summary
 XS-Dm-Upload-Allowed: yes
index 362d38e..664f390 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -3,9 +3,17 @@
 import sys
 from distutils.core import setup
 
+from debian_bundle import changelog
+
+f = open('debian/changelog')
+data = f.read()
+f.close()
+c = changelog.Changelog(file=data, max_blocks=1)
+del data
+
 setup(
     name = "apt-dht",
-    version = "0.0.0",
+    version = c.full_version,
     author = "Cameron Dale",
     author_email = "<camrdale@gmail.com>",
     url = "http://www.camrdale.org/apt-dht.html",