+2007-11-25 Nicolas François <nicolas.francois@centraliens.net>
+
+ * configure.in, man/po/Makefile.in.in, man/po/Makevars,
+ man/po/POTFILES.in, man/Makefile.am: Generate the PO files for the
+ manpages in the man/po directory (instead of man/<lang>). Use a
+ Makefile.in.in based on gettext's one. This ensure that the PO are
+ generated before being used in the <lang> directories.
+ * man/generate_mans.mak, man/generate_translations.mak,
+ man/Makefile.am: New makefile for the generation of manpages from
+ XML (generate_mans.mak). This avoid duplicate chunks in
+ generate_translations.mak and Makefile.am
+ * man/de/de.po, man/fr/fr.po, man/it/it.po, man/pl/pl.po,
+ man/ru/ru.po, man/sv/sv.po: Moved to...
+ * man/po/de.po, man/po/fr.po, man/po/it.po, man/po/pl.po,
+ man/po/ru.po, man/po/sv.po: ... here.
+
2007-11-24 Nicolas François <nicolas.francois@centraliens.net>
* src/userdel.c, src/lastlog.c, src/newusers.c, src/chpasswd.c,
-LINGUAS = de fr it pl ru sv
-
# subdirectories for translated manual pages
-DIST_SUBDIRS = cs de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW
if USE_NLS
-SUBDIRS = $(DIST_SUBDIRS)
+SUBDIRS = po cs de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW
else
SUBDIRS =
endif
-man_XMANS = \
- chage.1.xml \
- chfn.1.xml \
- chgpasswd.8.xml \
- chpasswd.8.xml \
- chsh.1.xml \
- expiry.1.xml \
- faillog.5.xml \
- faillog.8.xml \
- gpasswd.1.xml \
- groupadd.8.xml \
- groupdel.8.xml \
- groupmems.8.xml \
- groupmod.8.xml \
- groups.1.xml \
- grpck.8.xml \
- gshadow.5.xml \
- lastlog.8.xml \
- limits.5.xml \
- login.1.xml \
- login.access.5.xml \
- login.defs.5.xml \
- logoutd.8.xml \
- newgrp.1.xml \
- newusers.8.xml \
- nologin.8.xml \
- passwd.1.xml \
- passwd.5.xml \
- porttime.5.xml \
- pwck.8.xml \
- pwconv.8.xml \
- shadow.3.xml \
- shadow.5.xml \
- sg.1.xml \
- su.1.xml \
- suauth.5.xml \
- useradd.8.xml \
- userdel.8.xml \
- usermod.8.xml \
- vipw.8.xml
-
man_MANS = \
- $(man_nopam) \
chage.1 \
chfn.1 \
chgpasswd.8 \
man_MANS += $(man_nopam)
endif
+man_XMANS = \
+ chage.1.xml \
+ chfn.1.xml \
+ chgpasswd.8.xml \
+ chpasswd.8.xml \
+ chsh.1.xml \
+ expiry.1.xml \
+ faillog.5.xml \
+ faillog.8.xml \
+ gpasswd.1.xml \
+ groupadd.8.xml \
+ groupdel.8.xml \
+ groupmems.8.xml \
+ groupmod.8.xml \
+ groups.1.xml \
+ grpck.8.xml \
+ gshadow.5.xml \
+ lastlog.8.xml \
+ limits.5.xml \
+ login.1.xml \
+ login.access.5.xml \
+ login.defs.5.xml \
+ logoutd.8.xml \
+ newgrp.1.xml \
+ newusers.8.xml \
+ nologin.8.xml \
+ passwd.1.xml \
+ passwd.5.xml \
+ porttime.5.xml \
+ pwck.8.xml \
+ pwconv.8.xml \
+ shadow.3.xml \
+ shadow.5.xml \
+ sg.1.xml \
+ su.1.xml \
+ suauth.5.xml \
+ useradd.8.xml \
+ userdel.8.xml \
+ usermod.8.xml \
+ vipw.8.xml
+
EXTRA_DIST = \
$(man_MANS) \
$(man_XMANS) \
id.1 \
id.1.xml \
sulogin.8 \
- sulogin.8.xml
+ sulogin.8.xml \
+ generate_mans.mak \
+ generate_translations.mak
if ENABLE_REGENERATE_MAN
-if USE_PAM
-PAM_COND=pam
-else
-PAM_COND=no_pam
-endif
-
-if SHADOWGRP
-SHADOWGRP_COND=gshadow
-else
-SHADOWGRP_COND=no_gshadow
-endif
-
-%: %.xml
- $(XSLTPROC) --stringparam profile.condition "$(PAM_COND);$(SHADOWGRP_COND)" \
- -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/profile-docbook.xsl $<
-
-grpconv.8 grpunconv.8 pwunconv.8: pwconv.8
-
-getspnam.3: shadow.3
-
-vigr.8: vipw.8
+include generate_mans.mak
CLEANFILES = $(man_MANS)
-POFILES = $(foreach lang, $(LINGUAS), $(lang)/$(lang).po)
-
-all: $(POFILES)
-
-$(POFILES): shadow-man-pages.pot
-
-shadow-man-pages.pot: $(man_XMANS)
-
-dist-hook: dist-po-files
-
-.PHONY: dist-po-files
-dist-po-files: $(POFILES) shadow-man-pages.pot
- @for lang in $(LINGUAS); do \
- echo " $(mkinstalldirs) $(distdir)/$$lang"; \
- $(mkinstalldirs) "$(distdir)/$$lang"; \
- done
- @for file in $(POFILES); do \
- echo "$(INSTALL_DATA) $(srcdir)/$$file $(distdir)/$$file"; \
- $(INSTALL_DATA) "$(srcdir)/$$file" "$(distdir)/$$file"; \
- done
- $(INSTALL_DATA) "$(srcdir)/shadow-man-pages.pot" "$(distdir)/shadow-man-pages.pot"
-
-shadow-man-pages.pot: $(man_XMANS)
- xml2po -o $@ $(man_XMANS)
-
-.PHONY: update-po
-update-po: shadow-man-pages.pot
- @for lang in $(LINGUAS); do \
- echo "$$lang:"; \
- echo "$(MSGMERGE) -o $$lang/$$lang.po $$lang/$$lang.po shadow-man-pages.pot"; \
- $(MSGMERGE) -o $$lang/$$lang.po $$lang/$$lang.po shadow-man-pages.pot; \
- done
-
else
$(man_MANS):
@echo ""
--- /dev/null
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@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
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(POFILES)
+
+POTFILES = \
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .sed .sin .nop .po-create .po-update
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+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: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ @tmpdir=`pwd`; \
+ echo -n "cd $(top_srcdir)/man && "; \
+ echo "xml2po -o $(tmpdir)/$(DOMAIN).po $(notdir $(POTFILES))"; \
+ cd $(top_srcdir)/man; \
+ xml2po -o $$tmpdir/$(DOMAIN).po $(notdir $(POTFILES)); \
+ 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
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES
+
+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; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ 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):
+
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && $(SHELL) ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# 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: