* Makefile : Installation des fichiers de langue

Compilation et Installation des fichiers de traductions pour
Tiramisu
This commit is contained in:
Philippe Caseiro 2013-04-23 16:20:02 +02:00
parent e8bc84ab33
commit a57e89c82d
2 changed files with 32 additions and 1 deletions

View File

@ -7,6 +7,9 @@ INSTALL_DATA := install -m 644
INSTALL_PROGRAM := install -m 755 INSTALL_PROGRAM := install -m 755
INSTALL_DIR := install -m 755 -d INSTALL_DIR := install -m 755 -d
TRADUC_DIR = translations
TRADUC_DEST = $(DESTDIR)/usr/share/locale
PYTHON_OPTS = PYTHON_OPTS =
ifneq ($(DESTDIR),) ifneq ($(DESTDIR),)
PYTHON_OPTS += --root $(DESTDIR) PYTHON_OPTS += --root $(DESTDIR)
@ -16,16 +19,44 @@ LAST_TAG := $(shell git describe --tags --abbrev=0)
VERSION := $(shell echo $(LAST_TAG) | awk -F'/' '{print $$2}' || true) VERSION := $(shell echo $(LAST_TAG) | awk -F'/' '{print $$2}' || true)
VERSION_FILE := version.in VERSION_FILE := version.in
# Build translation files
define build_translation
if [ -d ${1} ]; then \
for f in `find ${1} -name "*.po"`; do \
msgfmt -o `dirname $$f`/`basename -s ".po" $$f`.mo $$f || true; \
done; \
fi
endef
# Install Traduction
define install_translation
if [ -d ${1} ]; then \
for file in `find ${1} -name "*.mo"`; do \
$(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2` || true; \
$(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \
$(INSTALL_DATA) $$file $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \
done; \
fi
endef
all: all:
clean: clean:
$(RM) -r build $(RM) -r build
$(RM) -r tiramisu.egg-info/ $(RM) -r tiramisu.egg-info/
$(RM) -r $(TRADUC_DIR)/*/*.mo
test: clean test: clean
py.test py.test
install: build-lang:
$(call build_translation, $(TRADUC_DIR))
install-lang: build-lang
$(INSTALL_DIR) $(TRADUC_DEST)
$(call install_translation, $(TRADUC_DIR))
install: install-lang
python setup.py install --no-compile $(PYTHON_OPTS) python setup.py install --no-compile $(PYTHON_OPTS)
# List in .PHONY to force generation at each call # List in .PHONY to force generation at each call

Binary file not shown.