b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | # |
| 2 | # This is free software, licensed under the GNU General Public License v2. |
| 3 | # See /LICENSE for more information. |
| 4 | # |
| 5 | |
| 6 | include $(TOPDIR)/rules.mk |
| 7 | |
| 8 | PKG_NAME:=python-selinux |
| 9 | PKG_VERSION:=3.6 |
| 10 | PKG_RELEASE:=1 |
| 11 | |
| 12 | SRC_NAME:=libselinux |
| 13 | PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz |
| 14 | PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION) |
| 15 | PKG_HASH:=ba4e0ef34b270e7672a5e5f1b523fe2beab3a40bb33d9389f4ad3a8728f21b52 |
| 16 | PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(SRC_NAME)-$(PKG_VERSION) |
| 17 | |
| 18 | PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com> |
| 19 | PKG_LICENSE:=libselinux-1.0 |
| 20 | PKG_LICENSE_FILES:=LICENSE |
| 21 | PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux |
| 22 | |
| 23 | PKG_BUILD_DEPENDS:=swig/host |
| 24 | PKG_BUILD_PARALLEL:=1 |
| 25 | PYTHON3_PKG_BUILD:=0 |
| 26 | |
| 27 | include $(INCLUDE_DIR)/package.mk |
| 28 | include ../python3-package.mk |
| 29 | |
| 30 | define Package/python3-selinux |
| 31 | SUBMENU:=Python |
| 32 | SECTION:=lang |
| 33 | CATEGORY:=Languages |
| 34 | TITLE:=SELinux runtime library bindings |
| 35 | DEPENDS:=+python3-light +libselinux |
| 36 | URL:=http://selinuxproject.org/page/Main_Page |
| 37 | endef |
| 38 | |
| 39 | define Package/python3-selinux/description |
| 40 | libselinux is the runtime SELinux library that provides |
| 41 | interfaces (e.g. library functions for the SELinux kernel |
| 42 | APIs like getcon(), other support functions like |
| 43 | getseuserbyname()) to SELinux-aware applications. libselinux |
| 44 | may use the shared libsepol to manipulate the binary policy |
| 45 | if necessary (e.g. to downgrade the policy format to an |
| 46 | older version supported by the kernel) when loading policy. |
| 47 | |
| 48 | This package provides the Python bindings for libselinux. |
| 49 | endef |
| 50 | |
| 51 | MAKE_VARS += \ |
| 52 | $(PYTHON3_VARS) \ |
| 53 | $(HOST_PYTHON3_PIP_VARS) \ |
| 54 | PYTHON_SETUP_ARGS=--no-compile |
| 55 | |
| 56 | MAKE_FLAGS += \ |
| 57 | SHLIBDIR=/usr/lib |
| 58 | |
| 59 | ifneq ($(CONFIG_USE_MUSL),) |
| 60 | MAKE_FLAGS += FTS_LDLIBS=-lfts |
| 61 | TARGET_CFLAGS += -D_LARGEFILE64_SOURCE |
| 62 | endif |
| 63 | |
| 64 | define Build/Compile |
| 65 | $(call Build/Compile/Default,pywrap) |
| 66 | endef |
| 67 | |
| 68 | define Build/Install |
| 69 | $(call Build/Install/Default,install-pywrap) |
| 70 | endef |
| 71 | |
| 72 | $(eval $(call Py3Package,python3-selinux)) |
| 73 | $(eval $(call BuildPackage,python3-selinux)) |
| 74 | $(eval $(call BuildPackage,python3-selinux-src)) |