setools: Update to 4.4.2, reorganize package
[feed/packages.git] / lang / python / python3-libselinux / Makefile
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 SRC_NAME:=libselinux
9 PKG_NAME:=python3-$(SRC_NAME)
10 PKG_VERSION:=3.3
11 PKG_RELEASE:=3
12
13 PKG_BUILD_DIR:=$(BUILD_DIR)/python-libselinux/$(SRC_NAME)-$(PKG_VERSION)
14 PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
16 PKG_HASH:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057
17 PKG_BUILD_DEPENDS:=swig/host
18
19 PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
20 PKG_LICENSE:=libselinux-1.0
21 PKG_LICENSE_FILES:=LICENSE
22 PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
23 PYTHON3_PKG_BUILD:=0
24 PKG_INSTALL:=1
25 MAKE_PATH:=src
26
27 include $(INCLUDE_DIR)/package.mk
28 include ../python3-package.mk
29
30 define Package/python3-libselinux
31 TITLE:=Python bindings for the runtime SELinux library
32 SUBMENU:=Python
33 SECTION:=lang
34 CATEGORY:=Languages
35 DEPENDS:=+libpcre +musl-fts +python3 +libselinux
36 URL:=http://selinuxproject.org/page/Main_Page
37 endef
38
39 define Package/python3-libselinux/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 ifneq ($(CONFIG_USE_MUSL),)
52 TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
53 endif
54
55 MAKE_FLAGS += \
56 FTS_LDLIBS=-lfts \
57 SHLIBDIR=/usr/lib \
58 PYTHON=$(PYTHON3) \
59 PYINC="-I $(PYTHON3_INC_DIR)" \
60 PYLIBS="-lpython$(PYTHON3_VERSION)" \
61 $(PYTHON3_VARS)
62
63 define Build/Compile
64 $(call Build/Compile/Default,swigify pywrap)
65 endef
66
67 define Build/Install
68 $(call Build/Install/Default,install-pywrap)
69 endef
70
71 define Build/InstallDev
72 $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
73 $(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
74 endef
75
76 define Package/python3-libselinux/install
77 $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
78 $(CP) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/* $(1)$(PYTHON3_PKG_DIR)
79 endef
80
81 $(eval $(call BuildPackage,python3-libselinux))