If the systemd service file is not installed, currently the related man-page and example nft file are still installed. Instead only install them when the service file is installed. Fixes: 107580cfa85c ("build: disable --with-unitdir by default") Signed-off-by: Jeremy Sowden --- Makefile.am | 5 +++++ configure.ac | 1 + 2 files changed, 6 insertions(+) diff --git a/Makefile.am b/Makefile.am index fac7ad55cbe7..bf1c3c443d40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -421,10 +421,14 @@ EXTRA_DIST += \ tools/nftables.service.in \ $(NULL) +if BUILD_SERVICE CLEANFILES += tools/nftables.service +endif pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libnftables.pc + +if BUILD_SERVICE unit_DATA = tools/nftables.service man_MANS = tools/nftables.service.8 doc_DATA = files/nftables/main.nft @@ -432,6 +436,7 @@ doc_DATA = files/nftables/main.nft tools/nftables.service: tools/nftables.service.in ${top_builddir}/config.status ${AM_V_GEN}${MKDIR_P} tools ${AM_V_at}sed -e 's|@''sbindir''@|${sbindir}|g;s|@''pkgsysconfdir''@|${pkgsysconfdir}|g' <${srcdir}/tools/nftables.service.in >$@ +endif if !BUILD_DISTCHECK TESTS = tests/build/run-tests.sh \ diff --git a/configure.ac b/configure.ac index a3ae2956cdf3..f3f6ad436bed 100644 --- a/configure.ac +++ b/configure.ac @@ -130,6 +130,7 @@ AC_ARG_WITH([unitdir], [unitdir=""] ) AC_SUBST([unitdir]) +AM_CONDITIONAL([BUILD_SERVICE], [test "x$unitdir" != x]) AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release], [Stable release number])], -- 2.51.0