summaryrefslogtreecommitdiff
path: root/lang/python/python3-libselinux/Makefile
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>2020-08-11 10:20:06 -0500
committerPaul Spooren <mail@aparcar.org>2020-09-11 14:50:24 -1000
commitd4a498040d71aa60b19003eb2f87a988bf69286d (patch)
treed00a7313890f4e9180968f533c4e27b9574f8acd /lang/python/python3-libselinux/Makefile
parent02cbc208f11331f1381e7a8f6a711c4f7e817f56 (diff)
python3-libselinux: new package
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> [strip C library after adding it to openwrt repository] Signed-off-by: W. Michael Petullo <mike@flyn.org>
Diffstat (limited to 'lang/python/python3-libselinux/Makefile')
-rw-r--r--lang/python/python3-libselinux/Makefile77
1 files changed, 77 insertions, 0 deletions
diff --git a/lang/python/python3-libselinux/Makefile b/lang/python/python3-libselinux/Makefile
new file mode 100644
index 000000000..44360f4eb
--- /dev/null
+++ b/lang/python/python3-libselinux/Makefile
@@ -0,0 +1,77 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+SRC_NAME:=libselinux
+PKG_NAME:=python3-$(SRC_NAME)
+PKG_VERSION:=3.1
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/python-libselinux/$(SRC_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710
+PKG_HASH:=ea5dcbb4d859e3f999c26a13c630da2f16dff9462e3cc8cb7b458ac157d112e7
+PKG_BUILD_DEPENDS:=swig/host
+
+PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+PKG_LICENSE:=libselinux-1.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
+PYTHON3_PKG_BUILD:=0
+PKG_INSTALL:=1
+MAKE_PATH:=src
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-libselinux
+ TITLE:=Python bindings for the runtime SELinux library
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ DEPENDS:=+libpcre +musl-fts +python3 +libselinux
+ URL:=http://selinuxproject.org/page/Main_Page
+endef
+
+define Package/python3-libselinux/description
+ libselinux is the runtime SELinux library that provides
+ interfaces (e.g. library functions for the SELinux kernel
+ APIs like getcon(), other support functions like
+ getseuserbyname()) to SELinux-aware applications. libselinux
+ may use the shared libsepol to manipulate the binary policy
+ if necessary (e.g. to downgrade the policy format to an
+ older version supported by the kernel) when loading policy.
+
+ This package provides the Python bindings for libselinux.
+endef
+
+MAKE_FLAGS += \
+ FTS_LDLIBS=-lfts \
+ SHLIBDIR=/usr/lib \
+ PYTHON=$(PYTHON3) \
+ PYINC="-I $(PYTHON3_INC_DIR)" \
+ PYLIBS="-lpython$(PYTHON3_VERSION)" \
+ $(PYTHON3_VARS)
+
+define Build/Compile
+ $(call Build/Compile/Default,swigify pywrap)
+endef
+
+define Build/Install
+ $(call Build/Install/Default,install-pywrap)
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
+endef
+
+define Package/python3-libselinux/install
+ $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python3-libselinux))