docker-engine: new package
[buildroot-gz.git] / package / libcap / libcap.mk
blobbcb5d8cedb6591f13a674536665ccf657ec7a990
1 ################################################################################
3 # libcap
5 ################################################################################
7 LIBCAP_VERSION = 2.25
8 LIBCAP_SITE = https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2
9 LIBCAP_SOURCE = libcap-$(LIBCAP_VERSION).tar.xz
10 LIBCAP_LICENSE = GPLv2 or BSD-3c
11 LIBCAP_LICENSE_FILES = License
13 LIBCAP_DEPENDENCIES = host-libcap host-gperf
14 LIBCAP_INSTALL_STAGING = YES
16 HOST_LIBCAP_DEPENDENCIES = host-gperf
18 ifeq ($(BR2_STATIC_LIBS),y)
19 LIBCAP_MAKE_TARGET = libcap.a libcap.pc
20 LIBCAP_MAKE_INSTALL_TARGET = install-static
21 else
22 LIBCAP_MAKE_TARGET = all
23 LIBCAP_MAKE_INSTALL_TARGET = install
24 endif
26 LIBCAP_MAKE_FLAGS = \
27 BUILD_CC="$(HOSTCC)" \
28 BUILD_CFLAGS="$(HOST_CFLAGS)"
30 ifeq ($(BR2_PACKAGE_LIBCAP_TOOLS),y)
31 define LIBCAP_BUILD_TOOLS_CMDS
32 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/progs \
33 $(LIBCAP_MAKE_FLAGS)
34 endef
36 define LIBCAP_INSTALL_TOOLS_CMDS
37 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/progs \
38 RAISE_SETFCAP=no prefix=/usr \
39 DESTDIR=$(TARGET_DIR) $(LIBCAP_MAKE_FLAGS) install
40 endef
41 endif
43 define LIBCAP_BUILD_CMDS
44 $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/libcap \
45 $(LIBCAP_MAKE_FLAGS) $(LIBCAP_MAKE_TARGET)
46 $(LIBCAP_BUILD_TOOLS_CMDS)
47 endef
49 define LIBCAP_INSTALL_STAGING_CMDS
50 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap $(LIBCAP_MAKE_FLAGS) \
51 DESTDIR=$(STAGING_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
52 endef
54 define LIBCAP_INSTALL_TARGET_CMDS
55 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libcap $(LIBCAP_MAKE_FLAGS) \
56 DESTDIR=$(TARGET_DIR) prefix=/usr lib=lib $(LIBCAP_MAKE_INSTALL_TARGET)
57 $(LIBCAP_INSTALL_TOOLS_CMDS)
58 endef
60 define HOST_LIBCAP_BUILD_CMDS
61 $(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) $(MAKE) -C $(@D)\
62 RAISE_SETFCAP=no
63 endef
65 define HOST_LIBCAP_INSTALL_CMDS
66 $(HOST_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(HOST_DIR) \
67 RAISE_SETFCAP=no prefix=/usr lib=lib install
68 endef
70 $(eval $(generic-package))
71 $(eval $(host-generic-package))