2010-02-20 09:41:49 -05:00
|
|
|
#
|
2011-01-20 16:46:56 -05:00
|
|
|
# Copyright (c) 2010-2011 Todd C. Miller <Todd.Miller@courtesan.com>
|
2010-02-20 09:41:49 -05:00
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and distribute this software for any
|
|
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
|
2010-04-23 23:15:31 -04:00
|
|
|
srcdir = @srcdir@
|
|
|
|
devdir = @devdir@
|
|
|
|
top_builddir = @top_builddir@
|
|
|
|
top_srcdir = @top_srcdir@
|
|
|
|
|
2010-07-13 08:33:46 -04:00
|
|
|
# Installation paths for package building
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
bindir = @bindir@
|
|
|
|
sbindir = @sbindir@
|
|
|
|
sysconfdir = @sysconfdir@
|
|
|
|
libexecdir = @libexecdir@
|
|
|
|
includedir = @includedir@
|
|
|
|
datarootdir = @datarootdir@
|
2011-05-27 10:17:34 -04:00
|
|
|
localedir = @localedir@
|
2011-02-19 08:29:21 -05:00
|
|
|
localstatedir = @localstatedir@
|
2010-07-13 08:33:46 -04:00
|
|
|
docdir = @docdir@
|
|
|
|
mandir = @mandir@
|
|
|
|
timedir = @timedir@
|
|
|
|
|
2011-06-04 18:27:13 -04:00
|
|
|
# User and group ids the installed files should be "owned" by
|
|
|
|
install_uid = 0
|
|
|
|
install_gid = 0
|
|
|
|
|
2010-07-13 08:33:46 -04:00
|
|
|
# sudoers owner and mode for package building
|
|
|
|
sudoersdir = $(sysconfdir)
|
|
|
|
sudoers_uid = @SUDOERS_UID@
|
|
|
|
sudoers_gid = @SUDOERS_GID@
|
|
|
|
sudoers_mode = @SUDOERS_MODE@
|
|
|
|
|
2010-10-28 11:17:40 -04:00
|
|
|
SUBDIRS = compat common @ZLIB_SRC@ plugins/sudoers src include doc
|
2010-07-07 11:09:41 -04:00
|
|
|
|
|
|
|
SAMPLES = plugins/sample plugins/sample_group
|
2010-02-20 09:41:49 -05:00
|
|
|
|
2010-04-23 23:15:31 -04:00
|
|
|
VERSION = @PACKAGE_VERSION@
|
2010-07-13 08:33:46 -04:00
|
|
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
2010-04-23 23:15:31 -04:00
|
|
|
|
2010-05-21 17:59:47 -04:00
|
|
|
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
|
|
|
|
2010-05-21 21:29:44 -04:00
|
|
|
SHELL = @SHELL@
|
2010-05-21 17:59:47 -04:00
|
|
|
|
2011-06-04 18:27:13 -04:00
|
|
|
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
|
|
|
|
|
|
|
|
ECHO_N = @ECHO_N@
|
|
|
|
ECHO_C = @ECHO_C@
|
|
|
|
|
|
|
|
# Message catalog support
|
2011-06-18 13:11:27 -04:00
|
|
|
NLS = @SUDO_NLS@
|
2011-06-04 18:27:13 -04:00
|
|
|
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
|
|
|
|
|
2011-03-10 10:32:23 -05:00
|
|
|
all: config.status
|
2011-04-06 15:32:04 -04:00
|
|
|
for d in $(SUBDIRS) $(SAMPLES); \
|
|
|
|
do (cd $$d && exec $(MAKE) $@) && continue; \
|
|
|
|
exit $$?; \
|
|
|
|
done
|
2011-03-10 10:32:23 -05:00
|
|
|
|
2011-06-04 18:27:13 -04:00
|
|
|
check pre-install: config.status
|
2011-04-06 15:32:04 -04:00
|
|
|
for d in $(SUBDIRS); \
|
|
|
|
do (cd $$d && exec $(MAKE) $@) && continue; \
|
|
|
|
exit $$?; \
|
|
|
|
done
|
2010-07-14 14:23:43 -04:00
|
|
|
|
2011-06-06 14:40:42 -04:00
|
|
|
install-dirs install-binaries install-includes install-plugin: config.status pre-install
|
2011-04-06 15:32:04 -04:00
|
|
|
for d in $(SUBDIRS); \
|
|
|
|
do (cd $$d && exec $(MAKE) $@) && continue; \
|
|
|
|
exit $$?; \
|
|
|
|
done
|
2011-03-29 15:20:32 -04:00
|
|
|
|
2011-06-18 13:11:27 -04:00
|
|
|
install-doc: config.status ChangeLog
|
2011-04-06 15:32:04 -04:00
|
|
|
for d in $(SUBDIRS); \
|
|
|
|
do (cd $$d && exec $(MAKE) $@) && continue; \
|
|
|
|
exit $$?; \
|
|
|
|
done
|
2010-02-21 16:12:01 -05:00
|
|
|
|
2011-06-18 13:11:27 -04:00
|
|
|
install: config.status pre-install install-nls
|
2011-06-06 14:40:42 -04:00
|
|
|
for d in $(SUBDIRS); \
|
|
|
|
do (cd $$d && exec $(MAKE) $@) && continue; \
|
|
|
|
exit $$?; \
|
|
|
|
done
|
2011-06-18 13:11:27 -04:00
|
|
|
|
|
|
|
uninstall: uninstall-nls
|
|
|
|
for d in $(SUBDIRS); \
|
|
|
|
do (cd $$d && exec $(MAKE) $@) && continue; \
|
|
|
|
exit $$?; \
|
|
|
|
done
|
|
|
|
|
|
|
|
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; \
|
2011-06-06 14:40:42 -04:00
|
|
|
done; \
|
2011-06-18 13:11:27 -04:00
|
|
|
done
|
2011-06-06 14:40:42 -04:00
|
|
|
|
2010-05-21 17:59:47 -04:00
|
|
|
autoconf:
|
|
|
|
autoconf -I m4
|
|
|
|
|
2011-05-26 12:12:43 -04:00
|
|
|
siglist.c:
|
|
|
|
(cd compat && exec $(MAKE) $@)
|
|
|
|
|
|
|
|
depend: siglist.c
|
2011-05-25 10:07:20 -04:00
|
|
|
@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/sudoers/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/sudoers/Makefile \
|
|
|
|
--file $(srcdir)/src/Makefile --file $(srcdir)/zlib/Makefile
|
2011-05-25 09:02:25 -04:00
|
|
|
|
2010-02-27 12:37:49 -05:00
|
|
|
ChangeLog:
|
2010-10-12 09:36:01 -04:00
|
|
|
if test -d $(srcdir)/.hg && cd $(srcdir); then \
|
|
|
|
if hg log --style=changelog -b default > $@.tmp; then \
|
2011-01-04 13:48:50 -05:00
|
|
|
mv -f $@.tmp $@; \
|
2010-10-12 09:36:01 -04:00
|
|
|
else \
|
|
|
|
rm -f $@.tmp; \
|
|
|
|
fi; \
|
|
|
|
fi
|
2010-02-27 12:37:49 -05:00
|
|
|
|
2010-02-21 16:12:01 -05:00
|
|
|
config.status:
|
2010-02-20 09:41:49 -05:00
|
|
|
@if [ ! -s config.status ]; then \
|
|
|
|
echo "Please run configure first"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2010-02-21 16:12:01 -05:00
|
|
|
|
2010-05-21 17:59:47 -04:00
|
|
|
libtool: $(LIBTOOL_DEPS)
|
2010-05-21 18:41:18 -04:00
|
|
|
$(SHELL) ./config.status --recheck
|
2010-05-21 17:59:47 -04:00
|
|
|
|
2011-01-06 10:44:28 -05:00
|
|
|
Makefile: $(srcdir)/Makefile.in
|
|
|
|
./config.status --file Makefile
|
|
|
|
|
2011-05-27 12:52:47 -04:00
|
|
|
sync-po:
|
|
|
|
rsync -Lrtvz translationproject.org::tp/latest/sudo/ src/po/
|
|
|
|
rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/
|
|
|
|
|
2011-06-06 08:46:50 -04:00
|
|
|
update-pot:
|
2011-06-04 18:27:13 -04:00
|
|
|
@cd $(top_srcdir); \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
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";; \
|
2011-06-18 13:11:27 -04:00
|
|
|
*) echo unknown domain $$domain; continue;; \
|
2011-06-04 18:27:13 -04:00
|
|
|
esac; \
|
|
|
|
$(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles -o $$pot; \
|
2011-06-06 08:46:50 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
update-po: update-pot
|
|
|
|
@cd $(top_srcdir); \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
podir=`dirname $$pot`; \
|
2011-06-18 13:11:27 -04:00
|
|
|
for po in $$podir/*.po; do \
|
|
|
|
echo $(ECHO_N) "Updating $$po$(ECHO_C)"; \
|
|
|
|
$(MSGMERGE) --update $$po $$pot; \
|
|
|
|
$(MSGFMT) --output /dev/null --check-format $$po || exit 1; \
|
2011-06-04 18:27:13 -04:00
|
|
|
done; \
|
|
|
|
done
|
|
|
|
|
|
|
|
compile-po:
|
|
|
|
@cd $(top_srcdir); \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
podir=`dirname $$pot`; \
|
2011-06-18 13:11:27 -04:00
|
|
|
for po in $$podir/*.po; do \
|
|
|
|
mo=`echo $$po | sed 's/po$$/mo/'`; \
|
|
|
|
echo $(ECHO_N) "Compiling $$mo: $(ECHO_C)"; \
|
|
|
|
$(MSGFMT) --statistics -c -o $$mo $$po; \
|
2011-06-04 18:27:13 -04:00
|
|
|
done; \
|
|
|
|
done
|
|
|
|
|
|
|
|
install-nls:
|
2011-06-18 13:11:27 -04:00
|
|
|
@if test "$(NLS)" = "enabled"; then \
|
2011-06-04 18:27:13 -04:00
|
|
|
cd $(top_srcdir); \
|
|
|
|
for pot in $(POTFILES); do \
|
|
|
|
podir=`dirname $$pot`; \
|
|
|
|
domain=`basename $$pot .pot`; \
|
|
|
|
echo $(ECHO_N) "Installing $$domain message catalogs:$(ECHO_C)"; \
|
2011-06-18 13:11:27 -04:00
|
|
|
for mo in $$podir/*.mo; do \
|
|
|
|
lang=`basename $$mo .mo`; \
|
|
|
|
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; \
|
2011-06-04 18:27:13 -04:00
|
|
|
done; \
|
|
|
|
echo ""; \
|
|
|
|
done; \
|
|
|
|
fi
|
|
|
|
|
2010-04-23 23:15:31 -04:00
|
|
|
dist: ChangeLog $(srcdir)/MANIFEST
|
2010-07-13 08:33:46 -04:00
|
|
|
pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \
|
|
|
|
-f ../$(PACKAGE_TARNAME)-$(VERSION).tar \
|
2010-04-23 23:15:31 -04:00
|
|
|
`sed 's/[ ].*//' $(srcdir)/MANIFEST`
|
2010-07-13 08:33:46 -04:00
|
|
|
gzip -9f ../$(PACKAGE_TARNAME)-$(VERSION).tar
|
|
|
|
ls -l ../$(PACKAGE_TARNAME)-$(VERSION).tar.gz
|
|
|
|
|
|
|
|
package: sudo.pp
|
|
|
|
DESTDIR=`cd $(top_builddir) && pwd`/destdir; rm -rf $$DESTDIR; \
|
|
|
|
$(MAKE) install DESTDIR=$$DESTDIR && \
|
2010-07-26 11:15:50 -04:00
|
|
|
$(SHELL) $(srcdir)/pp $(PPFLAGS) \
|
2010-07-13 08:33:46 -04:00
|
|
|
--destdir=$$DESTDIR \
|
2010-07-22 13:47:32 -04:00
|
|
|
$(srcdir)/sudo.pp \
|
2010-07-13 08:33:46 -04:00
|
|
|
bindir=$(bindir) \
|
|
|
|
sbindir=$(sbindir) \
|
|
|
|
libexecdir=$(libexecdir) \
|
|
|
|
includedir=$(includedir) \
|
|
|
|
timedir=$(timedir) \
|
|
|
|
mandir=$(mandir) \
|
2011-05-27 10:17:34 -04:00
|
|
|
localedir=$(localedir) \
|
2010-07-13 08:33:46 -04:00
|
|
|
docdir=$(docdir) \
|
|
|
|
sysconfdir=$(sysconfdir) \
|
|
|
|
sudoersdir=$(sudoersdir) \
|
|
|
|
sudoers_uid=$(sudoers_uid) \
|
|
|
|
sudoers_gid=$(sudoers_gid) \
|
|
|
|
sudoers_mode=$(sudoers_mode) \
|
2010-07-26 11:15:50 -04:00
|
|
|
version=$(VERSION) $(PPVARS)
|
2010-04-23 23:15:31 -04:00
|
|
|
|
2010-02-21 16:12:01 -05:00
|
|
|
clean: config.status
|
2011-04-06 15:32:04 -04:00
|
|
|
for d in $(SUBDIRS) $(SAMPLES); do \
|
|
|
|
(cd $$d && exec $(MAKE) $@); \
|
|
|
|
done
|
2010-02-20 09:53:05 -05:00
|
|
|
|
2010-02-21 16:12:01 -05:00
|
|
|
mostlyclean: clean
|
|
|
|
|
|
|
|
distclean: config.status
|
2011-04-06 15:32:04 -04:00
|
|
|
for d in $(SUBDIRS) $(SAMPLES); do \
|
|
|
|
(cd $$d && exec $(MAKE) $@); \
|
|
|
|
done
|
2010-04-23 22:57:03 -04:00
|
|
|
-rm -rf Makefile pathnames.h config.h config.status config.cache \
|
2010-11-19 14:06:53 -05:00
|
|
|
config.log libtool stamp-* autom4te.cache
|
2010-02-20 09:53:05 -05:00
|
|
|
|
|
|
|
cleandir: distclean
|
|
|
|
|
|
|
|
clobber: distclean
|
|
|
|
|
|
|
|
realclean: distclean
|
2010-10-12 09:36:01 -04:00
|
|
|
|
|
|
|
.PHONY: ChangeLog
|