aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-01-01 05:59:20 +0000
committerMike Frysinger <vapier@gentoo.org>2010-01-01 05:59:20 +0000
commit8003503aee3a31d6f3e327cae40c78bcc545d503 (patch)
treeb867a3fda84755c0a1790d1557d942336c1ae04b
parentimprove dist target: include compiled gettext files, exclude scm files, and a... (diff)
downloadnet-tools-8003503aee3a31d6f3e327cae40c78bcc545d503.tar.gz
net-tools-8003503aee3a31d6f3e327cae40c78bcc545d503.tar.bz2
net-tools-8003503aee3a31d6f3e327cae40c78bcc545d503.zip
po/man: if LINGUAS is set, only install translations for those langs
-rw-r--r--man/Makefile11
-rw-r--r--po/Makefile26
2 files changed, 24 insertions, 13 deletions
diff --git a/man/Makefile b/man/Makefile
index 4ef1af8..23f5468 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -29,9 +29,14 @@ mandir=/usr/share/man
-include ../config.make
ifeq ($(I18N),1)
-LANGS=`ls -d * | grep -v Makefile`
+ALL_LANGS = $(filter-out Makefile,$(wildcard *))
+ifeq ($(LINGUAS),)
+LANGS = $(ALL_LANGS)
else
-LANGS=en_US
+LANGS = $(sort $(filter $(LINGUAS),$(ALL_LANGS)) en_US)
+endif
+else
+LANGS = en_US
endif
all:
@@ -43,7 +48,7 @@ clean:
clobber: clean
install:
- LANGS=$(LANGS) ; \
+ LANGS='$(LANGS)' ; \
for LANG in $$LANGS; do \
cd $$LANG; \
for SECTION in 1 5 8; do \
diff --git a/po/Makefile b/po/Makefile
index 25cf972..c7f27fb 100644
--- a/po/Makefile
+++ b/po/Makefile
@@ -8,12 +8,19 @@ TUPDATE = msgmerge
NLSPACKAGE = net-tools
-include ../config.make
-ALL_CATALOGS = de.mo fr.mo pt_BR.mo et_EE.mo cs.mo
+ALL_POS = $(wildcard *.po)
+ALL_LANGS = $(ALL_POS:%.po=%)
+ALL_CATALOGS = $(ALL_LANGS:%=%.mo)
ifeq ($(I18N),1)
-CATALOGS = $(ALL_CATALOGS)
+ifeq ($(LINGUAS),)
+LANGS = $(ALL_LANGS)
else
-CATALOGS =
+LANGS = $(filter $(LINGUAS),$(ALL_LANGS))
endif
+else
+LANGS =
+endif
+CATALOGS = $(LANGS:%=%.mo)
POTFILES=../arp.c ../hostname.c ../ifconfig.c ../netstat.c ../rarp.c \
../route.c ../plipconfig.c ../iptunnel.c ../statistics.c \
@@ -45,9 +52,9 @@ $(NLSPACKAGE).pot: $(POTFILES)
update-po: Makefile
$(MAKE) $(NLSPACKAGE).pot
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- lang=`echo $$cat | sed 's/.mo//'`; \
+ langs='$(ALL_LANGS)'; \
+ for lang in $$langs; do \
+ cat=$$lang.mo; \
mv $$lang.po $$lang.old.po; \
echo "$$lang:"; \
if $(TUPDATE) $$lang.old.po $(NLSPACKAGE).pot > $$lang.po; then \
@@ -70,12 +77,11 @@ distclean: clean
depend:
install: $(CATALOGS)
- catalogs='$(CATALOGS)'; \
- for n in $$catalogs; do \
- l=`basename $$n .mo`; \
+ langs='$(LANGS)'; \
+ for l in $$langs; do \
$(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l; \
$(INSTALL) -m 755 -d $(INSTALLNLSDIR)/$$l/LC_MESSAGES; \
- $(INSTALL) -m 644 $$n $(INSTALLNLSDIR)/$$l/LC_MESSAGES/net-tools.mo; \
+ $(INSTALL) -m 644 $$l.mo $(INSTALLNLSDIR)/$$l/LC_MESSAGES/net-tools.mo; \
done
%.mo: %.po