Move nls targets to the top level Makefile so the paths in

the pot file are saner
This commit is contained in:
Todd C. Miller
2011-06-04 18:27:13 -04:00
parent e8064e25dd
commit e66169b3ed
10 changed files with 78 additions and 148 deletions

View File

@@ -35,6 +35,10 @@ docdir = @docdir@
mandir = @mandir@
timedir = @timedir@
# User and group ids the installed files should be "owned" by
install_uid = 0
install_gid = 0
# sudoers owner and mode for package building
sudoersdir = $(sysconfdir)
sudoers_uid = @SUDOERS_UID@
@@ -52,19 +56,38 @@ LIBTOOL_DEPS = @LIBTOOL_DEPS@
SHELL = @SHELL@
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
ECHO_N = @ECHO_N@
ECHO_C = @ECHO_C@
# Message catalog support
LINGUAS = @LINGUAS@
POTFILES = src/po/sudo.pot plugins/sudoers/po/sudoers.pot
MSGFMT = msgfmt
MSGMERGE = msgmerge
XGETTEXT = xgettext
XGETTEXT_OPTS = -k_ -kN_ --copyright-holder="Todd C. Miller" \
"--msgid-bugs-address=http://www.sudo.ws/bugs" \
--package-name=@PACKAGE_NAME@ --package-version=$(VERSION) \
--flag warning:1:c-format --flag warningx:1:c-format \
--flag error:2:c-format --flag errorx:2:c-format \
--flag easprintf:3:c-format --flag lbuf_append:2:c-format \
--flag lbuf_append_quoted:3:c-format --foreign-user
all: config.status
for d in $(SUBDIRS) $(SAMPLES); \
do (cd $$d && exec $(MAKE) $@) && continue; \
exit $$?; \
done
check update-po compile-po pre-install: config.status
check pre-install: config.status
for d in $(SUBDIRS); \
do (cd $$d && exec $(MAKE) $@) && continue; \
exit $$?; \
done
install-dirs install-binaries install-includes install-plugin install-nls uninstall: config.status pre-install
install-dirs install-binaries install-includes install-plugin uninstall: config.status pre-install
for d in $(SUBDIRS); \
do (cd $$d && exec $(MAKE) $@) && continue; \
exit $$?; \
@@ -124,6 +147,57 @@ sync-po:
rsync -Lrtvz translationproject.org::tp/latest/sudo/ src/po/
rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/
update-po:
@cd $(top_srcdir); \
for pot in $(POTFILES); do \
echo "Updating $$pot"; \
podir=`dirname $$pot`; \
domain=`basename $$pot .pot`; \
case "$$domain" in \
sudo) cfiles="src/*c common/*c compat/*c";; \
sudoers) cfiles="plugins/sudoers/*.c plugins/sudoers/auth/*.c";; \
*) echo unknown domain $$domain continue;; \
esac; \
$(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles -o $$pot; \
set -- $(LINGUAS); \
while test $$# != 0; do \
echo $(ECHO_N) "Updating $$podir/$$1.po$(ECHO_C)"; \
$(MSGMERGE) --update $$podir/$$1.po $$pot; \
$(MSGFMT) --output /dev/null --check-format $$podir/$$1.po || exit 1; \
shift; \
done; \
done
compile-po:
@cd $(top_srcdir); \
for pot in $(POTFILES); do \
podir=`dirname $$pot`; \
set -- $(LINGUAS); \
while test $$# != 0; do \
echo $(ECHO_N) "Compiling $$podir/$$1.mo: $(ECHO_C)"; \
$(MSGFMT) --statistics -c -o $$podir/$$1.mo $$podir/$$1.po; \
shift; \
done; \
done
install-nls:
@if test -n "$(LINGUAS)"; then \
cd $(top_srcdir); \
for pot in $(POTFILES); do \
podir=`dirname $$pot`; \
domain=`basename $$pot .pot`; \
echo $(ECHO_N) "Installing $$domain message catalogs:$(ECHO_C)"; \
set -- $(LINGUAS); \
while test $$# != 0; do \
echo $(ECHO_N) " $$1$(ECHO_C)"; \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$1/LC_MESSAGES; \
$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $$podir/$$1.mo $(DESTDIR)$(localedir)/$$1/LC_MESSAGES/$$domain.mo; \
shift; \
done; \
echo ""; \
done; \
fi
dist: ChangeLog $(srcdir)/MANIFEST
pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \
-f ../$(PACKAGE_TARNAME)-$(VERSION).tar \

View File

@@ -58,10 +58,6 @@ Makefile: $(srcdir)/Makefile.in
libcommon.la: $(LTOBJS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(LTOBJS) -no-install
update-po:
compile-po:
pre-install:
install:
@@ -76,8 +72,6 @@ install-doc:
install-plugin:
install-nls:
uninstall:
check:

View File

@@ -79,10 +79,6 @@ globtest: globtest.o libreplace.la
@DEV@$(srcdir)/mksiglist.h: $(srcdir)/siglist.in
@DEV@ awk 'BEGIN {print "/* public domain */\n"} /^ [A-Z]/ {printf("#ifdef SIG%s\n if (my_sys_siglist[SIG%s] == NULL)\n\tmy_sys_siglist[SIG%s] = \"%s\";\n#endif\n", $$1, $$1, $$1, substr($$0, 13))}' < $(srcdir)/siglist.in > $@
update-po:
compile-po:
pre-install:
install:
@@ -97,8 +93,6 @@ install-doc:
install-plugin:
install-nls:
uninstall:
check: $(TEST_PROGS)

View File

@@ -142,10 +142,6 @@ HISTORY: $(srcdir)/history.pod
LICENSE: $(srcdir)/license.pod
pod2text -l -i0 $(srcdir)/license.pod | sed '1,2d' > $@
update-po:
compile-po:
pre-install:
install: install-dirs install-doc
@@ -173,8 +169,6 @@ install-doc: install-dirs
install-plugin:
install-nls:
uninstall:
-rm -rf $(DESTDIR)$(docdir)
-rm -f $(DESTDIR)$(mandirsu)/sudo.$(mansectsu) \

View File

@@ -47,10 +47,6 @@ Makefile: $(srcdir)/Makefile.in
.SUFFIXES: .h
update-po:
compile-po:
pre-install:
install: install-dirs install-includes
@@ -67,8 +63,6 @@ install-includes: install-dirs
install-plugin:
install-nls:
uninstall:
-rm -f $(DESTDIR)$(includedir)/sudo_plugin.h

View File

@@ -83,10 +83,6 @@ Makefile: $(srcdir)/Makefile.in
sample_plugin.la: $(OBJS)
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LTLDFLAGS) -o $@ $(OBJS) $(LIBS) -module -export-symbols $(srcdir)/sample_plugin.sym -avoid-version -rpath $(plugindir)
update-po:
compile-po:
pre-install:
install: install-dirs install-plugin
@@ -103,8 +99,6 @@ install-doc:
install-plugin: install-dirs sample_plugin.la
$(INSTALL) -b~ -M 0755 .libs/sample_plugin$(soext) $(DESTDIR)$(plugindir)
install-nls:
uninstall:
-rm -f $(DESTDIR)$(plugindir)/sample_plugin$(soext)

View File

@@ -83,10 +83,6 @@ Makefile: $(srcdir)/Makefile.in
sample_group.la: $(OBJS)
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LTLDFLAGS) -o $@ $(OBJS) $(LIBS) -module -export-symbols $(srcdir)/sample_group.sym -avoid-version -rpath $(plugindir)
update-po:
compile-po:
pre-install:
install: install-dirs install-plugin
@@ -103,8 +99,6 @@ install-doc:
install-plugin: install-dirs sample_group.la
$(INSTALL) -b~ -M 0755 .libs/sample_group$(soext) $(DESTDIR)$(plugindir)
install-nls:
uninstall:
-rm -f $(DESTDIR)$(plugindir)/sample_group$(soext)

View File

@@ -38,8 +38,6 @@ CC = @CC@
LIBTOOL = @LIBTOOL@
FLEX = @FLEX@
YACC = @YACC@
ECHO_N = @ECHO_N@
ECHO_C = @ECHO_C@
# Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
@@ -137,20 +135,6 @@ LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
VERSION = @PACKAGE_VERSION@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
# Message catalog support
LINGUAS = @LINGUAS@
POTFILE = $(srcdir)/po/sudoers.pot
MSGFMT = msgfmt
MSGMERGE = msgmerge
XGETTEXT = xgettext
XGETTEXT_OPTS = -k_ -kN_ -dsudoers --copyright-holder="Todd C. Miller" \
"--msgid-bugs-address=http://www.sudo.ws/bugs" \
--package-name=@PACKAGE_NAME@ --package-version=$(VERSION) \
--flag warning:1:c-format --flag warningx:1:c-format \
--flag error:2:c-format --flag errorx:2:c-format \
--flag easprintf:3:c-format --flag lbuf_append:2:c-format \
--flag lbuf_append_quoted:3:c-format --foreign-user
all: $(PROGS)
.SUFFIXES: .o .c .h .l .y .lo
@@ -226,34 +210,13 @@ $(devdir)/getdate.c: $(srcdir)/getdate.y
sudoers: $(srcdir)/sudoers.in
(cd $(top_builddir) && $(SHELL) config.status --file=plugins/sudoers/$@)
update-po:
@echo "Updating $(POTFILE)"; \
$(XGETTEXT) $(XGETTEXT_OPTS) $(srcdir)/*c $(srcdir)/auth/*c -o $(POTFILE)
@set -- $(LINGUAS); \
while test $$# != 0; do \
echo $(ECHO_N) "Updating \"$$1\" message catalog$(ECHO_C)"; \
$(MSGMERGE) --update $(srcdir)/po/$$1.po $(POTFILE); \
$(MSGFMT) --output /dev/null --check-format $(srcdir)/po/$$1.po || exit 1; \
shift; \
done
compile-po:
@if test -n "$(LINGUAS)"; then \
set -- $(LINGUAS); \
while test $$# != 0; do \
echo "Compiling \"$$1\" message catalog."; \
$(MSGFMT) --statistics -c -o $(srcdir)/po/$$1.mo $(srcdir)/po/$$1.po; \
shift; \
done; \
fi
pre-install:
@if test -r $(DESTDIR)$(sudoersdir)/sudoers; then \
echo "Checking existing sudoers file for syntax errors."; \
./visudo -c -f $(DESTDIR)$(sudoersdir)/sudoers; \
fi
install: install-dirs install-plugin install-binaries install-sudoers install-doc install-nls
install: install-dirs install-plugin install-binaries install-sudoers install-doc
install-dirs:
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(plugindir) \
@@ -280,20 +243,6 @@ install-sudoers: install-dirs
$(INSTALL) -O $(sudoers_uid) -G $(sudoers_gid) -M $(sudoers_mode) \
sudoers $(DESTDIR)$(sudoersdir)/sudoers
install-nls:
@if test -n "$(LINGUAS)"; then \
echo $(ECHO_N) "Installing sudoers message catalogs:$(ECHO_C)"; \
fi; \
set -- $(LINGUAS); \
while test $$# != 0; do \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$1/LC_MESSAGES; \
$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $(srcdir)/po/$$1.mo $(DESTDIR)$(localedir)/$$1/LC_MESSAGES/sudoers.mo; \
shift; \
done; \
if test -n "$(LINGUAS)"; then \
echo ""; \
fi
uninstall:
-rm -f $(DESTDIR)$(plugindir)/sudoers$(soext)
-rm -f $(DESTDIR)$(replaydir)/sudoreplay

View File

@@ -28,8 +28,6 @@ incdir = $(top_srcdir)/include
# Compiler & tools to use
CC = @CC@
LIBTOOL = @LIBTOOL@ @LT_STATIC@
ECHO_N = @ECHO_N@
ECHO_C = @ECHO_C@
# Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
@@ -82,20 +80,6 @@ LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/
VERSION = @PACKAGE_VERSION@
# Message catalog support
LINGUAS = @LINGUAS@
POTFILE = $(srcdir)/po/sudo.pot
MSGFMT = msgfmt
MSGMERGE = msgmerge
XGETTEXT = xgettext
XGETTEXT_OPTS = -k_ -kN_ -dsudo --copyright-holder="Todd C. Miller" \
"--msgid-bugs-address=http://www.sudo.ws/bugs" \
--package-name=@PACKAGE_NAME@ --package-version=$(VERSION) \
--flag warning:1:c-format --flag warningx:1:c-format \
--flag error:2:c-format --flag errorx:2:c-format \
--flag easprintf:3:c-format --flag lbuf_append:2:c-format \
--flag lbuf_append_quoted:3:c-format --foreign-user
all: $(PROGS)
Makefile: $(srcdir)/Makefile.in
@@ -118,30 +102,9 @@ libsudo_noexec.la: sudo_noexec.lo
sesh: sesh.o
$(CC) -o $@ sesh.o
update-po:
@echo "Updating $(POTFILE)"; \
$(XGETTEXT) $(XGETTEXT_OPTS) $(top_srcdir)/src/*c $(top_srcdir)/common/*c $(top_srcdir)/compat/*c -o $(POTFILE)
@set -- $(LINGUAS); \
while test $$# != 0; do \
echo $(ECHO_N) "Updating \"$$1\" message catalog$(ECHO_C)"; \
$(MSGMERGE) --update $(srcdir)/po/$$1.po $(POTFILE); \
$(MSGFMT) --output /dev/null --check-format $(srcdir)/po/$$1.po || exit 1; \
shift; \
done
compile-po:
@if test -n "$(LINGUAS)"; then \
set -- $(LINGUAS); \
while test $$# != 0; do \
echo "Compiling \"$$1\" message catalog."; \
$(MSGFMT) --statistics -c -o $(srcdir)/po/$$1.mo $(srcdir)/po/$$1.po; \
shift; \
done; \
fi
pre-install:
install: install-dirs install-binaries @INSTALL_NOEXEC@ install-nls
install: install-dirs install-binaries @INSTALL_NOEXEC@
install-dirs:
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
@@ -164,20 +127,6 @@ install-noexec: install-dirs libsudo_noexec.la
install-plugin:
install-nls:
@if test -n "$(LINGUAS)"; then \
echo $(ECHO_N) "Installing sudo message catalogs:$(ECHO_C)"; \
fi; \
set -- $(LINGUAS); \
while test $$# != 0; do \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$1/LC_MESSAGES; \
$(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $(srcdir)/po/$$1.mo $(DESTDIR)$(localedir)/$$1/LC_MESSAGES/sudo.mo; \
shift; \
done; \
if test -n "$(LINGUAS)"; then \
echo ""; \
fi
uninstall:
-rm -f $(DESTDIR)$(bindir)/sudo $(DESTDIR)$(bindir)/sudoedit \
$(DESTDIR)$(libexecdir)/sesh \

View File

@@ -57,10 +57,6 @@ Makefile: $(srcdir)/Makefile.in
libz.la: $(LTOBJS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(LTOBJS) -no-install
update-po:
compile-po:
pre-install:
install:
@@ -75,8 +71,6 @@ install-doc:
install-plugin:
install-nls:
uninstall:
check: