Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #
  2. # This is free software, licensed under the GNU General Public License v2.
  3. # See /LICENSE for more information.
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=libsepol
  7. PKG_VERSION:=3.5
  8. PKG_RELEASE:=1
  9. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
  11. PKG_HASH:=78fdaf69924db780bac78546e43d9c44074bad798c2c415d0b9bb96d065ee8a2
  12. PKG_MAINTAINER:=Thomas Petazzoni <[email protected]>
  13. PKG_CPE_ID:=cpe:/a:selinuxproject:libsepol
  14. include $(INCLUDE_DIR)/package.mk
  15. include $(INCLUDE_DIR)/host-build.mk
  16. define Package/libsepol
  17. SECTION:=libs
  18. CATEGORY:=Libraries
  19. TITLE:=SELinux binary policy manipulation library
  20. URL:=http://selinuxproject.org/page/Main_Page
  21. endef
  22. define Package/libsepol/description
  23. Libsepol is the binary policy manipulation library. It doesn't
  24. depend upon or use any of the other SELinux components.
  25. endef
  26. define Package/chkcon
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. DEPENDS:=+libsepol
  30. TITLE:=libsepol chkcon security context validation tool
  31. URL:=http://selinuxproject.org/page/Main_Page
  32. endef
  33. define Package/chkcon/description
  34. chkcon - determine if a security context is valid for a given binary policy
  35. endef
  36. HOST_MAKE_FLAGS += \
  37. PREFIX=$(STAGING_DIR_HOSTPKG) \
  38. SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib
  39. MAKE_FLAGS += \
  40. SHLIBDIR=/usr/lib \
  41. OS=Linux
  42. define Build/Compile
  43. $(call Build/Compile/Default,all)
  44. endef
  45. define Build/Install
  46. $(call Build/Install/Default,install)
  47. endef
  48. define Build/InstallDev
  49. $(INSTALL_DIR) $(1)/usr/include
  50. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  51. $(INSTALL_DIR) $(1)/usr/lib
  52. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  53. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  54. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsepol.pc $(1)/usr/lib/pkgconfig/
  55. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsepol.pc
  56. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsepol.pc
  57. endef
  58. define Package/libsepol/install
  59. $(INSTALL_DIR) $(1)/usr/lib
  60. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/
  61. endef
  62. define Package/chkcon/install
  63. $(INSTALL_DIR) $(1)/usr/bin
  64. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chkcon $(1)/usr/bin/
  65. endef
  66. $(eval $(call HostBuild))
  67. $(eval $(call BuildPackage,libsepol))
  68. $(eval $(call BuildPackage,chkcon))