# Automake makefile for krb5-strength.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2016 Russ Allbery <eagle@eyrie.org>
-# Copyright 2007, 2009, 2010, 2012, 2013, 2014
+# Copyright 2016, 2020 Russ Allbery <eagle@eyrie.org>
+# Copyright 2007, 2009-2010, 2012-2014
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = .gitignore .travis.yml LICENSE bootstrap cracklib/HISTORY \
- cracklib/LICENCE cracklib/README cracklib/genrules.pl \
- cracklib/mkdict tests/HOWTO tests/TESTS tests/data/krb5.conf \
+EXTRA_DIST = .clang-format .github .gitignore README.md LICENSE bootstrap \
+ ci/README ci/install ci/test cracklib/HISTORY cracklib/LICENCE \
+ cracklib/README cracklib/genrules.pl cracklib/mkdict \
+ docs/krb5-strength.5.in docs/krb5-strength.pod docs/metadata \
+ tests/README tests/TESTS tests/data/krb5.conf \
tests/data/make-krb5-conf tests/data/passwords tests/data/perl.conf \
tests/data/perlcriticrc tests/data/perltidyrc \
tests/data/valgrind.supp tests/data/wordlist \
tests/data/wordlist.cdb tests/data/wordlist.sqlite \
tests/docs/pod-spelling-t tests/docs/pod-t tests/perl/critic-t \
tests/perl/minimum-version-t tests/perl/strict-t \
- tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm \
- tests/tap/perl/Test/RRA/Config.pm \
+ tests/style/obsolete-strings-t tests/tap/libtap.sh \
+ tests/tap/perl/Test/RRA.pm tests/tap/perl/Test/RRA/Config.pm \
tests/tap/perl/Test/RRA/Automake.pm tests/tools/heimdal-history-t \
tests/tools/heimdal-strength-t tests/tools/wordlist-cdb-t \
tests/tools/wordlist-sqlite-t tests/tools/wordlist-t \
# Man pages for all tools.
dist_man_MANS = tools/heimdal-history.1 tools/heimdal-strength.1 \
tools/krb5-strength-wordlist.1
+man_MANS = docs/krb5-strength.5
+
+# Substitute the installation paths into the manual page.
+docs/krb5-strength.5: $(srcdir)/docs/krb5-strength.5.in
+ [ -d docs ] || mkdir docs
+ sed -e 's%\(\\f(CI\)*\@moduledir\(\\fI\)*\@%$(moduledir)%' \
+ < $(srcdir)/docs/krb5-strength.5.in > $@
# Handle the standard stuff that make maintainer-clean should probably remove
# but doesn't. This breaks the GNU coding standard, but in this area the GNU
# coding standard is dumb.
-CLEANFILES = tests/data/dictionary.hwm tests/data/dictionary.pwd \
- tests/data/dictionary.pwi
+CLEANFILES = docs/krb5-strength.5 tests/data/dictionary.hwm \
+ tests/data/dictionary.pwd tests/data/dictionary.pwi
DISTCLEANFILES = tests/data/.placeholder
-MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile \
- build-aux/config.guess build-aux/config.sub build-aux/depcomp \
- build-aux/install-sh build-aux/ltmain.sh build-aux/missing \
- config.h.in config.h.in~ configure m4/libtool.m4 m4/ltoptions.m4 \
- m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 \
- tests/data/wordlist.cdb tests/data/wordlist.sqlite \
- tools/heimdal-history.1 tools/heimdal-strength.1 \
- tools/krb5-strength-wordlist.1
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile \
+ build-aux/config.guess build-aux/config.sub build-aux/depcomp \
+ build-aux/install-sh build-aux/ltmain.sh build-aux/missing \
+ config.h.in config.h.in~ configure docs/krb5-strength.5.in \
+ m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \
+ m4/lt~obsolete.m4 tests/data/wordlist.cdb \
+ tests/data/wordlist.sqlite tools/heimdal-history.1 \
+ tools/heimdal-strength.1 tools/krb5-strength-wordlist.1
# Also remove the generated *.c files from our JSON test data on
# maintainer-clean.
check-local: $(check_PROGRAMS) tests/data/dictionary.pwd
cd tests && ./runtests -l $(abs_top_srcdir)/tests/TESTS
+# Used by maintainers to check the source code with cppcheck.
+check-cppcheck:
+ cd $(abs_top_srcdir) && \
+ find . -name .git -prune -o -name '*.[ch]' -print \
+ | cppcheck -q --force --error-exitcode=2 --file-list=- \
+ --suppressions-list=tests/data/cppcheck.supp \
+ --enable=warning,performance,portability,style
+
# Used by maintainers to run the main test suite under valgrind. Suppress
# the xmalloc and pod-spelling tests because the former won't work properly
# under valgrind (due to increased memory usage) and the latter is pointless
check-valgrind: $(check_PROGRAMS) tests/data/dictionary.pwd
rm -rf $(abs_top_builddir)/tmp-valgrind
mkdir $(abs_top_builddir)/tmp-valgrind
- env RRA_MAINTAINER_TESTS= valgrind --leak-check=full \
+ env valgrind --leak-check=full \
--show-reachable=yes --trace-children=yes \
--log-file=$(abs_top_builddir)/tmp-valgrind/log.%p \
--suppressions=$(abs_top_srcdir)/tests/data/valgrind.supp \
--trace-children-skip="/bin/sh,*/cat,*/diff,*/expr,*/grep,*/mkdir,*/rm,*/rmdir,*/sed,*/sleep,*/true,*/wc,*/docs/*-t,*/perl/*-t,*/data/make-krb5-conf,*/tools/heimdal-history-t,*/tools/wordlist*-t" \
tests/runtests -l '$(abs_top_srcdir)/tests/TESTS'
+
+
+# Used by maintainers to reformat all source code using clang-format and
+# excluding some files.
+reformat:
+ find . -name '*.[ch]' \! -name snprintf.c \! -name krb5-profile.c \
+ \! -path './cracklib/*' -print \
+ | xargs clang-format-10 -style=file -i