#
-# Copyright (c) 2010-2011 Todd C. Miller <Todd.Miller@courtesan.com>
+# Copyright (c) 2010-2013 Todd C. Miller <Todd.Miller@courtesan.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
sudoers_uid = @SUDOERS_UID@
sudoers_gid = @SUDOERS_GID@
sudoers_mode = @SUDOERS_MODE@
+shlib_mode = @SHLIB_MODE@
-SUBDIRS = compat common @ZLIB_SRC@ plugins/sudoers src include doc
+SUBDIRS = compat common @ZLIB_SRC@ plugins/group_file plugins/sudoers \
+ plugins/system_group src include doc
-SAMPLES = plugins/sample plugins/sample_group
+SAMPLES = plugins/sample
VERSION = @PACKAGE_VERSION@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
# Message catalog support
NLS = @SUDO_NLS@
POTFILES = src/po/sudo.pot plugins/sudoers/po/sudoers.pot
+LOCALEDIR_SUFFIX = @LOCALEDIR_SUFFIX@
MSGFMT = msgfmt
MSGMERGE = msgmerge
XGETTEXT = xgettext
-XGETTEXT_OPTS = -k_ -kN_ --copyright-holder="Todd C. Miller" \
+XGETTEXT_OPTS = -F -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 fatal:1:c-format --flag fatalx:1: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); \
+ for d in $(SUBDIRS); \
do (cd $$d && exec $(MAKE) $@) && continue; \
exit $$?; \
done
exit $$?; \
done
-install: config.status pre-install install-nls
+install: config.status ChangeLog pre-install install-nls
for d in $(SUBDIRS); \
do (cd $$d && exec $(MAKE) $@) && continue; \
exit $$?; \
uninstall-nls:
for pot in $(POTFILES); do \
domain=`basename $$pot .pot`; \
- podir=`dirname $$pot`; \
- for po in $$podir/*.po; do \
- lang=`basename $$po .po`; \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo; \
- done; \
+ rm -f $(DESTDIR)$(localedir)/*/LC_MESSAGES/$$domain.mo; \
done
-autoconf:
- autoconf -I m4
-
-siglist.c:
+siglist.c signame.c:
(cd compat && exec $(MAKE) $@)
-depend: siglist.c
+depend: siglist.c signame.c
@if test "$(srcdir)" != "."; then \
echo "make depend only supported in the source directory"; \
exit 1; \
fi; \
$(srcdir)/mkdep.pl $(srcdir)/common/Makefile.in \
$(srcdir)/compat/Makefile.in $(srcdir)/plugins/sample/Makefile.in \
- $(srcdir)/plugins/sample_group/Makefile.in \
+ $(srcdir)/plugins/group_file/Makefile.in \
$(srcdir)/plugins/sudoers/Makefile.in \
+ $(srcdir)/plugins/system_group/Makefile.in \
$(srcdir)/src/Makefile.in $(srcdir)/zlib/Makefile.in; \
./config.status --file $(srcdir)/common/Makefile \
--file $(srcdir)/compat/Makefile \
--file $(srcdir)/plugins/sample/Makefile \
- --file $(srcdir)/plugins/sample_group/Makefile \
+ --file $(srcdir)/plugins/group_file/Makefile \
--file $(srcdir)/plugins/sudoers/Makefile \
+ --file $(srcdir)/plugins/system_group/Makefile \
--file $(srcdir)/src/Makefile --file $(srcdir)/zlib/Makefile
-# The 1.8 branch started February 25, 2011
ChangeLog:
if test -d $(srcdir)/.hg && cd $(srcdir); then \
- if hg log --style=changelog -b 1.8 > $@.tmp && hg log --style=changelog -b default --date '<2011-02-25 21:30:00' >> $@.tmp; then \
+ if hg log --style=changelog -b default > $@.tmp; then \
mv -f $@.tmp $@; \
else \
rm -f $@.tmp; \
Makefile: $(srcdir)/Makefile.in
./config.status --file Makefile
-sync-po:
+sync-po: rsync-po compile-po
+
+rsync-po:
rsync -Lrtvz translationproject.org::tp/latest/sudo/ src/po/
rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/
echo "Updating $$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";; \
+ sudo) tmpfiles=; cfiles="src/*c common/*c compat/*c";; \
+ sudoers) \
+ echo "syntax error" > confstr.sh; \
+ sed -n -e 's/^badpass_message="/gettext "/p' \
+ -e 's/^passprompt="/gettext "/p' \
+ -e 's/^mailsub="/gettext "/p' configure.in \
+ >> confstr.sh; \
+ tmpfiles=confstr.sh; \
+ cfiles="plugins/sudoers/*.c plugins/sudoers/auth/*.c";; \
*) echo unknown domain $$domain; continue;; \
esac; \
- $(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles -o $$pot.tmp; \
- if diff -I'^.POT-Creation-Date' $$pot.tmp $$pot >/dev/null; then \
+ $(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles $$tmpfiles -o $$pot.tmp; \
+ test -n "$$tmpfiles" && rm -f $$tmpfiles; \
+ if diff -I'^.POT-Creation-Date' -I'^.Project-Id-Version' -I'^#' $$pot.tmp $$pot >/dev/null; then \
rm -f $$pot.tmp; \
else \
- mv -f $$pot.tmp $$pot; \
+ printf '/^#$$/+1,$$d\nw\nq\n' | ed - $$pot; \
+ sed '1,/^#$$/d' $$pot.tmp >> $$pot; \
+ rm -f $$pot.tmp; \
fi; \
done; \
fi
for pot in $(POTFILES); do \
podir=`dirname $$pot`; \
domain=`basename $$pot .pot`; \
+ SUDO_LINGUAS=$${LINGUAS-"`echo $$podir/*.mo|sed 's:'$$podir'/\([^ ]*\).mo:\1:g'`"}; \
echo $(ECHO_N) "Installing $$domain message catalogs:$(ECHO_C)"; \
- for mo in $$podir/*.mo; do \
- lang=`basename $$mo .mo`; \
+ for lang in $$SUDO_LINGUAS; do \
+ test -s $$podir/$$lang.mo || continue; \
echo $(ECHO_N) " $$lang$(ECHO_C)"; \
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES; \
- $(INSTALL) -O $(install_uid) -G $(install_gid) -M 0644 $$mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo; \
+ if test -n "$(LOCALEDIR_SUFFIX)"; then \
+ if test ! -d $(DESTDIR)$(localedir)/$$lang$(LOCALEDIR_SUFFIX); then \
+ ln -s $$lang $(DESTDIR)$(localedir)/$$lang$(LOCALEDIR_SUFFIX); \
+ fi; \
+ fi; \
+ $(INSTALL) -O $(install_uid) -G $(install_gid) -m 0644 $$podir/$$lang.mo $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$domain.mo; \
done; \
echo ""; \
done; \
check-dist: update-pot compile-po
@if [ -d .hg ]; then \
- if hg stat -am | grep '\.[mp]ot*$$'; then \
- echo "Uncommitted message catalog changes" 1>&2; \
- false; \
+ if test `hg stat -am | wc -l` -ne 0; then \
+ echo "Uncommitted changes" 1>&2; \
+ hg stat -am 1>&2; \
+ exit 1; \
fi; \
fi
-dist: check-dist ChangeLog $(srcdir)/MANIFEST
+dist: check-dist force-dist
+
+force-dist: ChangeLog $(srcdir)/MANIFEST
pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \
-f ../$(PACKAGE_TARNAME)-$(VERSION).tar \
`sed 's/[ ].*//' $(srcdir)/MANIFEST`
sudoers_uid=$(sudoers_uid) \
sudoers_gid=$(sudoers_gid) \
sudoers_mode=$(sudoers_mode) \
+ shlib_mode=$(shlib_mode) \
version=$(VERSION) $(PPVARS)
clean: config.status
realclean: distclean
-.PHONY: ChangeLog
+me:
+
+a:
+
+sandwich:
+ @if test -n "$$SUDO_USER"; then \
+ echo "Okay."; \
+ else \
+ echo "What? Make it yourself!"; \
+ fi
+
+.PHONY: ChangeLog me a sandwhich