include $(TOPDIR)/rules.mk
PKG_NAME:=setools
-PKG_VERSION:=4.5.1
+PKG_VERSION:=4.6.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/SELinuxProject/setools/releases/download/$(PKG_VERSION)
-PKG_HASH:=25e47d00bbffd6046f55409c9ba3b08d9b1d5788cc159ea247d9e0ced8e482e7
+PKG_HASH:=97319aabaf9d4237841ee60dcc9b2f291e73a761f317fd13e293ea2367d5806c
-PKG_BUILD_DEPENDS:=python-cython/host # Cython>=0.27
+PKG_BUILD_DEPENDS:=python-cython/host # Cython>=0.29.14
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=GPL-2.0-only LGPL-2.1-only
SUBMENU:=Python
TITLE:=SETools Python bindings
URL:=http://selinuxproject.org/page/Main_Page
- DEPENDS:=+python3-light +python3-logging +python3-pkg-resources +libselinux +libsepol
+ DEPENDS:=+python3-light +python3-logging +libselinux +libsepol
endef
define Package/python3-setools/description
---- a/setup.py
-+++ b/setup.py
-@@ -70,13 +70,10 @@ setup(name='setools',
- author='Chris PeBenito',
- author_email='pebenito@ieee.org',
- url='https://github.com/SELinuxProject/setools',
-- packages=['setools', 'setools.checker', 'setools.diff', 'setoolsgui', 'setoolsgui.widgets',
-- 'setoolsgui.widgets.criteria', 'setoolsgui.widgets.details',
-- 'setoolsgui.widgets.models', 'setoolsgui.widgets.views'],
-- scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'],
-+ packages=['setools', 'setools.checker', 'setools.diff'],
-+ scripts=['sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta', 'sechecker'],
- data_files=installed_data,
-- package_data={'': ['*.css', '*.html'],
-- 'setools': ['perm_map', 'policyrep.pyi', 'py.typed']},
-+ package_data={'setools': ['perm_map', 'policyrep.pyi', 'py.typed']},
- ext_modules=cythonize(ext_py_mods, include_path=['setools/policyrep'],
- annotate=cython_annotate,
- compiler_directives={"language_level": 3,
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -48,8 +48,7 @@ optional-dependencies.test = ["tox"]
+
+ [tool.setuptools]
+ include-package-data = false
+-script-files = ["apol",
+- "sediff",
++script-files = ["sediff",
+ "seinfo",
+ "seinfoflow",
+ "sesearch",
+@@ -57,10 +56,10 @@ script-files = ["apol",
+ "sechecker"]
+
+ [tool.setuptools.packages.find]
+-include = ["setools*"]
++include = ["setools", "setools.*"]
+
+ [tool.setuptools.package-data]
+-"*" = ["*.css", "*.html", "perm_map", "py.typed"]
++"setools" = ["perm_map", "py.typed"]
+
+ [tool.setuptools.exclude-package-data]
+ "*" = ["*.c", "*.pyi", "*.pyx"]
--- a/setup.py
+++ b/setup.py
-@@ -11,7 +11,7 @@ import os.path
+@@ -10,7 +10,7 @@ from Cython.Build import cythonize
# Library linkage
--lib_dirs = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib']
-+lib_dirs = ['.', os.environ["STAGING_DIR"] + '/usr/lib']
- include_dirs = []
+-lib_dirs: list[str] = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib']
++lib_dirs: list[str] = ['.', os.environ["STAGING_DIR"] + '/usr/lib']
+ include_dirs: list[str] = []
- with suppress(KeyError):
+ userspace_src = os.getenv("USERSPACE_SRC", "")
--- /dev/null
+#!/bin/sh
+
+[ "$1" = python3-setools ] || exit 0
+
+python3 - << 'EOF'
+import setools
+
+# Verify the module loads and basic query classes are accessible
+assert hasattr(setools, 'SELinuxPolicy'), \
+ "setools missing SELinuxPolicy class"
+assert hasattr(setools, 'BoolQuery'), \
+ "setools missing BoolQuery class"
+assert hasattr(setools, 'TypeQuery'), \
+ "setools missing TypeQuery class"
+assert hasattr(setools, 'RoleQuery'), \
+ "setools missing RoleQuery class"
+assert hasattr(setools, 'UserQuery'), \
+ "setools missing UserQuery class"
+EOF