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.

107 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.27
  10. PKG_RELEASE:=3
  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/Default
  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/description/Default
  27. Linux capabilities
  28. endef
  29. define Package/libcap
  30. $(call Package/libcap/Default)
  31. TITLE += library
  32. endef
  33. define Package/libcap-bin
  34. $(call Package/libcap/Default)
  35. TITLE += binaries
  36. DEPENDS += libcap
  37. endef
  38. define Package/libcap-bin/description
  39. $(call Package/libcap/description/Default)
  40. .
  41. This package contains the libcap utilities.
  42. endef
  43. define Package/libcap-bin/config
  44. if PACKAGE_libcap-bin
  45. config PACKAGE_libcap-bin-capsh-shell
  46. string "capsh shell"
  47. help
  48. Set the capsh shell.
  49. default "/bin/sh"
  50. endif
  51. endef
  52. MAKE_FLAGS += \
  53. BUILD_CC="$(CC)" \
  54. BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \
  55. CFLAGS="$(TARGET_CFLAGS)" \
  56. LD="$(TARGET_CC) -Wl,-x -shared" \
  57. LDFLAGS="$(TARGET_LDFLAGS)" \
  58. INDENT="| true" \
  59. PAM_CAP="no" \
  60. RAISE_SETFCAP="no" \
  61. DYNAMIC="yes" \
  62. lib="lib"
  63. ifneq ($(CONFIG_PACKAGE_libcap-bin-capsh-shell),)
  64. TARGET_CFLAGS += -DSHELL='\"$(CONFIG_PACKAGE_libcap-bin-capsh-shell)\"'
  65. endif
  66. define Build/InstallDev
  67. $(INSTALL_DIR) $(1)/usr/include/sys
  68. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  69. $(INSTALL_DIR) $(1)/usr/lib
  70. $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib/
  71. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  72. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  73. $(SED) 's,exec_prefix=,exec_prefix=/usr,g' $(1)/usr/lib/pkgconfig/libcap.pc
  74. $(SED) 's,/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libcap.pc
  75. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libcap.pc
  76. endef
  77. define Package/libcap/install
  78. $(INSTALL_DIR) $(1)/usr/lib
  79. $(CP) $(PKG_INSTALL_DIR)/lib/libcap.so* $(1)/usr/lib/
  80. endef
  81. define Package/libcap-bin/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(CP) $(PKG_INSTALL_DIR)/sbin/capsh $(1)/usr/sbin/
  84. $(CP) $(PKG_INSTALL_DIR)/sbin/getcap $(1)/usr/sbin/
  85. $(CP) $(PKG_INSTALL_DIR)/sbin/getpcaps $(1)/usr/sbin/
  86. $(CP) $(PKG_INSTALL_DIR)/sbin/setcap $(1)/usr/sbin/
  87. endef
  88. $(eval $(call BuildPackage,libcap))
  89. $(eval $(call BuildPackage,libcap-bin))