2 # Makefile for the PO files (translation) catalog
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
19 MSGMERGE
= msgmerge
-v
20 XGETTEXT
= xgettext
--default-domain
=$(NLSPACKAGE
) \
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
; \
37 mv
-f
$(NLSPACKAGE
).po
$(POTFILE
); \
40 update-po
: Makefile
$(POTFILE
) refresh-po
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" ; \
49 echo
"$(MSGMERGE) of $$lang failed" ; \
55 @
rm -fv
*mo
*~ .depend
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
; \
67 .PHONY
: missing depend