10 LOCALEDIR
= $(PREFIX
)/share
/locale
12 # Get the version and configuration of the python interpreter.
13 PYTHON_VERSION
= $(shell python
-c
"import platform; print '.'.join(platform.python_version_tuple()[:2])")
14 ifeq "$(PYTHON_VERSION)" ""
15 $(error Could not determine the version of the python interpreter.
)
17 PYTHON_DIR
= $(LIBDIR
)/python
$(PYTHON_VERSION
)/site-packages
/ddns
19 VERSION_FILE
= ddns
/__version__.py
24 # A list of all files that need translation
25 TRANSLATION_FILES
= $(wildcard ddns
/*.py
) ddns.py
27 POT_FILE
= po
/$(PACKAGE_NAME
).pot
28 PO_FILES
= $(wildcard po
/*.po
)
29 MO_FILES
= $(patsubst %.po
,%.mo
,$(PO_FILES
))
31 ################################################################################
33 all: $(POT_FILE
) $(MO_FILES
)
36 $(VERSION_FILE
): Makefile
37 echo
"# this file is autogenerated by the build system" > $(VERSION_FILE
)
38 echo
"CLIENT_VERSION = \"$(PACKAGE_VERSION)\"" >> $(VERSION_FILE
)
40 install: $(VERSION_FILE
) $(MO_FILES
)
41 # Install the main command.
42 -mkdir
-pv
$(DESTDIR
)$(BINDIR
)
43 install -v
-m
755 ddns.py
$(DESTDIR
)$(BINDIR
)/ddns
45 # Install python module.
46 -mkdir
-pv
$(DESTDIR
)$(PYTHON_DIR
)
47 install -v
-m
644 ddns
/*.py
$(DESTDIR
)$(PYTHON_DIR
)
49 # Install the example configuration file.
50 -mkdir
-pv
$(DESTDIR
)$(SYSCONFDIR
)
51 install -v
-m
640 ddns.conf
$(DESTDIR
)$(SYSCONFDIR
)/ddns.conf
53 # Install translation files.
54 -mkdir
-pv
$(DESTDIR
)$(LOCALEDIR
)
55 for file in
$(MO_FILES
); do \
57 mkdir
-pv
$(DESTDIR
)$(LOCALEDIR
)/$${lang}/LC_MESSAGES
; \
58 install -v
-m
644 $${file} \
59 $(DESTDIR
)$(LOCALEDIR
)/$${lang}/LC_MESSAGES
/$(PACKAGE_NAME
).mo
; \
62 # Cleanup temporary files.
68 $(POT_FILE
): $(TRANSLATION_FILES
) Makefile
69 xgettext
--language python
-d
$(PACKAGE_NAME
) -k_
-kN_ \
70 -o
$@
--add-comments
--from-code
=UTF-8
$^
72 # Compile gettext dictionaries from translation files.
73 %.mo
: %.po
$(POT_FILE
)