Description: build-sys: Make setcap really optional
Author: Michael Weiss <dev.primeos@gmail.com>
Origin: upstream, https://github.com/iputils/iputils/commit/473be6467f995865244e7e68b2fa587a4ee79551
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931491
Last-Update: 2019-07-07
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: iputils/meson.build
===================================================================
--- iputils.orig/meson.build
+++ iputils/meson.build
@@ -221,10 +221,13 @@ config_h = configure_file(
 setcap = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
 if get_option('NO_SETCAP_OR_SUID')
 	perm_type = 'none'
+	setcap_path = '/dev/null'
 elif cap_dep.found() and setcap.found()
 	perm_type = 'caps'
+	setcap_path = setcap.path()
 else
 	perm_type = 'setuid'
+	setcap_path = '/dev/null'
 endif
 
 ############################################################
@@ -243,7 +246,7 @@ if build_ping == true
 		join_paths(get_option('prefix'), get_option('bindir')),
 		'ping',
 		perm_type,
-		setcap.path()
+		setcap_path
 	)
 endif
 
@@ -263,7 +266,7 @@ if build_traceroute6 == true
 		join_paths(get_option('prefix'), get_option('bindir')),
 		'traceroute6',
 		perm_type,
-		setcap.path()
+		setcap_path
 	)
 endif
 
@@ -276,7 +279,7 @@ if build_clockdiff == true
 		join_paths(get_option('prefix'), get_option('bindir')),
 		'clockdiff',
 		perm_type,
-		setcap.path()
+		setcap_path
 	)
 endif
 
@@ -306,7 +309,7 @@ if build_arping == true
 		join_paths(get_option('prefix'), get_option('bindir')),
 		'arping',
 		perm_type,
-		setcap.path()
+		setcap_path
 	)
 endif
 
