Fix installation for non EOLE developpers

The version is extracted from “relase/” tags and they exists only on EOLE
git repository.

* Makefile (install): Depends on version file.
  (version.in): Fake dev version for developpers without devel release
  tags

* setup.py: Add missing subprocess import.
  (fetch_version): Use same fallback version as Makefile.
This commit is contained in:
Daniel Dehennin 2013-07-18 12:23:50 +02:00
parent e6c3104681
commit 28d053430b
2 changed files with 7 additions and 3 deletions

View File

@ -56,13 +56,16 @@ install-lang: build-lang
$(INSTALL_DIR) $(TRADUC_DEST)
$(call install_translation, $(TRADUC_DIR))
install: install-lang
install: version.in install-lang
python setup.py install --no-compile $(PYTHON_OPTS)
# List in .PHONY to force generation at each call
version.in:
@if test -n $(VERSION) ; then \
echo $(VERSION) > $(VERSION_FILE) ; \
echo -n $(VERSION) > $(VERSION_FILE) ; \
fi
@if test ! -s $(VERSION_FILE); then \
echo -n '0.0-dev' > $(VERSION_FILE); \
fi
dist: version.in

View File

@ -3,11 +3,12 @@
from distutils.core import setup
import os
import subprocess
def fetch_version():
"""Get version from version.in or latest git tag"""
version_file='version.in'
version = "0.0"
version = "0.0-dev"
git_last_tag_cmd = ['git', 'describe', '--tags', '--abbrev=0']
try: