summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebian/rules1
-rw-r--r--debian/soledad-common.install1
-rwxr-xr-xscripts/packaging/replace-version-file.py19
3 files changed, 21 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
index ee6e33e2..99d21fe1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,7 @@ NAME=soledad-server
override_dh_prep:
(cd ./docs/man; for src in *.rst; do tgt=$$(basename $${src} .rst); rst2man $${src} $${tgt}; done)
+ PYTHONPATH=./ ./scripts/packaging/replace-version-file.py
dh_prep
override_dh_installinit:
diff --git a/debian/soledad-common.install b/debian/soledad-common.install
index 05b9f308..701b2164 100644
--- a/debian/soledad-common.install
+++ b/debian/soledad-common.install
@@ -1,3 +1,4 @@
src/leap/soledad/__init__.py /usr/lib/python2.7/dist-packages/leap/soledad/
src/leap/soledad/_version.py /usr/lib/python2.7/dist-packages/leap/soledad/
src/leap/soledad/common /usr/lib/python2.7/dist-packages/leap/soledad/
+debian/python-leap.soledad/usr/lib/python2.7/dist-packages/leap.soledad-*.egg-info /usr/lib/python2.7/dist-packages/
diff --git a/scripts/packaging/replace-version-file.py b/scripts/packaging/replace-version-file.py
new file mode 100755
index 00000000..8c9e046c
--- /dev/null
+++ b/scripts/packaging/replace-version-file.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+# This script will replace the versioneer source version file configured in
+# `setup.cfg` with a file containing the hardcoded version generated by
+# versioneer. It is meant to be used before building the debian package, so the
+# generated package reports the correct version, as would be generated by
+# versioneer if this was a python package.
+
+import ConfigParser
+import versioneer
+
+# get the path to the version file
+config = ConfigParser.RawConfigParser()
+config.read('setup.cfg')
+source_file = config.get('versioneer', 'versionfile_source')
+
+# replace version file in source tree
+versions = versioneer.get_versions()
+versioneer.write_to_version_file(source_file, versions)