]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
build: don't install ancillary files without systemd service file
authorJeremy Sowden <jeremy@azazel.net>
Wed, 17 Sep 2025 20:34:54 +0000 (21:34 +0100)
committerFlorian Westphal <fw@strlen.de>
Fri, 31 Oct 2025 11:37:40 +0000 (12:37 +0100)
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 <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
Makefile.am
configure.ac

index fac7ad55cbe719e2c9f619dbb6303f36ba0c5887..bf1c3c443d40367b89f8b329d7a3c19c9d42beb4 100644 (file)
@@ -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 \
index a3ae2956cdf3ab585fa102809ea8ff523f3b8f1f..f3f6ad436bed68a28d84f010a2a23ff984d75746 100644 (file)
@@ -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])],