Source: shadow
Source-Version: 1:4.5-1
Severity: wishlist
Tags: upstream patch
Control: block -1 by 881886
Control: block -1 by 881888

Hi!

I was looking into switching this package from gnome-doc-utils (which
was reported to me as being deprecated, and a blocker in the
rebootstrap effort) to a pure gettext solution.

Unfortunately upstream gettext XML support does not seem mature
enough, so this is currently not possible. :( I guess another option
might be to switch to use po4a, but I've taken already too much time
with this.

I'm attaching what I've got, which could be applied once the blocking
bugs have been fixed.

Thanks,
Guillem
From d4fb35319a421bfd802dcf8871d879e1356fd4d9 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@hadrons.org>
Date: Sat, 4 Nov 2017 02:56:56 +0100
Subject: [PATCH] build: Switch to gettext XML support

---
 configure.ac                  |  10 +-
 debian/control                |   3 +-
 debian/dependencies           |   6 +-
 man/.gitignore                |   9 ++
 man/Makefile.am               |   2 +-
 man/generate_mans.mak         |   1 +
 man/generate_translations.mak |   5 +-
 man/po/LINGUAS                |  16 +--
 man/po/Makefile.in            | 245 ------------------------------------------
 man/po/Makevars               |  53 ++++++++-
 man/po/POTFILES.in            |  41 +++++++
 man/po/XMLFILES               |  42 --------
 man/po/its/docbook.its        | 215 ++++++++++++++++++++++++++++++++++++
 man/po/its/docbook.loc        |   6 ++
 po/Makevars                   |  53 ++++++++-
 15 files changed, 398 insertions(+), 309 deletions(-)
 delete mode 100644 man/po/Makefile.in
 create mode 100644 man/po/POTFILES.in
 delete mode 100644 man/po/XMLFILES
 create mode 100644 man/po/its/docbook.its
 create mode 100644 man/po/its/docbook.loc

diff --git a/configure.ac b/configure.ac
index 2dcf966..acededf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -622,7 +622,13 @@ fi
 
 AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.])
 
-AM_GNU_GETTEXT_VERSION(0.16)
+# Require at least this gettext version, but will take any later version too.
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.7])
+# XXX: We cannot remove the following macro due to backwards compatibility
+# reasons. The above macro is set unconditionally to the minimal version
+# required, and the below is set to 0.19.6, the first version introducing
+# the AM_GNU_GETTEXT_REQUIRE_VERSION macro.
+AM_GNU_GETTEXT_VERSION([0.19.6])
 AM_GNU_GETTEXT([external], [need-ngettext])
 AM_CONDITIONAL(USE_NLS, test "x$USE_NLS" = "xyes")
 
@@ -632,7 +638,7 @@ AC_CONFIG_FILES([
 	doc/Makefile
 	man/Makefile
 	man/config.xml
-	man/po/Makefile
+	man/po/Makefile.in
 	man/cs/Makefile
 	man/da/Makefile
 	man/de/Makefile
diff --git a/debian/control b/debian/control
index 58f8828..942aa24 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Christian Perrier <bubu...@debian.org>,
 Section: admin
 Priority: required
 Build-Depends: dh-autoreconf,
-               gettext,
+               gettext (>= 0.19.7),
                libpam0g-dev,
                debhelper (>= 10~),
                quilt,
@@ -17,7 +17,6 @@ Build-Depends: dh-autoreconf,
                cdbs,
                libselinux1-dev [linux-any],
                libsemanage1-dev [linux-any],
-               gnome-doc-utils,
                bison,
                libaudit-dev [linux-any]
 Standards-Version: 3.9.5
diff --git a/debian/dependencies b/debian/dependencies
index e8cc141..bcc9663 100644
--- a/debian/dependencies
+++ b/debian/dependencies
@@ -4,8 +4,8 @@ Build-Depends:
  * automake1.9
    works with 1.7 or 1.9 (at least)
  * libtool
- * gettext
-   POT, PO, GMO regenerated?
+ * gettext (>= 0.19.7)
+   POT, PO, GMO regenerated, 0.19.7 needed for XML support
  * libpam0g-dev
    OK
  * debhelper (>= 4.1.16)
@@ -28,8 +28,6 @@ Build-Depends:
  * cdbs
    used in debian/rules
  * libselinux1-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64]
- * gnome-doc-utils (>= 0.4.3-1)
-   xml2po, 0.4.3-1 needed for the -l switch.
 
 passwd Depends:
 ===============
diff --git a/man/.gitignore b/man/.gitignore
index a5a91a9..7a58a5a 100644
--- a/man/.gitignore
+++ b/man/.gitignore
@@ -4,5 +4,14 @@ generate_mans.deps
 
 *.[0-9]
 
+/po/Makefile.in.in
+/po/Makevars.template
 /po/POTFILES
+/po/Rules-quot
+/po/boldquot.sed
+/po/en@boldquot.header
+/po/en@quot.header
+/po/insert-header.sin
+/po/quot.sed
+/po/remove-potcdate.sin
 /po/stamp-po
diff --git a/man/Makefile.am b/man/Makefile.am
index 4c34022..a9d0115 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -203,7 +203,7 @@ generate_mans.deps: *.xml
 
 if ENABLE_REGENERATE_MAN
 
-@ENABLE_REGENERATE_MAN_TRUE@include generate_mans.deps
+@ENABLE_REGENERATE_MAN_TRUE@-include generate_mans.deps
 
 include generate_mans.mak
 
diff --git a/man/generate_mans.mak b/man/generate_mans.mak
index a0721b8..83be60e 100644
--- a/man/generate_mans.mak
+++ b/man/generate_mans.mak
@@ -39,6 +39,7 @@ man1/% man3/% man5/% man8/%: %.xml-config Makefile config.xml
 	            --param "man.authors.section.enabled" "0" \
 	            --stringparam "man.output.base.dir" "" \
 	            --param "man.output.in.separate.dir" "1" \
+	            --path "$(top_srcdir)/man/login.defs.d/" \
 	            -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl $<
 
 clean-local:
diff --git a/man/generate_translations.mak b/man/generate_translations.mak
index 7d242cc..79b61ef 100644
--- a/man/generate_translations.mak
+++ b/man/generate_translations.mak
@@ -6,7 +6,8 @@ config.xml: ../config.xml.in
 	cp ../config.xml $@
 
 %.xml: ../%.xml ../po/$(LANG).po
-	xml2po --expand-all-entities -l $(LANG) -p ../po/$(LANG).po -o $@ ../$@
+	GETTEXTDATADIR="$(top_srcdir)/man/po" \
+	$(MSGFMT) --xml --template $< -l $(LANG) -o $@ ../po/$(LANG).po
 	sed -i 's:\(^<refentry .*\)>:\1 lang="$(LANG)">:' $@
 
 include ../generate_mans.mak
@@ -16,4 +17,4 @@ $(man_MANS):
 	@echo you need to run configure with --enable-man to generate man pages
 endif
 
-CLEANFILES = .xml2po.mo $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST)) config.xml
+CLEANFILES = $(EXTRA_DIST) $(addsuffix .xml,$(EXTRA_DIST)) config.xml
diff --git a/man/po/LINGUAS b/man/po/LINGUAS
index 1bf026a..171c176 100644
--- a/man/po/LINGUAS
+++ b/man/po/LINGUAS
@@ -1,8 +1,10 @@
-# LINGUAS
+# This file contains the list of available and enabled translations.
 
-LINGUAS = da de fr it pl ru sv zh_CN
-
-# These variables are generated based on the LINGUAS list
-POFILES = $(patsubst %,$(srcdir)/%.po,$(LINGUAS))
-UPDATEPOFILES = $(patsubst %,%.po-update,$(LINGUAS))
-DUMMYPOFILES = $(patsubst %,%.nop,$(LINGUAS))
+da
+de
+fr
+it
+pl
+ru
+sv
+zh_CN
diff --git a/man/po/Makefile.in b/man/po/Makefile.in
deleted file mode 100644
index deaa870..0000000
--- a/man/po/Makefile.in
+++ /dev/null
@@ -1,245 +0,0 @@
-# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drep...@gnu.ai.mit.edu>
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU General Public
-# License but which still want to provide support for the GNU gettext
-# functionality.
-# Please note that the actual code of GNU gettext is covered by the GNU
-# General Public License and is *not* in the public domain.
-#
-# Origin: gettext-0.16
-# Modified to handle translations with xml2po by Nicolas François - 2007
-
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-MSGFMT_ = @MSGFMT@
-MSGFMT_no = @MSGFMT@
-MSGFMT_yes = @MSGFMT_015@
-MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
-XGETTEXT_ = @XGETTEXT@
-XGETTEXT_no = @XGETTEXT@
-XGETTEXT_yes = @XGETTEXT_015@
-XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
-MSGMERGE = @MSGMERGE@ --previous
-MSGMERGE_UPDATE = @MSGMERGE@ --update --previous
-MSGINIT = msginit
-MSGCONV = msgconv
-MSGFILTER = msgfilter
-
-include $(srcdir)/LINGUAS
-DISTFILES = $(srcdir)/Makevars $(srcdir)/XMLFILES $(srcdir)/LINGUAS $(POFILES)
-
-include $(srcdir)/XMLFILES
-
-include $(srcdir)/Makevars
-
-.SUFFIXES:
-.SUFFIXES: .po .sed .sin .nop .po-create .po-update
-
-remove-potcdate.sin: $(top_srcdir)/po/remove-potcdate.sin
-	cp $? $@
-
-.sin.sed:
-	sed -e '/^#/d' $< > t-$@
-	mv t-$@ $@
-
-all: all-yes
-
-all-yes: stamp-po
-all-no:
-
-# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
-# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
-# we don't want to bother translators with empty POT files). We assume that
-# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
-# In this case, stamp-po is a nop (i.e. a phony target).
-
-# stamp-po is a timestamp denoting the last time at which the CATALOGS have
-# been loosely updated. Its purpose is that when a developer or translator
-# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
-# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
-# invocations of "make" will do nothing. This timestamp would not be necessary
-# if updating the $(CATALOGS) would always touch them; however, the rule for
-# $(POFILES) has been designed to not touch files that don't need to be
-# changed.
-stamp-po: $(srcdir)/$(DOMAIN).pot
-	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
-	  echo "touch stamp-po" && \
-	  echo timestamp > stamp-poT && \
-	  mv stamp-poT stamp-po; \
-	}
-
-# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
-# otherwise packages like GCC can not be built if only parts of the source
-# have been downloaded.
-
-# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
-# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
-# TODO: set MSGID_BUGS_ADDRESS, COPYRIGHT_HOLDER
-$(DOMAIN).pot-update: $(XMLFILES) $(srcdir)/XMLFILES remove-potcdate.sed
-	@set -e; tmpdir=`pwd`; \
-	echo "cd $(top_srcdir)/man"; \
-	cd $(top_srcdir)/man; \
-	echo "xml2po --expand-all-entities -o $$tmpdir/$(DOMAIN).po $(notdir $(XMLFILES))"; \
-	xml2po --expand-all-entities -o $$tmpdir/$(DOMAIN).po $(notdir $(XMLFILES)); \
-	cd $$tmpdir
-	test ! -f $(DOMAIN).po || { \
-	  if test -f $(srcdir)/$(DOMAIN).pot; then \
-	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
-	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
-	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
-	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
-	    else \
-	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
-	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
-	    fi; \
-	  else \
-	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
-	  fi; \
-	}
-
-# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
-# every "make" invocation, only create it when it is missing.
-# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
-$(srcdir)/$(DOMAIN).pot:
-	$(MAKE) $(DOMAIN).pot-update
-
-# This target rebuilds a PO file if $(DOMAIN).pot has changed.
-# Note that a PO file is not touched if it doesn't need to be changed.
-$(POFILES): $(srcdir)/$(DOMAIN).pot
-	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
-	if test -f "$(srcdir)/$${lang}.po"; then \
-	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
-	  cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
-	else \
-	  $(MAKE) $${lang}.po-create; \
-	fi
-
-
-install: install-exec install-data
-install-exec:
-install-data:
-
-install-strip: install
-
-installdirs: installdirs-exec installdirs-data
-installdirs-exec:
-installdirs-data:
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall: uninstall-exec uninstall-data
-uninstall-exec:
-uninstall-data:
-
-check: all
-
-info dvi ps pdf html tags TAGS ctags CTAGS ID:
-
-mostlyclean:
-	rm -f remove-potcdate.sed remove-potcdate.sin
-	rm -f stamp-poT
-	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
-
-clean: mostlyclean
-
-distclean: clean
-	rm -f Makefile
-
-maintainer-clean: distclean
-	@echo "This command is intended for maintainers to use;"
-	@echo "it deletes files that may require special tools to rebuild."
-	rm -f stamp-po
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir:
-	$(MAKE) update-po
-	@$(MAKE) dist2
-# This is a separate target because 'update-po' must be executed before.
-dist2: stamp-po $(DISTFILES)
-	dists="$(DISTFILES)"; \
-	if test -f $(srcdir)/$(DOMAIN).pot; then \
-	  dists="$$dists $(DOMAIN).pot stamp-po"; \
-	fi; \
-	if test -f $(srcdir)/ChangeLog; then \
-	  dists="$$dists ChangeLog"; \
-	fi; \
-	for i in 0 1 2 3 4 5 6 7 8 9; do \
-	  if test -f $(srcdir)/ChangeLog.$$i; then \
-	    dists="$$dists ChangeLog.$$i"; \
-	  fi; \
-	done; \
-	for file in $$dists; do \
-	  if test -f $$file; then \
-	    cp -p $$file $(distdir) || exit 1; \
-	  else \
-	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
-	  fi; \
-	done
-
-update-po: Makefile
-	$(MAKE) $(DOMAIN).pot-update
-	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
-
-# General rule for creating PO files.
-
-.nop.po-create:
-	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
-	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
-	exit 1
-
-# General rule for updating PO files.
-
-.nop.po-update:
-	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
-	tmpdir=`pwd`; \
-	echo "$$lang:"; \
-	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-	echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
-	cd $(srcdir); \
-	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
-	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
-	    rm -f $$tmpdir/$$lang.new.po; \
-	  else \
-	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
-	      :; \
-	    else \
-	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
-	      exit 1; \
-	    fi; \
-	  fi; \
-	else \
-	  echo "msgmerge for $$lang.po failed!" 1>&2; \
-	  rm -f $$tmpdir/$$lang.new.po; \
-	fi
-
-$(DUMMYPOFILES):
-
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
-	@case '$?' in \
-	  *config.status*) \
-	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
-	  *) \
-	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
-	esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
-	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/man/po/Makevars b/man/po/Makevars
index c78c646..db3cb8d 100644
--- a/man/po/Makevars
+++ b/man/po/Makevars
@@ -7,6 +7,13 @@ DOMAIN = $(PACKAGE)-man-pages
 subdir = man/po
 top_builddir = ../..
 
+# This is needed so that xgettext can find our local ITS and Location files,
+# to know how to handle the PolicyKit XML files. Otherwise we would need to
+# build depend on PolicyKit itself. We cannot pass an explicit --its option
+# because that forces the implementation language for all input files.
+GETTEXTDATADIR = $(top_srcdir)/man/po
+export GETTEXTDATADIR
+
 # These options get passed to xgettext.
 XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-location
 
@@ -20,8 +27,52 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-location
 # their copyright.
 COPYRIGHT_HOLDER = Free Software Foundation, Inc.
 
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT)
+
 # This is the list of locale categories, beyond LC_MESSAGES, for which the
 # message catalogs shall be used.  It is usually empty.
 EXTRA_LOCALE_CATEGORIES =
 
-MSGID_BUGS_ADDRESS = pkg-shadow-de...@lists.alioth.debian.org
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS = --previous --no-location --quiet
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
diff --git a/man/po/POTFILES.in b/man/po/POTFILES.in
new file mode 100644
index 0000000..01a3e9c
--- /dev/null
+++ b/man/po/POTFILES.in
@@ -0,0 +1,41 @@
+# List of xml which contain translatable strings.
+
+man/chage.1.xml
+man/chfn.1.xml
+man/chgpasswd.8.xml
+man/chpasswd.8.xml
+man/chsh.1.xml
+man/expiry.1.xml
+man/faillog.5.xml
+man/faillog.8.xml
+man/gpasswd.1.xml
+man/groupadd.8.xml
+man/groupdel.8.xml
+man/groupmems.8.xml
+man/groupmod.8.xml
+man/groups.1.xml
+man/grpck.8.xml
+man/gshadow.5.xml
+man/lastlog.8.xml
+man/limits.5.xml
+man/login.1.xml
+man/login.access.5.xml
+man/login.defs.5.xml
+man/logoutd.8.xml
+man/newgrp.1.xml
+man/newusers.8.xml
+man/nologin.8.xml
+man/passwd.1.xml
+man/passwd.5.xml
+man/porttime.5.xml
+man/pwck.8.xml
+man/pwconv.8.xml
+man/shadow.3.xml
+man/shadow.5.xml
+man/sg.1.xml
+man/su.1.xml
+man/suauth.5.xml
+man/useradd.8.xml
+man/userdel.8.xml
+man/usermod.8.xml
+man/vipw.8.xml
diff --git a/man/po/XMLFILES b/man/po/XMLFILES
deleted file mode 100644
index de7925d..0000000
--- a/man/po/XMLFILES
+++ /dev/null
@@ -1,42 +0,0 @@
-# List of xml which contain translatable strings.
-XMLFILES = \
-	$(top_srcdir)/man/chage.1.xml \
-	$(top_srcdir)/man/chfn.1.xml \
-	$(top_srcdir)/man/chgpasswd.8.xml \
-	$(top_srcdir)/man/chpasswd.8.xml \
-	$(top_srcdir)/man/chsh.1.xml \
-	$(top_srcdir)/man/expiry.1.xml \
-	$(top_srcdir)/man/faillog.5.xml \
-	$(top_srcdir)/man/faillog.8.xml \
-	$(top_srcdir)/man/gpasswd.1.xml \
-	$(top_srcdir)/man/groupadd.8.xml \
-	$(top_srcdir)/man/groupdel.8.xml \
-	$(top_srcdir)/man/groupmems.8.xml \
-	$(top_srcdir)/man/groupmod.8.xml \
-	$(top_srcdir)/man/groups.1.xml \
-	$(top_srcdir)/man/grpck.8.xml \
-	$(top_srcdir)/man/gshadow.5.xml \
-	$(top_srcdir)/man/lastlog.8.xml \
-	$(top_srcdir)/man/limits.5.xml \
-	$(top_srcdir)/man/login.1.xml \
-	$(top_srcdir)/man/login.access.5.xml \
-	$(top_srcdir)/man/login.defs.5.xml \
-	$(top_srcdir)/man/logoutd.8.xml \
-	$(top_srcdir)/man/newgrp.1.xml \
-	$(top_srcdir)/man/newusers.8.xml \
-	$(top_srcdir)/man/nologin.8.xml \
-	$(top_srcdir)/man/passwd.1.xml \
-	$(top_srcdir)/man/passwd.5.xml \
-	$(top_srcdir)/man/porttime.5.xml \
-	$(top_srcdir)/man/pwck.8.xml \
-	$(top_srcdir)/man/pwconv.8.xml \
-	$(top_srcdir)/man/shadow.3.xml \
-	$(top_srcdir)/man/shadow.5.xml \
-	$(top_srcdir)/man/sg.1.xml \
-	$(top_srcdir)/man/su.1.xml \
-	$(top_srcdir)/man/suauth.5.xml \
-	$(top_srcdir)/man/useradd.8.xml \
-	$(top_srcdir)/man/userdel.8.xml \
-	$(top_srcdir)/man/usermod.8.xml \
-	$(top_srcdir)/man/vipw.8.xml
-
diff --git a/man/po/its/docbook.its b/man/po/its/docbook.its
new file mode 100644
index 0000000..d088f31
--- /dev/null
+++ b/man/po/its/docbook.its
@@ -0,0 +1,215 @@
+<its:rules
+    xmlns:its="http://www.w3.org/2005/11/its";
+    xmlns:itst="http://itstool.org/extensions/";
+    version="2.0">
+
+  <itst:match selector="/book"/>
+  <itst:match selector="/article"/>
+  <itst:match selector="/chapter"/>
+  <itst:match selector="/refentry"/>
+
+  <its:langRule selector="//*[namespace-uri(.) = '']" langPointer="@lang"/>
+
+  <itst:credits appendTo="/book/bookinfo | /article/articleinfo | /chapter/chapterinfo | /refentry/refentryinfo">
+    <othercredit class="translator">
+      <personname>
+        <firstname><itst:value-of select="name"/></firstname>
+      </personname>
+      <email><itst:value-of select="email"/></email>
+    </othercredit>
+    <copyright>
+      <itst:for-each select="years">
+        <year><itst:value-of select="year"/></year>
+      </itst:for-each>
+      <holder><itst:value-of select="name"/></holder>
+    </copyright>
+  </itst:credits>
+
+  <!-- Inline by default, might be overridden -->
+  <its:withinTextRule withinText="yes" selector="//abbrev |
+                                                 //accel |
+                                                 //acronym |
+                                                 //action |
+                                                 //affiliation |
+                                                 //anchor |
+                                                 //application |
+                                                 //arg |
+                                                 //audiodata |
+                                                 //audioobject |
+                                                 //authorinitials |
+                                                 //biblioref |
+                                                 //citation |
+                                                 //citebiblioid |
+                                                 //citerefentry |
+                                                 //citerefentry/manvolnum |
+                                                 //citerefentry/refentrytitle |
+                                                 //citetitle |
+                                                 //city |
+                                                 //classname |
+                                                 //co |
+                                                 //code |
+                                                 //col |
+                                                 //colgroup |
+                                                 //collabname |
+                                                 //command |
+                                                 //computeroutput |
+                                                 //constant |
+                                                 //constraint |
+                                                 //contrib |
+                                                 //country |
+                                                 //database |
+                                                 //date |
+                                                 //email |
+                                                 //emphasis |
+                                                 //envar |
+                                                 //errorcode |
+                                                 //errorname |
+                                                 //errortext |
+                                                 //errortype |
+                                                 //exceptionname |
+                                                 //fax |
+                                                 //filename |
+                                                 //firstname |
+                                                 //firstterm |
+                                                 //footnoteref |
+                                                 //foreignphrase |
+                                                 //funcdef |
+                                                 //funcparams |
+                                                 //function |
+                                                 //glossterm |
+                                                 //group |
+                                                 //guibutton |
+                                                 //guiicon |
+                                                 //guilabel |
+                                                 //guimenu |
+                                                 //guimenuitem |
+                                                 //guisubmenu |
+                                                 //hardware |
+                                                 //holder |
+                                                 //honorific |
+                                                 //imagedata |
+                                                 //imageobject |
+                                                 //imageobjectco |
+                                                 //initializer |
+                                                 //inlineequation |
+                                                 //inlinegraphic |
+                                                 //inlinemediaobject |
+                                                 //interface |
+                                                 //interfacename |
+                                                 //jobtitle |
+                                                 //keycap |
+                                                 //keycode |
+                                                 //keycombo |
+                                                 //keysym |
+                                                 //lhs |
+                                                 //lineage |
+                                                 //lineannotation |
+                                                 //link |
+                                                 //literal |
+                                                 //markup |
+                                                 //medialabel |
+                                                 //menuchoice |
+                                                 //methodname |
+                                                 //methodparam |
+                                                 //modifier |
+                                                 //mousebutton |
+                                                 //nonterminal |
+                                                 //olink |
+                                                 //ooclass |
+                                                 //ooexception |
+                                                 //oointerface |
+                                                 //option |
+                                                 //optional |
+                                                 //orgdiv |
+                                                 //orgname |
+                                                 //otheraddr |
+                                                 //othername |
+                                                 //package |
+                                                 //paramdef |
+                                                 //parameter |
+                                                 //personname |
+                                                 //phone |
+                                                 //phrase |
+                                                 //pob |
+                                                 //postcode |
+                                                 //productname |
+                                                 //productnumber |
+                                                 //prompt |
+                                                 //property |
+                                                 //quote |
+                                                 //replaceable |
+                                                 //returnvalue |
+                                                 //revnumber |
+                                                 //revremark |
+                                                 //rhs |
+                                                 //sbr |
+                                                 //sgmltag |
+                                                 //shortaffil |
+                                                 //shortcut |
+                                                 //state |
+                                                 //street |
+                                                 //structfield |
+                                                 //structname |
+                                                 //subscript |
+                                                 //superscript |
+                                                 //surname |
+                                                 //symbol |
+                                                 //systemitem |
+                                                 //termdef |
+                                                 //textobject |
+                                                 //token |
+                                                 //trademark |
+                                                 //type |
+                                                 //ulink |
+                                                 //uri |
+                                                 //userinput |
+                                                 //varargs |
+                                                 //varname |
+                                                 //videodata |
+                                                 //videoobject |
+                                                 //void |
+                                                 //wordasword |
+                                                 //xref |
+                                                 //year "/>
+
+  <!-- Mark footnotes nested, though itstool treats it as "no" -->
+  <its:withinTextRule withinText="nested" selector="//footnote"/>
+
+  <!-- Things with (semi-)structured content -->
+  <its:withinTextRule withinText="no" selector="//confgroup/* | //biblioentry/* | //biblioset/*"/>
+  <its:withinTextRule withinText="yes" selector="//bibliomixed/* | //bibliomset/*"/>
+  <its:withinTextRule withinText="no" selector="//glossentry/*"/>
+  <its:withinTextRule withinText="yes" selector="//indexterm//* |
+                                                 //simplelist[@type = 'inline']/descendant-or-self::*"/>
+
+  <!--
+  We want to break address off into a translation unit because it's
+  supposed to be space-preserving. But because of DocBook wonkiness,
+  address is often just used to provide an email address. In that
+  particular case, just ignore the fact that it's supposed to be a
+  space-preserving translation unit.
+  -->
+  <its:withinTextRule withinText="yes" selector="//address[count(*) = 1 and email]"/>
+  <its:preserveSpaceRule space="preserve" selector="//address[not(count(*) = 1 and email)]"/>
+
+  <!-- Above all else, info is not a text run -->
+  <its:withinTextRule withinText="no" selector="//bookinfo/* | //chapterinfo/* | //articleinfo/* | //refentryinfo/*"/>
+
+  <!-- These are always verbatim -->
+  <its:preserveSpaceRule space="preserve" selector="//classsynopsisinfo |
+                                                    //funcsynopsisinfo |
+                                                    //literallayout |
+                                                    //programlisting |
+                                                    //screen |
+                                                    //synopsis "/>
+
+  <!-- Drop editor remarks -->
+  <its:localeFilterRule localeFilterList="" selector="//remark"/>
+
+  <!-- External media files -->
+  <its:externalResourceRefRule externalResourceRefPointer="@fileref"
+                               selector="//audiodata | //imagedata | //videodata"/>
+
+  <!-- Some hacks -->
+  <its:translateRule translate="no" selector="//releaseinfo[@role = 'CVS' and normalize-space(.) = '$Id$']"/>
+</its:rules>
diff --git a/man/po/its/docbook.loc b/man/po/its/docbook.loc
new file mode 100644
index 0000000..3b7b82b
--- /dev/null
+++ b/man/po/its/docbook.loc
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<locatingRules>
+  <locatingRule name="DocBook" pattern="*.xml">
+    <documentRule localName="refentry" target="docbook.its"/>
+  </locatingRule>
+</locatingRules>
diff --git a/po/Makevars b/po/Makevars
index c2b35f8..1620706 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -20,12 +20,59 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-location
 # their copyright.
 COPYRIGHT_HOLDER = Free Software Foundation, Inc.
 
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty.  If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT)
+
 # This is the list of locale categories, beyond LC_MESSAGES, for which the
 # message catalogs shall be used.  It is usually empty.
 EXTRA_LOCALE_CATEGORIES =
 
-MSGID_BUGS_ADDRESS = pkg-shadow-de...@lists.alioth.debian.org
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS = --previous --no-location --quiet
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
 
-MSGMERGE += --previous
-MSGMERGE_UPDATE += --previous
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
 
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
-- 
2.15.0

Reply via email to