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.

159 lines
3.8 KiB

  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:=selinux-python
  7. PKG_VERSION:=3.2
  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:=770855ea8120ef23007fdb9db94b1ed6e8cd77917b584ed8877bbee9c16e74fb
  12. PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  13. PKG_LICENSE:=GPL-2.0-only
  14. PKG_LICENSE_FILES:=COPYING
  15. PYTHON3_PKG_BUILD:=0
  16. PKG_INSTALL:=1
  17. include $(INCLUDE_DIR)/package.mk
  18. include ../../lang/python/python3-package.mk
  19. #
  20. # common definitions
  21. #
  22. define Package/selinux-python/Default
  23. SECTION:=utils
  24. DEPENDS:=+python3 +python3-libselinux
  25. CATEGORY:=Utilities
  26. URL:=http://selinuxproject.org/page/Main_Page
  27. endef
  28. define Package/selinux-python/Default/description
  29. A set of SELinux tools written in python that help with
  30. managing a system with SELinux enabled.
  31. endef
  32. MAKE_VARS = \
  33. PYTHON=$(HOST_PYTHON3_BIN) \
  34. PYTHONLIBDIR=$(PYTHON3_PKG_DIR) \
  35. $(PYTHON3_VARS)
  36. define Build/Compile
  37. $(call Build/Compile/Default,all)
  38. endef
  39. #
  40. # selinux-audit2allow
  41. #
  42. define Package/selinux-audit2allow
  43. $(call Package/selinux-python/Default)
  44. TITLE:=selinux-audit2allow
  45. DEPENDS+=+python3-sepolgen +libselinux +libsepol
  46. endef
  47. define Package/selinux-audit2allow/description
  48. $(call Package/selinux-python/Default/description)
  49. This package contains the audit2allow and audit2why tools.
  50. endef
  51. define Package/selinux-audit2allow/install
  52. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/audit2allow DESTDIR=$(1) install
  53. rm -rf $(1)/usr/share/man
  54. endef
  55. #
  56. # selinux-chchat
  57. #
  58. define Package/selinux-chcat
  59. $(call Package/selinux-python/Default)
  60. TITLE:=selinux-chcat
  61. endef
  62. define Package/selinux-chcat/description
  63. $(call Package/selinux-python/Default/description)
  64. This package contains the chcat tool.
  65. endef
  66. define Package/selinux-chcat/install
  67. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/chcat DESTDIR=$(1) install
  68. rm -rf $(1)/usr/share
  69. endef
  70. #
  71. # selinux-semanage
  72. #
  73. define Package/selinux-semanage
  74. $(call Package/selinux-python/Default)
  75. TITLE:=selinux-semanage
  76. DEPENDS+=+python3-sepolicy +python3-libsemanage +setools
  77. endef
  78. define Package/selinux-semanage/description
  79. $(call Package/selinux-python/Default/description)
  80. This package contains the semanage tool.
  81. endef
  82. define Package/selinux-semanage/install
  83. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/semanage DESTDIR=$(1) install
  84. rm -rf $(1)/usr/share
  85. endef
  86. #
  87. # python3-sepolgen
  88. #
  89. define Package/python3-sepolgen
  90. $(call Package/selinux-python/Default)
  91. SUBMENU:=Python
  92. SECTION:=lang
  93. CATEGORY:=Languages
  94. TITLE:=python3-sepolgen
  95. endef
  96. define Package/python3-sepolgen/description
  97. $(call Package/selinux-python/Default/description)
  98. This package contains the sepolgen Python library.
  99. endef
  100. define Package/python3-sepolgen/install
  101. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/sepolgen DESTDIR=$(1) install
  102. $(INSTALL_DIR) $(1)/usr/share/sepolgen/
  103. $(INSTALL_DATA) $(1)/var/lib/sepolgen/perm_map $(1)/usr/share/sepolgen/perm_map
  104. $(RM) -rf $(1)/var
  105. endef
  106. #
  107. # python3-sepolicy
  108. #
  109. define Package/python3-sepolicy
  110. $(call Package/selinux-python/Default)
  111. SUBMENU:=Python
  112. SECTION:=lang
  113. CATEGORY:=Languages
  114. TITLE:=python3-sepolicy
  115. endef
  116. define Package/python3-sepolicy/description
  117. $(call Package/selinux-python/Default/description)
  118. This package contains the sepolicy Python library.
  119. endef
  120. define Package/python3-sepolicy/install
  121. $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR)/sepolicy DESTDIR=$(1) install
  122. rm -rf $(1)/usr/share
  123. endef
  124. $(eval $(call BuildPackage,selinux-audit2allow))
  125. $(eval $(call BuildPackage,selinux-chcat))
  126. $(eval $(call BuildPackage,selinux-semanage))
  127. $(eval $(call BuildPackage,python3-sepolgen))
  128. $(eval $(call BuildPackage,python3-sepolicy))