[1108] | 1 | INSTALL= /usr/bin/install -c |
---|
| 2 | INSTALL_PROGRAM= ${INSTALL} |
---|
| 3 | INSTALL_DATA= ${INSTALL} -m 644 |
---|
| 4 | INSTALLNLSDIR=/usr/share/locale |
---|
| 5 | |
---|
| 6 | MSGMERGE = msgmerge |
---|
| 7 | |
---|
| 8 | NLSPACKAGE = initscripts |
---|
| 9 | |
---|
| 10 | CATALOGS = $(shell ls *.po) |
---|
| 11 | FMTCATALOGS = $(patsubst %.po,%.mo,$(CATALOGS)) |
---|
| 12 | |
---|
| 13 | POTFILES = /etc/ppp/ip* /etc/rc.d/init.d/* /etc/rc.d/rc /etc/rc.d/rc.* /tmp/init.d/* \ |
---|
[6545] | 14 | $(shell find /etc/sysconfig/network-scripts/* -type f | grep -v ifcfg-) \ |
---|
[1108] | 15 | /sbin/service /usr/sbin/sys-unconfig /etc/event.d/* |
---|
| 16 | |
---|
| 17 | all: $(NLSPACKAGE).pot $(FMTCATALOGS) |
---|
| 18 | |
---|
| 19 | $(NLSPACKAGE).pot: |
---|
| 20 | @echo "Please don't run 'make initscripts.pot unless you have a *FULL*, current install." |
---|
| 21 | |
---|
| 22 | new-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 | |
---|
| 30 | refresh-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 | |
---|
| 43 | update-po: $(NLSPACKAGE).pot Makefile refresh-po |
---|
| 44 | |
---|
| 45 | report: |
---|
| 46 | @for cat in $(CATALOGS); do \ |
---|
| 47 | echo -n "$$cat: "; \ |
---|
| 48 | msgfmt -v --statistics -o /dev/null $$cat; \ |
---|
| 49 | done |
---|
| 50 | |
---|
| 51 | clean: |
---|
| 52 | rm -f *mo *.pyc |
---|
| 53 | |
---|
| 54 | distclean: clean |
---|
| 55 | rm -f .depend Makefile |
---|
| 56 | |
---|
| 57 | depend: |
---|
| 58 | |
---|
| 59 | install: 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 $@ $< |
---|