summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Ringle <jringle@gridpoint.com>2014-10-12 00:27:19 -0400
committerMichael Olbrich <m.olbrich@pengutronix.de>2014-10-12 22:48:14 +0200
commit09135995648375b1a19bad8419fa59c2f459bd6a (patch)
tree6f44d9a71d68a05bfa82b184d09015cacc383574
parentb6d737df17d23c1856549473dd870ce2f15cba18 (diff)
downloadptxdist-09135995648375b1a19bad8419fa59c2f459bd6a.tar.gz
ptxdist-09135995648375b1a19bad8419fa59c2f459bd6a.tar.xz
libcap: option to install setcap/getcap
Signed-off-by: Jon Ringle <jringle@gridpoint.com> [mol: whitespace changes] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--rules/libcap.in14
-rw-r--r--rules/libcap.make14
2 files changed, 23 insertions, 5 deletions
diff --git a/rules/libcap.in b/rules/libcap.in
index c82065807..f7f1fcc60 100644
--- a/rules/libcap.in
+++ b/rules/libcap.in
@@ -1,7 +1,17 @@
## SECTION=system_libraries
-config LIBCAP
+menuconfig LIBCAP
tristate
- prompt "libcap"
+ prompt "libcap "
+ select ATTR if LIBCAP_SETCAP
+ select ATTR_SHARED if LIBCAP_SETCAP
help
A library for getting and setting POSIX.1e capabilities.
+
+if LIBCAP
+
+config LIBCAP_SETCAP
+ bool
+ prompt "Install setcap/getcap"
+
+endif
diff --git a/rules/libcap.make b/rules/libcap.make
index 666d8c2c0..406fa25b8 100644
--- a/rules/libcap.make
+++ b/rules/libcap.make
@@ -32,11 +32,16 @@ LIBCAP_LICENSE := BSD, GPL
# ----------------------------------------------------------------------------
LIBCAP_MAKE_OPT := \
- prefix= PAM_CAP=no DYNAMIC=yes LIBATTR=no lib=lib \
+ prefix= PAM_CAP=no DYNAMIC=yes \
+ LIBATTR=$(call ptx/ifdef, PTXCONF_LIBCAP_SETCAP,yes,no) \
+ lib=lib \
CC=$(CROSS_CC) \
BUILD_CC=$(HOSTCC)
-LIBCAP_INSTALL_OPT := $(LIBCAP_MAKE_OPT) install
+LIBCAP_INSTALL_OPT := \
+ $(LIBCAP_MAKE_OPT) \
+ RAISE_SETFCAP=no \
+ install
# ----------------------------------------------------------------------------
# Target-Install
@@ -54,7 +59,10 @@ $(STATEDIR)/libcap.targetinstall:
@$(call install_copy, libcap, 0, 0, 0755, -, /sbin/getpcaps)
@$(call install_copy, libcap, 0, 0, 0755, -, /sbin/capsh)
@$(call install_lib, libcap, 0, 0, 0644, libcap)
-
+ifdef PTXCONF_LIBCAP_SETCAP
+ @$(call install_copy, libcap, 0, 0, 0755, -, /sbin/setcap)
+ @$(call install_copy, libcap, 0, 0, 0755, -, /sbin/getcap)
+endif
@$(call install_finish, libcap)
@$(call touch)