Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. PKG_BUILD_FLAGS:=no-lto
  15. include $(INCLUDE_DIR)/package.mk
  16. include $(INCLUDE_DIR)/host-build.mk
  17. define Package/libsepol
  18. SECTION:=libs
  19. CATEGORY:=Libraries
  20. TITLE:=SELinux binary policy manipulation library
  21. URL:=http://selinuxproject.org/page/Main_Page
  22. endef
  23. define Package/libsepol/description
  24. Libsepol is the binary policy manipulation library. It doesn't
  25. depend upon or use any of the other SELinux components.
  26. endef
  27. define Package/chkcon
  28. SECTION:=utils
  29. CATEGORY:=Utilities
  30. DEPENDS:=+libsepol
  31. TITLE:=libsepol chkcon security context validation tool
  32. URL:=http://selinuxproject.org/page/Main_Page
  33. endef
  34. define Package/chkcon/description
  35. chkcon - determine if a security context is valid for a given binary policy
  36. endef
  37. HOST_MAKE_FLAGS += \
  38. PREFIX=$(STAGING_DIR_HOSTPKG) \
  39. SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib
  40. MAKE_FLAGS += \
  41. SHLIBDIR=/usr/lib \
  42. OS=Linux
  43. define Build/Compile
  44. $(call Build/Compile/Default,all)
  45. endef
  46. define Build/Install
  47. $(call Build/Install/Default,install)
  48. endef
  49. define Build/InstallDev
  50. $(INSTALL_DIR) $(1)/usr/include
  51. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  52. $(INSTALL_DIR) $(1)/usr/lib
  53. $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
  54. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  55. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsepol.pc $(1)/usr/lib/pkgconfig/
  56. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsepol.pc
  57. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsepol.pc
  58. endef
  59. define Package/libsepol/install
  60. $(INSTALL_DIR) $(1)/usr/lib
  61. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/
  62. endef
  63. define Package/chkcon/install
  64. $(INSTALL_DIR) $(1)/usr/bin
  65. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chkcon $(1)/usr/bin/
  66. endef
  67. $(eval $(call HostBuild))
  68. $(eval $(call BuildPackage,libsepol))
  69. $(eval $(call BuildPackage,chkcon))