1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Index: cwiid/python/setup.py
===================================================================
--- cwiid.orig/python/setup.py
+++ cwiid/python/setup.py
@@ -1,6 +1,16 @@
from distutils.core import setup, Extension
+from subprocess import PIPE, Popen
+import os, re
+
+changelogFile = os.path.join(os.path.dirname(__file__), "..", "debian", "changelog")
+p=Popen(f"dpkg-parsechangelog -l {changelogFile} | grep Version",
+ shell=True, stdout=PIPE)
+out, err = p.communicate()
+version = out.decode("utf-8").strip()
+m = re.match(r"^[^0-9]*([.0-9]*).*$",version, re.M)
+version = m.group(1)
setup(name='cwiid',
- version='0.6.00',
+ version=version,
ext_modules=[Extension('cwiid', ['cwiidmodule.c', 'Wiimote.c'])]
)
|