You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.8 KiB

  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.30
  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:=a287bae0b0d95e5230a1c4177b835c70774511b631f87c7bd29e91a03e027f11
  14. PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
  15. PKG_LICENSE:=GPL-2.0-only
  16. PKG_LICENSE_FILES:=License
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/kernel.mk
  21. define Package/libcap/Default
  22. TITLE:=Linux capabilities library
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. URL:=https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/
  26. endef
  27. define Package/libcap/description/Default
  28. Linux capabilities
  29. endef
  30. define Package/libcap
  31. $(call Package/libcap/Default)
  32. TITLE += library
  33. endef
  34. define Package/libcap-bin
  35. $(call Package/libcap/Default)
  36. TITLE += binaries
  37. DEPENDS += libcap
  38. endef
  39. define Package/libcap-bin/description
  40. $(call Package/libcap/description/Default)
  41. .
  42. This package contains the libcap utilities.
  43. endef
  44. define Package/libcap-bin/config
  45. if PACKAGE_libcap-bin
  46. config PACKAGE_libcap-bin-capsh-shell
  47. string "capsh shell"
  48. help
  49. Set the capsh shell.
  50. default "/bin/sh"
  51. endif
  52. endef
  53. MAKE_FLAGS += \
  54. BUILD_CC="$(CC)" \
  55. BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \
  56. CFLAGS="$(TARGET_CFLAGS)" \
  57. LD="$(TARGET_CC) -Wl,-x -shared" \
  58. LDFLAGS="$(TARGET_LDFLAGS)" \
  59. INDENT="| true" \
  60. GOLANG="no" \
  61. PAM_CAP="no" \
  62. RAISE_SETFCAP="no" \
  63. DYNAMIC="yes" \
  64. lib="lib"
  65. ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
  66. TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
  67. endif
  68. define Build/InstallDev
  69. $(INSTALL_DIR) $(1)/usr/include/sys
  70. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib/
  73. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  74. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  75. $(SED) 's,exec_prefix=,exec_prefix=/usr,g' $(1)/usr/lib/pkgconfig/libcap.pc
  76. $(SED) 's,/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libcap.pc
  77. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libcap.pc
  78. endef
  79. define Package/libcap/install
  80. $(INSTALL_DIR) $(1)/usr/lib
  81. $(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
  82. endef
  83. define Package/libcap-bin/install
  84. $(INSTALL_DIR) $(1)/usr/sbin
  85. $(CP) $(PKG_INSTALL_DIR)/sbin/capsh $(1)/usr/sbin/
  86. $(CP) $(PKG_INSTALL_DIR)/sbin/getcap $(1)/usr/sbin/
  87. $(CP) $(PKG_INSTALL_DIR)/sbin/getpcaps $(1)/usr/sbin/
  88. $(CP) $(PKG_INSTALL_DIR)/sbin/setcap $(1)/usr/sbin/
  89. endef
  90. $(eval $(call BuildPackage,libcap))
  91. $(eval $(call BuildPackage,libcap-bin))