| 1 |
# List here all source files with translatable strings. |
| 2 |
POTFILES=$(sort $(shell find ../Debconf -type f -name \*.pm)) \ |
| 3 |
../dpkg-* ../debconf-* ../debconf |
| 4 |
|
| 5 |
POFILES=$(wildcard *.po) |
| 6 |
MOFILES=$(POFILES:.po=.mo) |
| 7 |
|
| 8 |
all: debconf.pot $(MOFILES) |
| 9 |
|
| 10 |
install: all |
| 11 |
for file in $(MOFILES); do \ |
| 12 |
lang=`echo $$file | sed 's/\.mo//'`; \ |
| 13 |
install -d $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/; \ |
| 14 |
install -m 0644 $$file $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/debconf.mo; \ |
| 15 |
done |
| 16 |
|
| 17 |
debconf.pot: $(POTFILES) |
| 18 |
@echo "Rebuilding the pot file" |
| 19 |
TZ=UTC xgettext $(POTFILES) -o debconf.pot.new -Lperl |
| 20 |
if [ -f debconf.pot ]; then \ |
| 21 |
./remove-potcdate.pl < debconf.pot > debconf.1po && \ |
| 22 |
./remove-potcdate.pl < debconf.pot.new > debconf.2po && \ |
| 23 |
if cmp debconf.1po debconf.2po >/dev/null 2>&1; then \ |
| 24 |
rm -f debconf.1po debconf.2po debconf.pot.new; \ |
| 25 |
else \ |
| 26 |
rm -f debconf.1po debconf.2po && \ |
| 27 |
mv debconf.pot.new debconf.pot; \ |
| 28 |
fi; \ |
| 29 |
else \ |
| 30 |
mv debconf.pot.new debconf.pot; \ |
| 31 |
fi |
| 32 |
|
| 33 |
clean: |
| 34 |
rm -f $(MOFILES) debconf.pot.new messages messages.mo |
| 35 |
|
| 36 |
%.mo: %.po |
| 37 |
msgfmt -o $@ $< |
| 38 |
|
| 39 |
%.po: debconf.pot |
| 40 |
@echo -n "Merging debconf.pot and $@" |
| 41 |
@msgmerge --previous $@ debconf.pot -o [email protected] |
| 42 |
@mv -f [email protected] $@ |
| 43 |
@msgfmt --statistics $@ |
| 44 |
|
| 45 |
check: |
| 46 |
@for file in $(POFILES); do \ |
| 47 |
lang=`echo $$file | sed 's/\.po//'`; \ |
| 48 |
printf "$$lang: "; \ |
| 49 |
msgfmt -o /dev/null -c -v --statistics $$lang.po;\ |
| 50 |
done |