6 INSTALL_DATA := install -m 644
7 INSTALL_PROGRAM := install -m 755
8 INSTALL_DIR := install -m 755 -d
10 TRADUC_DIR = translations
11 TRADUC_DEST = $(DESTDIR)/usr/share/locale
15 PYTHON_OPTS += --root $(DESTDIR)
18 VERSION := `cat VERSION`
21 if command -v pygettext >/dev/null 2>&1 ; then \
26 $$P -p translations/ -o $(PACKAGE).pot `find $(PACKAGE)/ -name "*.py"`
29 # Build translation files
30 define build_translation
31 if [ -d ${1} ]; then \
32 for f in `find ${1} -name "*.po"`; do \
33 msgfmt -o `dirname $$f`/`basename -s ".po" $$f`.mo $$f || true; \
41 define install_translation
42 if [ -d ${1} ]; then \
43 for file in `find ${1} -name "*.mo"`; do \
44 $(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2` || true; \
45 $(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \
46 $(INSTALL_DATA) $$file $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \
55 $(RM) -r $(PACKAGE).egg-info/
56 $(RM) -r $(TRADUC_DIR)/*/*.mo
61 # Build or update Portable Object Base Translation for gettext
67 $(call build_translation, $(TRADUC_DIR))
70 $(INSTALL_DIR) $(TRADUC_DEST)
71 $(call install_translation, $(TRADUC_DIR))
74 python setup.py install --no-compile $(PYTHON_OPTS)
77 git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ HEAD | gzip -9 > $(PACKAGE)-$(VERSION).tar.gz
79 # List in .PHONY to force generation at each call
80 .PHONY: all clean build-pot build-lang install-lang install dist