Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #
  2. # Copyright (C) 2011 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libcap
  9. PKG_VERSION:=2.27
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
  13. PKG_HASH:=dac1792d0118bee6aae6ba7fb93ff1602c6a9bda812fd63916eee1435b9c486a
  14. PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=License
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/kernel.mk
  20. define Package/libcap
  21. TITLE:=Linux capabilities library
  22. SECTION:=libs
  23. CATEGORY:=Libraries
  24. URL:=https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
  25. endef
  26. define Package/libcap/config
  27. if PACKAGE_libcap
  28. config PACKAGE_libcap-bin
  29. bool "install libcap executables"
  30. help
  31. Install capsh, getcap, getpcaps, setcap into the target image.
  32. default n
  33. config PACKAGE_libcap-bin-capsh-shell
  34. string "capsh shell"
  35. depends on PACKAGE_libcap-bin
  36. help
  37. Set the capsh shell.
  38. default "/bin/sh"
  39. endif
  40. endef
  41. MAKE_FLAGS += \
  42. BUILD_CC="$(CC)" \
  43. BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \
  44. CFLAGS="$(TARGET_CFLAGS)" \
  45. LD="$(TARGET_CC) -Wl,-x -shared" \
  46. LDFLAGS="$(TARGET_LDFLAGS)" \
  47. INDENT="| true" \
  48. PAM_CAP="no" \
  49. RAISE_SETFCAP="no" \
  50. DYNAMIC="yes" \
  51. lib="lib"
  52. ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
  53. TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
  54. endif
  55. define Build/InstallDev
  56. $(INSTALL_DIR) $(1)/usr/include/sys
  57. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  58. $(INSTALL_DIR) $(1)/usr/lib/
  59. $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib/
  60. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  61. endef
  62. define Package/libcap/install
  63. $(INSTALL_DIR) $(1)/usr/lib
  64. $(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
  65. ifneq ($(CONFIG_PACKAGE_libcap-bin),)
  66. $(INSTALL_DIR) $(1)/usr/sbin
  67. $(CP) $(PKG_INSTALL_DIR)/sbin/capsh $(1)/usr/sbin/
  68. $(CP) $(PKG_INSTALL_DIR)/sbin/getcap $(1)/usr/sbin/
  69. $(CP) $(PKG_INSTALL_DIR)/sbin/getpcaps $(1)/usr/sbin/
  70. $(CP) $(PKG_INSTALL_DIR)/sbin/setcap $(1)/usr/sbin/
  71. endif
  72. endef
  73. $(eval $(call BuildPackage,libcap))