[Dctrl-tools-devel] [SCM] Debian control file query tools branch, master, updated. 2.18-6-g861dc68

Antti-Juhani Kaijanaho ajk at debian.org
Sun Mar 13 12:46:29 UTC 2011


The following commit has been merged in the master branch:
commit f104b00bb06ecff2b8bb7abef985ee0a6dbdbeaa
Author: David Prévot <david at tilapin.org>
Date:   Sun Feb 27 15:54:02 2011 -0400

    Makes manpages translatable (using po4a)

diff --git a/GNUmakefile b/GNUmakefile
index 7301663..6c23678 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -27,6 +27,9 @@ INSTALL_PROGRAM = $(INSTALL)
 INSTALL_DATA = $(INSTALL) -m644
 INSTALL_DIR = $(INSTALL) -d
 
+PO4A = po4a
+PO4A_CONFIG = man/po4a/po4a.cfg
+
 libsrc = $(wildcard lib/*.c)
 libobj = $(libsrc:.c=.o)
 
@@ -48,7 +51,7 @@ LDLIBS = -L. -ldctrl
 # List of translated languages is given in langs.mk
 include langs.mk
 
-all :	all-no-mo mo
+all :	all-no-mo mo translated-man
 
 all-no-mo :	sync-available/sync-available \
 		man/grep-dctrl.1 \
@@ -84,7 +87,29 @@ install :
 	gzip -9 $(DESTDIR)$(man1dir)/grep-dctrl.1
 	set -e ; for dest in $(aliases) ; do \
 		ln -s grep-dctrl.1.gz $(DESTDIR)$(man1dir)/$$dest.1.gz ; \
-	 done
+	done
+	set -e ; for d in man/translated/*; do \
+		lang=`echo $$d | cut -c16-`; \
+		if [ -e $$d/sync-available.8 ]; then \
+			$(INSTALL_DIR) $(DESTDIR)$(mandir)/$$lang/man8; \
+			$(INSTALL_DATA) $$d/sync-available.8 $(DESTDIR)$(mandir)/$$lang/man8/; \
+			gzip -9 $(DESTDIR)$(mandir)/$$lang/man8/sync-available.8; \
+		fi; \
+		for file in sort-dctrl.1 tbl-dctrl.1 join-dctrl.1 grep-dctrl.1; do \
+			if [ -e $$d/$$file ]; then \
+				if ! [ -d $(DESTDIR)$(mandir)/$$lang/man1 ]; then \
+					$(INSTALL_DIR) $(DESTDIR)$(mandir)/$$lang/man1; \
+				fi; \
+				$(INSTALL_DATA) $$d/$$file $(DESTDIR)$(mandir)/$$lang/man1/; \
+				gzip -9 $(DESTDIR)$(mandir)/$$lang/man1/$$file; \
+			fi; \
+		done; \
+		if [ -e $(DESTDIR)$(mandir)$$lang/man1/grep-dctrl.1.gz ]; then \
+			for dest in $(aliases) ; do \
+				ln -s grep-dctrl.1.gz $(DESTDIR)$(mandir)/$$lang/man1/$$dest.1.gz ; \
+			done; \
+		fi; \
+	done;
 	$(INSTALL_DATA) TODO README $(DESTDIR)$(docdir)
 	set -e ; for lang in $(langs) ; do \
 		$(INSTALL_DIR) $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES ; \
@@ -93,7 +118,7 @@ install :
 	done
 
 
-pot : po/dctrl-tools.pot
+pot : po/dctrl-tools.pot man/po4a/po/dctrl-tools-man.pot
 
 po : $(foreach f,$(langs),po/$(f).po)
 
@@ -154,6 +179,25 @@ po/dctrl-tools.pot : $(src)
 	xgettext $(xgettext_opts) -d grep-dctrl $^
 	mv grep-dctrl.po $@
 
+# create (or update) dctrl-tools-man.pot
+man/po4a/po/dctrl-tools-man.pot :
+	touch man/po4a/po/dctrl-tools-man.pot
+	$(PO4A) --force --no-translations $(PO4A_CONFIG)
+
+# build translated manpages in man/translated/$lang/
+po4a :
+	touch man/po4a/po/dctrl-tools-man.pot
+	$(PO4A) --force --no-backups $(PO4A_CONFIG)
+
+# handle the "%.1 : %.1.cp" rule if and only if the grep-dctrl.1.cp file exists
+translated-man : po4a
+	set -e ; for d in man/translated/*; do \
+		if [ -e $$d/grep-dctrl.1.cp ]; then \
+			sed 's*SYSCONF*$(sysconfdir)*' \
+			$$d/grep-dctrl.1.cp > $$d/grep-dctrl.1; \
+		fi; \
+       done
+
 fsaf.test : fsaf.test.o msg.o
 
 test :	all-no-mo
@@ -163,11 +207,12 @@ clean :
 	$(RM) core $(exe) man/grep-dctrl.1 $(obj) so/*.o libdctrl.a libdctrl.so
 	$(RM) po/*.mo TAGS *.d */*.d
 	$(RM) sync-available/sync-available
+	$(RM) -r man/translated
 
 distclean : clean
 
 maintainer-clean : distclean
-	$(RM) po/*.pot
+	$(RM) po/*.pot man/po4a/po/*.pot
 
 tags :
 	etags *.[hc]
diff --git a/debian/control b/debian/control
index b5e635e..4db1e2c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: dctrl-tools developers <dctrl-tools-devel at lists.alioth.debian.org>
 Uploaders: Antti-Juhani Kaijanaho <ajk at debian.org>
 Standards-Version: 3.9.1
-Build-Depends: gettext (>= 0.11-0), gcc (>= 3.0), debhelper (>= 8)
+Build-Depends: gettext (>= 0.11-0), gcc (>= 3.0), debhelper (>= 8), po4a (>= 0.40)
 Vcs-Git: git://git.debian.org/git/collab-maint/dctrl-tools.git
 Vcs-Browser: http://git.debian.org/?p=collab-maint/dctrl-tools.git;a=summary
 
diff --git a/man/.gitignore b/man/.gitignore
index 5ef3e00..e171ca3 100644
--- a/man/.gitignore
+++ b/man/.gitignore
@@ -1 +1,2 @@
 grep-dctrl.1
+translated
diff --git a/man/po4a/addendum.template b/man/po4a/addendum.template
new file mode 100644
index 0000000..d453494
--- /dev/null
+++ b/man/po4a/addendum.template
@@ -0,0 +1,22 @@
+PO4A-HEADER:mode=after;position=^\.SH "SEE ALSO";beginboundary=^\.SH
+.SH TRANSLATOR(S)
+This manpage has been translated by TRANSLATOR NAME <email> on TRANSLATION
+DATE.
+
+If you find any mistake in this translation, please send an e-mail to the
+translator or to the
+.nh
+<\fIdebian\-l10n\-LANGUAGE at lists.debian.org\fR>,
+.hy
+mailing-list.
+
+# Note to translators:
+# Please translate this text in a file called language_code.add
+# The addendum MUST use the same encoding as your po file
+# Feel free to adapt the text at your convenience.
+# Do not forget to translate "SEE ALSO" and "TRANSLATOR(S)"
+# The "SEE ALSO" part in the header must be *exactly* the same translation
+# as the one in your xx.po file.
+# Do not include this comment in your addendum (i.e. all lines starting
+# with a #).
+# See po4a(7) for further information.
diff --git a/man/po4a/po/.gitignore b/man/po4a/po/.gitignore
new file mode 100644
index 0000000..07fd2eb
--- /dev/null
+++ b/man/po4a/po/.gitignore
@@ -0,0 +1,2 @@
+*~
+dctrl-tools-man.pot
diff --git a/man/po4a/po4a.cfg b/man/po4a/po4a.cfg
new file mode 100644
index 0000000..ace0f69
--- /dev/null
+++ b/man/po4a/po4a.cfg
@@ -0,0 +1,14 @@
+[po_directory] man/po4a/po/
+
+[po4a_alias:man] man opt:"-M UTF-8 -L UTF-8"
+
+[type: man] man/grep-dctrl.1.cp		$lang:man/translated/$lang/grep-dctrl.1.cp \
+					add_$lang:?man/po4a/add_$lang/$lang.add
+[type: man] man/join-dctrl.1		$lang:man/translated/$lang/join-dctrl.1 \
+					add_$lang:?man/po4a/add_$lang/$lang.add
+[type: man] man/sort-dctrl.1		$lang:man/translated/$lang/sort-dctrl.1 \
+					add_$lang:?man/po4a/add_$lang/$lang.add
+[type: man] man/sync-available.8	$lang:man/translated/$lang/sync-available.8 \
+					add_$lang:?man/po4a/add_$lang/$lang.add
+[type: man] man/tbl-dctrl.1		$lang:man/translated/$lang/tbl-dctrl.1 \
+					add_$lang:?man/po4a/add_$lang/$lang.add

-- 
Debian control file query tools



More information about the Dctrl-tools-devel mailing list