From: Jeremy Sowden Date: Wed, 17 Sep 2025 20:34:54 +0000 (+0100) Subject: build: don't install ancillary files without systemd service file X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31007975ccf5a389b76e1bc6f5f7215847f394ef;p=thirdparty%2Fnftables.git build: don't install ancillary files without systemd service file 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 Signed-off-by: Florian Westphal --- diff --git a/Makefile.am b/Makefile.am index fac7ad55..bf1c3c44 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 a3ae2956..f3f6ad43 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])],