blob: 25ab8559f6ba21143713845351f8601eb157958e [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#
2# This is free software, licensed under the GNU General Public License v2.
3# See /LICENSE for more information.
4#
5
6include $(TOPDIR)/rules.mk
7
8PKG_NAME:=python-selinux
9PKG_VERSION:=3.6
10PKG_RELEASE:=1
11
12SRC_NAME:=libselinux
13PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz
14PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
15PKG_HASH:=ba4e0ef34b270e7672a5e5f1b523fe2beab3a40bb33d9389f4ad3a8728f21b52
16PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(SRC_NAME)-$(PKG_VERSION)
17
18PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
19PKG_LICENSE:=libselinux-1.0
20PKG_LICENSE_FILES:=LICENSE
21PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
22
23PKG_BUILD_DEPENDS:=swig/host
24PKG_BUILD_PARALLEL:=1
25PYTHON3_PKG_BUILD:=0
26
27include $(INCLUDE_DIR)/package.mk
28include ../python3-package.mk
29
30define 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
37endef
38
39define 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.
49endef
50
51MAKE_VARS += \
52 $(PYTHON3_VARS) \
53 $(HOST_PYTHON3_PIP_VARS) \
54 PYTHON_SETUP_ARGS=--no-compile
55
56MAKE_FLAGS += \
57 SHLIBDIR=/usr/lib
58
59ifneq ($(CONFIG_USE_MUSL),)
60 MAKE_FLAGS += FTS_LDLIBS=-lfts
61 TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
62endif
63
64define Build/Compile
65 $(call Build/Compile/Default,pywrap)
66endef
67
68define Build/Install
69 $(call Build/Install/Default,install-pywrap)
70endef
71
72$(eval $(call Py3Package,python3-selinux))
73$(eval $(call BuildPackage,python3-selinux))
74$(eval $(call BuildPackage,python3-selinux-src))