Linux Netfilter development
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: jengelh@inai.de, phil@nwl.cc
Subject: Re: [PATCH nft] build: disable --with-unitdir by default
Date: Wed, 27 Aug 2025 16:46:15 +0200	[thread overview]
Message-ID: <aK8aN4h2XsLnTdT6@calendula> (raw)
In-Reply-To: <20250827140214.645245-1-pablo@netfilter.org>

Hi,

Cc'ing Phil, Jan.

Excuse me my terse proposal description.

Extension: This is an alternative patch to disable --with-unitdir by
default, to address distcheck issue.

I wonder also if this is a more conservative approach, this should
integrate more seamlessly into existing pipelines while allowing
distributors to opt-in to use this.

But maybe I'm worrying too much and it is just fine to change defaults
for downstream packagers.

On Wed, Aug 27, 2025 at 04:02:14PM +0200, Pablo Neira Ayuso wrote:
> Same behaviour as in the original patch:
> 
>   --with-unitdir	auto-detects the systemd unit path.
>   --with-unitdir=PATH	uses the PATH
> 
> no --with-unitdir does not install the systemd unit path.
> 
> INSTALL description looks fine for what this does.
> 
> While at this, extend tests/build/ to cover for this new option.
> 
> Fixes: c4b17cf830510 ("tools: add a systemd unit for static rulesets")
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
>  configure.ac             | 29 +++++++++++++++++++++--------
>  tests/build/run-tests.sh |  2 +-
>  2 files changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 42708c9f2470..3a751cb054b9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -115,15 +115,22 @@ AC_CHECK_DECLS([getprotobyname_r, getprotobynumber_r, getservbyport_r], [], [],
>  ]])
>  
>  AC_ARG_WITH([unitdir],
> -	[AS_HELP_STRING([--with-unitdir=PATH], [Path to systemd service unit directory])],
> -	[unitdir="$withval"],
> +	[AS_HELP_STRING([--with-unitdir[=PATH]],
> +	[Path to systemd service unit directory, or omit PATH to auto-detect])],
>  	[
> -		unitdir=$("$PKG_CONFIG" systemd --variable systemdsystemunitdir 2>/dev/null)
> -		AS_IF([test -z "$unitdir"], [unitdir='${prefix}/lib/systemd/system'])
> -	])
> +		if test "x$withval" = "xyes"; then
> +			unitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd 2>/dev/null)
> +			AS_IF([test -z "$unitdir"], [unitdir='${prefix}/lib/systemd/system'])
> +		elif test "x$withval" = "xno"; then
> +			unitdir=""
> +		else
> +			unitdir="$withval"
> +		fi
> +	],
> +	[unitdir=""]
> +)
>  AC_SUBST([unitdir])
>  
> -
>  AC_CONFIG_FILES([					\
>  		Makefile				\
>  		libnftables.pc				\
> @@ -137,5 +144,11 @@ nft configuration:
>    use mini-gmp:			${with_mini_gmp}
>    enable man page:              ${enable_man_doc}
>    libxtables support:		${with_xtables}
> -  json output support:          ${with_json}
> -  systemd unit:			${unitdir}"
> +  json output support:          ${with_json}"
> +
> +if test "x$unitdir" != "x"; then
> +AC_SUBST([unitdir])
> +echo "  systemd unit:                 ${unitdir}"
> +else
> +echo "  systemd unit:                 no"
> +fi
> diff --git a/tests/build/run-tests.sh b/tests/build/run-tests.sh
> index 916df2e2fa8e..1d32d5d8afcb 100755
> --- a/tests/build/run-tests.sh
> +++ b/tests/build/run-tests.sh
> @@ -3,7 +3,7 @@
>  log_file="$(pwd)/tests.log"
>  dir=../..
>  argument=( --without-cli --with-cli=linenoise --with-cli=editline --enable-debug --with-mini-gmp
> -	   --enable-man-doc --with-xtables --with-json)
> +	   --enable-man-doc --with-xtables --with-json --with-unitdir --with-unidir=/lib/systemd/system)
>  ok=0
>  failed=0
>  
> -- 
> 2.30.2
> 
> 

  reply	other threads:[~2025-08-27 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27 14:02 [PATCH nft] build: disable --with-unitdir by default Pablo Neira Ayuso
2025-08-27 14:46 ` Pablo Neira Ayuso [this message]
2025-08-27 20:36   ` Pablo Neira Ayuso
2025-08-27 20:38   ` Phil Sutter
2025-08-29 15:43   ` Jeremy Sowden
2025-09-25 21:43     ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aK8aN4h2XsLnTdT6@calendula \
    --to=pablo@netfilter.org \
    --cc=jengelh@inai.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=phil@nwl.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox