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.

77 lines
2.2 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. SRC_NAME:=libselinux
  7. PKG_NAME:=python3-$(SRC_NAME)
  8. PKG_VERSION:=3.3
  9. PKG_RELEASE:=$(AUTORELEASE)
  10. PKG_BUILD_DIR:=$(BUILD_DIR)/python-libselinux/$(SRC_NAME)-$(PKG_VERSION)
  11. PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710
  13. PKG_HASH:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057
  14. PKG_BUILD_DEPENDS:=swig/host
  15. PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  16. PKG_LICENSE:=libselinux-1.0
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
  19. PYTHON3_PKG_BUILD:=0
  20. PKG_INSTALL:=1
  21. MAKE_PATH:=src
  22. include $(INCLUDE_DIR)/package.mk
  23. include ../python3-package.mk
  24. define Package/python3-libselinux
  25. TITLE:=Python bindings for the runtime SELinux library
  26. SUBMENU:=Python
  27. SECTION:=lang
  28. CATEGORY:=Languages
  29. DEPENDS:=+libpcre +musl-fts +python3 +libselinux
  30. URL:=http://selinuxproject.org/page/Main_Page
  31. endef
  32. define Package/python3-libselinux/description
  33. libselinux is the runtime SELinux library that provides
  34. interfaces (e.g. library functions for the SELinux kernel
  35. APIs like getcon(), other support functions like
  36. getseuserbyname()) to SELinux-aware applications. libselinux
  37. may use the shared libsepol to manipulate the binary policy
  38. if necessary (e.g. to downgrade the policy format to an
  39. older version supported by the kernel) when loading policy.
  40. This package provides the Python bindings for libselinux.
  41. endef
  42. MAKE_FLAGS += \
  43. FTS_LDLIBS=-lfts \
  44. SHLIBDIR=/usr/lib \
  45. PYTHON=$(PYTHON3) \
  46. PYINC="-I $(PYTHON3_INC_DIR)" \
  47. PYLIBS="-lpython$(PYTHON3_VERSION)" \
  48. $(PYTHON3_VARS)
  49. define Build/Compile
  50. $(call Build/Compile/Default,swigify pywrap)
  51. endef
  52. define Build/Install
  53. $(call Build/Install/Default,install-pywrap)
  54. endef
  55. define Build/InstallDev
  56. $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
  57. $(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
  58. endef
  59. define Package/python3-libselinux/install
  60. $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
  61. $(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
  62. endef
  63. $(eval $(call BuildPackage,python3-libselinux))