1 |
# Installation directories |
2 |
top_srcdir=.. |
3 |
localedir = $(DESTDIR)/usr/share/locale |
4 |
|
5 |
PGOAL = drakconf |
6 |
|
7 |
# perl files to search translatable strings in |
8 |
PL_FILES = ../contributors.pl ../control-center ../drakconsole ../drakxconf \ |
9 |
../menus_launcher.pl ../print_launcher.pl ../lib/MDV/Control_Center.pm |
10 |
# C-like files to search translatable strings in |
11 |
#CFILES = |
12 |
|
13 |
POFILES = $(shell ls *.po) |
14 |
MOFILES = $(POFILES:%.po=%.mo) |
15 |
LANGS = $(POFILES:%.po=%) |
16 |
|
17 |
PREFIX = $(RPM_BUILD_ROOT)/usr |
18 |
DATADIR = $(PREFIX)/share |
19 |
LOCALEDIR=$(DATADIR)/locale |
20 |
|
21 |
GOALS = $(PGOAL).pot $(MOFILES) |
22 |
|
23 |
all: $(GOALS) |
24 |
|
25 |
install: all |
26 |
for l in $(LANGS); do \ |
27 |
install -d $(localedir)/$$l/LC_MESSAGES; \ |
28 |
install -m 644 $$l.mo $(localedir)/$$l/LC_MESSAGES/$(PGOAL).mo; \ |
29 |
done |
30 |
|
31 |
clean: |
32 |
rm -f *~ *.[oas] *.mo $(MOFILES) TAGS $(PL_CFILES) |
33 |
|
34 |
%.mo: %.po |
35 |
msgfmt -o $@ $< |
36 |
|
37 |
POTFILES.in: |
38 |
(cd .. ; /bin/ls data/*.desktop.in data/*.directory.in *.desktop.in) > POTFILES.in |
39 |
|
40 |
$(PGOAL).pot: $(PL_FILES) POTFILES.in |
41 |
intltool-update --gettext-package desktopstuff --pot |
42 |
perl_checker -q --generate-pot $(PGOAL)_tmp.pot $(PL_FILES) |
43 |
msgcat --use-first $(PGOAL)_tmp.pot desktopstuff.pot > $@ |
44 |
rm -f desktopstuff.pot $(PGOAL)_tmp.pot |
45 |
|
46 |
update_n_merge: $(PGOAL).pot merge |
47 |
|
48 |
merge: |
49 |
@for n in $(POFILES); do \ |
50 |
echo "Merging $$n"; \ |
51 |
msgmerge -C "$$n" "$$n" $(PGOAL).pot > "$$n"t; \ |
52 |
mv -f "$$n"t "$$n"; \ |
53 |
done |
54 |
|
55 |
check: |
56 |
for i in *.po; do msgfmt -c $$i -o /dev/null; done |