Add new RHEL7 logvol objects to master
[pykickstart.git] / po / Makefile
blob2c7b93dcc1a834ff79782442981f4efa773c28e7
2 # Makefile for the PO files (translation) catalog
4 # $Id$
6 TOP = ../..
8 # What is this package?
9 NLSPACKAGE = pykickstart
10 POTFILE = $(NLSPACKAGE).pot
11 INSTALL = /usr/bin/install -c
12 INSTALL_DATA = $(INSTALL) -m 644
13 INSTALL_DIR = /usr/bin/install -d
15 # destination directory
16 INSTALL_NLS_DIR = $(RPM_BUILD_ROOT)/usr/share/locale
18 # PO catalog handling
19 MSGMERGE = msgmerge -v
20 XGETTEXT = xgettext --default-domain=$(NLSPACKAGE) \
21 --add-comments
22 MSGFMT = msgfmt --statistics --verbose
24 # What do we need to do
25 POFILES = $(wildcard *.po)
26 MOFILES = $(patsubst %.po,%.mo,$(POFILES))
27 PYSRC = $(wildcard ../pykickstart/*.py)
28 SRCFILES = $(PYSRC) $(wildcard ../tools/ks*)
30 all:: update-po $(MOFILES)
32 $(POTFILE): $(SRCFILES)
33 $(XGETTEXT) -L Python --keyword=_ --keyword=N_ $(SRCFILES)
34 @if cmp -s $(NLSPACKAGE).po $(POTFILE); then \
35 rm -f $(NLSPACKAGE).po; \
36 else \
37 mv -f $(NLSPACKAGE).po $(POTFILE); \
38 fi; \
40 update-po: Makefile $(POTFILE) refresh-po
42 refresh-po: Makefile
43 for cat in $(POFILES); do \
44 lang=`basename $$cat .po`; \
45 if $(MSGMERGE) $$lang.po $(POTFILE) > $$lang.pot ; then \
46 mv -f $$lang.pot $$lang.po ; \
47 echo "$(MSGMERGE) of $$lang succeeded" ; \
48 else \
49 echo "$(MSGMERGE) of $$lang failed" ; \
50 rm -f $$lang.pot ; \
51 fi \
52 done
54 clean:
55 @rm -fv *mo *~ .depend
57 install: $(MOFILES)
58 @for n in $(MOFILES); do \
59 l=`basename $$n .mo`; \
60 $(INSTALL_DIR) $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \
61 $(INSTALL_DATA) --verbose $$n $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \
62 done
64 %.mo: %.po
65 $(MSGFMT) -o $@ $<
67 .PHONY: missing depend