~vcs-imports/debconf/svn

« back to all changes in this revision

Viewing changes to src/debconf/po/Makefile

  • Committer: joeyh
  • Date: 2011-02-02 00:33:44 UTC
  • Revision ID: svn-v4:a4a2c43b-8ac3-0310-8836-e0e880c912e2:trunk:2516
moved to git

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
        xgettext $(POTFILES) -o debconf.pot -Lperl
20
 
 
21
 
clean:
22
 
        rm -f $(MOFILES) messages messages.mo
23
 
 
24
 
%.mo: %.po
25
 
        msgfmt -o $@ $<
26
 
 
27
 
%.po: debconf.pot
28
 
        @echo -n "Merging debconf.pot and $@"
29
 
        @msgmerge $@ debconf.pot -o $@.new
30
 
# Typically all that changes was a date or line number. I'd prefer not to
31
 
# commit such changes, so detect and ignore them.
32
 
        @if [ "`diff $@ $@.new | grep '[<>]' | grep -v '[<>] #:' | wc -l`" -ne 2 ]; then \
33
 
                mv -f $@.new $@; \
34
 
        else \
35
 
                rm -f $@.new; \
36
 
        fi
37
 
        @msgfmt --statistics $@
38
 
 
39
 
check:
40
 
        @for file in $(POFILES); do \
41
 
                lang=`echo $$file | sed 's/\.po//'`; \
42
 
                printf "$$lang: "; \
43
 
                msgfmt -o /dev/null -c -v --statistics $$lang.po;\
44
 
        done