mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 22:44:27 -05:00 
			
		
		
		
	4f96e67 Up the release version to 2.66 60ff008 Fix typos in the cap_from_text.3 man page. 281b6e4 Add captrace to .gitignore file 09a2c1d Add an example of using BPF kprobing to trace capability use. 26e3a09 Clean up getpcaps code. fc804ac getpcaps: catch PID parsing errors. fc437fd Fix an issue with bash displaying an error. 7db9589 Some more simplifications for building 27e801b Fix for "make clean ; make -j48 test" Signed-off-by: Nick Hainke <vincent@systemli.org>
		
			
				
	
	
		
			118 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			118 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
#
 | 
						|
# This is free software, licensed under the GNU General Public License v2.
 | 
						|
# See /LICENSE for more information.
 | 
						|
#
 | 
						|
 | 
						|
include $(TOPDIR)/rules.mk
 | 
						|
 | 
						|
PKG_NAME:=libcap
 | 
						|
PKG_VERSION:=2.66
 | 
						|
PKG_RELEASE:=$(AUTORELEASE)
 | 
						|
 | 
						|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 | 
						|
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
 | 
						|
PKG_HASH:=15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2
 | 
						|
 | 
						|
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
 | 
						|
PKG_LICENSE:=GPL-2.0-only
 | 
						|
PKG_LICENSE_FILES:=License
 | 
						|
PKG_CPE_ID:=cpe:/a:libcap_project:libcap
 | 
						|
 | 
						|
PKG_INSTALL:=1
 | 
						|
PKG_BUILD_PARALLEL:=1
 | 
						|
 | 
						|
include $(INCLUDE_DIR)/package.mk
 | 
						|
include $(INCLUDE_DIR)/kernel.mk
 | 
						|
 | 
						|
define Package/libcap/Default
 | 
						|
  TITLE:=Linux capabilities library
 | 
						|
  SECTION:=libs
 | 
						|
  CATEGORY:=Libraries
 | 
						|
  URL:=https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap/description/Default
 | 
						|
  Linux capabilities
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap
 | 
						|
  $(call Package/libcap/Default)
 | 
						|
  TITLE += library
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap-bin
 | 
						|
  $(call Package/libcap/Default)
 | 
						|
  TITLE += binaries
 | 
						|
  DEPENDS += libcap
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap-bin/description
 | 
						|
  $(call Package/libcap/description/Default)
 | 
						|
  .
 | 
						|
  This package contains the libcap utilities.
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap-bin/config
 | 
						|
  if PACKAGE_libcap-bin
 | 
						|
  config PACKAGE_libcap-bin-capsh-shell
 | 
						|
    string "capsh shell"
 | 
						|
    help
 | 
						|
      Set the capsh shell.
 | 
						|
    default "/bin/sh"
 | 
						|
  endif
 | 
						|
endef
 | 
						|
 | 
						|
MAKE_FLAGS += \
 | 
						|
    BUILD_CC="$(CC)" \
 | 
						|
    BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \
 | 
						|
    CFLAGS="$(TARGET_CFLAGS)" \
 | 
						|
    LD="$(TARGET_CC) -Wl,-x -shared" \
 | 
						|
    LDFLAGS="$(TARGET_LDFLAGS)" \
 | 
						|
    INDENT="| true" \
 | 
						|
    GOLANG="no" \
 | 
						|
    PAM_CAP="no" \
 | 
						|
    RAISE_SETFCAP="no" \
 | 
						|
    DYNAMIC="yes" \
 | 
						|
    lib="lib"
 | 
						|
 | 
						|
TARGET_CFLAGS += $(FPIC)
 | 
						|
 | 
						|
ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
 | 
						|
TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
 | 
						|
endif
 | 
						|
 | 
						|
TARGET_CFLAGS += $(if $(CONFIG_USE_MUSL),-Dpthread_yield=sched_yield)
 | 
						|
 | 
						|
define Build/InstallDev
 | 
						|
	$(INSTALL_DIR) $(1)/usr/include/sys
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/usr/include/sys/*.h $(1)/usr/include/sys/
 | 
						|
	$(INSTALL_DIR) $(1)/usr/lib
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/lib/libcap.{so*,a} $(1)/usr/lib/
 | 
						|
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/libpsx.a $(1)/usr/lib/
 | 
						|
	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
 | 
						|
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/pkgconfig/libcap.pc $(1)/usr/lib/pkgconfig/
 | 
						|
	$(SED) 's,exec_prefix=,exec_prefix=/usr,g' $(1)/usr/lib/pkgconfig/libcap.pc
 | 
						|
	$(SED) 's,/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libcap.pc
 | 
						|
	$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libcap.pc
 | 
						|
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/pkgconfig/libpsx.pc $(1)/usr/lib/pkgconfig/
 | 
						|
	$(SED) 's,exec_prefix=,exec_prefix=/usr,g' $(1)/usr/lib/pkgconfig/libpsx.pc
 | 
						|
	$(SED) 's,/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libpsx.pc
 | 
						|
	$(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libpsx.pc
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap/install
 | 
						|
	$(INSTALL_DIR) $(1)/usr/lib
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
 | 
						|
endef
 | 
						|
 | 
						|
define Package/libcap-bin/install
 | 
						|
	$(INSTALL_DIR) $(1)/usr/sbin
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/sbin/capsh     $(1)/usr/sbin/
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/sbin/getcap    $(1)/usr/sbin/
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/sbin/getpcaps  $(1)/usr/sbin/
 | 
						|
	$(CP) $(PKG_INSTALL_DIR)/sbin/setcap    $(1)/usr/sbin/
 | 
						|
endef
 | 
						|
 | 
						|
$(eval $(call BuildPackage,libcap))
 | 
						|
$(eval $(call BuildPackage,libcap-bin))
 |