aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJames Westby <james.westby@canonical.com>2010-09-24 16:37:48 -0400
committerJames Westby <james.westby@canonical.com>2010-09-24 16:37:48 -0400
commitc4f045c85e4eb724ed5e297693f2c9319c9c95e2 (patch)
tree7e2b8f7e5c1f72d0fc2646d05a0b451ae07b68da /setup.py
parent4d5b1211a33f581f46f3098cf317780ea4a26f1d (diff)
Package the hardware pack tools.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..faff3e7
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,24 @@
+from distutils.core import setup
+import os
+import subprocess
+
+
+def get_version():
+ proc = subprocess.Popen(
+ ["dpkg-parsechangelog"],
+ cwd=os.path.abspath(os.path.dirname(__file__)),
+ stdout=subprocess.PIPE)
+ output, _ = proc.communicate()
+ version = None
+ for line in output.split("\n"):
+ if line.startswith("Version: "):
+ version = line.split(" ", 1)[1].strip()
+ assert version is not None, (
+ "Couldn't determine version number from debian changelog")
+
+
+setup(
+ name="hwpack",
+ version=get_version(),
+ packages=["hwpack"],
+ )