source: projects/initscripts/tags/initscripts-8.91.3/po/Makefile @ 1108

Revision 1108, 1.8 KB checked in by daisuke, 14 years ago (diff)

import initscripts-8.90.6 from internal cvs repository

Line 
1INSTALL= /usr/bin/install -c
2INSTALL_PROGRAM= ${INSTALL}
3INSTALL_DATA= ${INSTALL} -m 644
4INSTALLNLSDIR=/usr/share/locale
5
6MSGMERGE = msgmerge
7
8NLSPACKAGE = initscripts
9
10CATALOGS = $(shell ls *.po)
11FMTCATALOGS = $(patsubst %.po,%.mo,$(CATALOGS))
12
13POTFILES = /etc/ppp/ip* /etc/rc.d/init.d/* /etc/rc.d/rc /etc/rc.d/rc.* /tmp/init.d/* \
14        $(shell ls /etc/sysconfig/network-scripts/* | grep -v ifcfg-) \
15        /sbin/service /usr/sbin/sys-unconfig /etc/event.d/*
16
17all: $(NLSPACKAGE).pot $(FMTCATALOGS)
18
19$(NLSPACKAGE).pot:
20        @echo "Please don't run 'make initscripts.pot unless you have a *FULL*, current install."
21
22new-pot-file-i-really-mean-it: $(POTFILES)
23        ./xgettext_sh.py $(POTFILES) > $(NLSPACKAGE).po
24        if cmp -s $(NLSPACKAGE).po $(NLSPACKAGE).pot; then \
25            rm -f $(NLSPACKAGE).po; \
26        else \
27            mv $(NLSPACKAGE).po $(NLSPACKAGE).pot; \
28        fi
29
30refresh-po: Makefile
31        catalogs='$(CATALOGS)'; \
32        for cat in $$catalogs; do \
33                lang=`echo $$cat | sed 's/.po//'`; \
34                if $(MSGMERGE) $$lang.po $(NLSPACKAGE).pot > $$lang.pot ; then \
35                        mv -f $$lang.pot $$lang.po ; \
36                        echo "$(MSGMERGE) of $$lang succeeded" ; \
37                else \
38                        echo "$(MSGMERGE) of $$lang failed" ; \
39                        rm -f $$lang.pot ; \
40                fi \
41        done
42
43update-po: $(NLSPACKAGE).pot Makefile refresh-po
44
45report:
46        @for cat in $(CATALOGS); do \
47                echo -n "$$cat: "; \
48                msgfmt -v --statistics -o /dev/null $$cat; \
49        done
50
51clean:
52        rm -f *mo *.pyc
53
54distclean: clean
55        rm -f .depend Makefile
56
57depend:
58
59install:        all
60        mkdir -p $(PREFIX)/$(INSTALLNLSDIR)
61        for n in $(CATALOGS); do \
62            l=`basename $$n .po`; \
63            mo=$$l.mo; \
64            $(INSTALL) -m 755 -d $(PREFIX)/$(INSTALLNLSDIR)/$$l; \
65            $(INSTALL) -m 755 -d $(PREFIX)/$(INSTALLNLSDIR)/$$l/LC_MESSAGES; \
66            $(INSTALL) -m 644 $$mo \
67                $(PREFIX)/$(INSTALLNLSDIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \
68        done
69
70%.mo: %.po
71        msgfmt -o $@ $<
Note: See TracBrowser for help on using the repository browser.