Makefile 2.3 KB

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