setools: Update to 4.4.2, reorganize package
authorJeffery To <jeffery.to@gmail.com>
Fri, 9 Jun 2023 09:54:20 +0000 (17:54 +0800)
committerJeffery To <jeffery.to@gmail.com>
Mon, 19 Jun 2023 07:47:09 +0000 (15:47 +0800)
* Add separate packages for each tool (setools-*) and a package for the
  Python bindings (python3-setools)

* Update the setools package as a meta-package that installs all tools,
  keeping it functionally the same as the current setools package

* Remove gui tool (apol) and Python binding (setoolsgui)

* Simplify 030-remove-host-paths.patch (libraries installed by
  Build/InstallDev are placed in $(STAGING_DIR)/usr/lib only)

* Update package titles, descriptions, license, and dependencies

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
utils/setools/Makefile
utils/setools/patches/010-no-gui.patch [new file with mode: 0644]
utils/setools/patches/030-remove-host-paths.patch

index 2e6d3f915d04147179793bd6577a759fcecc9882..2bb4c7ff4089151012e5a79e48f404da91b366d7 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=setools
-PKG_VERSION:=4.4.0
-PKG_RELEASE:=2
+PKG_VERSION:=4.4.2
+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:=f3786677e40b7f16a226f48f233dcf835e700739614a7dbed2ff61cc9607814e
-PKG_BUILD_DIR:=$(BUILD_DIR)/setools
+PKG_HASH:=f23e3c8635aa289096ca0218ca6f4568a4346e088bc46f374cb0917b7fb66f05
 
 PKG_BUILD_DEPENDS:=python-cython/host # Cython>=0.27
 
 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
-PKG_LICENSE:=GPL-2.0-or-later LGPL-2.1-or-later
+PKG_LICENSE:=GPL-2.0-only LGPL-2.1-only
 PKG_LICENSE_FILES:=COPYING COPYING.GPL COPYING.LGPL
 PKG_CPE_ID:=cpe:/a:selinuxproject:setools
 
 include $(INCLUDE_DIR)/package.mk
 include ../../lang/python/python3-package.mk
 
-define Package/setools
+TAR_OPTIONS+= --strip-components 1
+TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
+
+define Package/setools/Default
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+python3 +python3-pkg-resources +python3-networkx +libselinux +libsepol
-  TITLE:=Policy analysis tools for SELinux
+  TITLE:=SELinux policy analysis tool
+  URL:=http://selinuxproject.org/page/Main_Page
+  DEPENDS:=+python3-light +python3-logging +python3-setools
+endef
+
+define Package/setools/Default/description
+SETools is a collection of tools and libraries designed to facilitate
+SELinux policy analysis.
+endef
+
+define Package/python3-setools
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  TITLE:=SETools Python bindings
   URL:=http://selinuxproject.org/page/Main_Page
+  DEPENDS:=+python3-light +python3-logging +python3-pkg-resources +libselinux +libsepol
+endef
+
+define Package/python3-setools/description
+$(call Package/setools/Default/description)
+
+This contains the SETools Python binding.
+endef
+
+Py3Package/python3-setools/install:=:
+
+define Package/setools
+$(call Package/setools/Default)
+  TITLE+= meta-package
+  DEPENDS:= \
+    setools-sechecker \
+    setools-sediff \
+    setools-sedta \
+    setools-seinfo \
+    setools-seinfoflow \
+    setools-sesearch
 endef
 
 define Package/setools/description
-  SETools is a collection of tools and libraries designed to facilitate
-  SELinux policy analysis.
+$(call Package/setools/Default/description)
+
+This is a meta-package that installs all of the SETools tools.
+endef
+
+Package/setools/install:=:
+
+define BuildUtil
+  define Package/setools-$(1)
+  $(call Package/setools/Default)
+    TITLE+= $(1)
+    DEPENDS+= $(2)
+  endef
+
+  define Package/setools-$(1)/description
+$(call Package/setools/Default/description)
+
+This contains the $(1) tool.
+  endef
+
+  define Py3Package/setools-$(1)/install
+       $$(INSTALL_DIR) $$(1)/usr/bin
+       $$(INSTALL_BIN) $$(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
+  endef
+
+  Py3Package/setools-$(1)/filespec:=
+
+  $$(eval $$(call Py3Package,setools-$(1)))
+  $$(eval $$(call BuildPackage,setools-$(1)))
 endef
 
-$(eval $(call Py3Package,setools))
+$(eval $(call Py3Package,python3-setools))
+$(eval $(call BuildPackage,python3-setools))
+$(eval $(call BuildPackage,python3-setools-src))
+
 $(eval $(call BuildPackage,setools))
+
+$(eval $(call BuildUtil,sechecker))
+$(eval $(call BuildUtil,sediff))
+$(eval $(call BuildUtil,sedta,+python3-networkx))
+$(eval $(call BuildUtil,seinfo))
+$(eval $(call BuildUtil,seinfoflow,+python3-networkx))
+$(eval $(call BuildUtil,sesearch))
diff --git a/utils/setools/patches/010-no-gui.patch b/utils/setools/patches/010-no-gui.patch
new file mode 100644 (file)
index 0000000..54f03c3
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/setup.py
++++ b/setup.py
+@@ -139,10 +139,10 @@ setup(name='setools',
+       author_email='pebenito@ieee.org',
+       url='https://github.com/SELinuxProject/setools',
+       cmdclass={'build_qhc': QtHelpCommand, 'clean': CleanCommand},
+-      packages=['setools', 'setools.checker', 'setools.diff', 'setoolsgui', 'setoolsgui.apol'],
+-      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={'': ['*.ui', '*.qhc', '*.qch'], 'setools': ['perm_map',
++      package_data={'setools': ['perm_map',
+                                                                 'policyrep.pyi',
+                                                                 'py.typed']},
+       ext_modules=cythonize(ext_py_mods, include_path=['setools/policyrep'],
index 94553004dee9c877ae39af44ffdfffabd725a089..bec9be9d631287197c44bd55a5b4a8f7ceaeaaf4 100644 (file)
@@ -1,12 +1,11 @@
 --- a/setup.py
 +++ b/setup.py
-@@ -79,7 +79,8 @@ class QtHelpCommand(Command):
+@@ -79,7 +79,7 @@ class QtHelpCommand(Command):
  
  
  # Library linkage
 -lib_dirs = ['.', '/usr/lib64', '/usr/lib', '/usr/local/lib']
-+owrt_staging_dir = os.environ["STAGING_DIR"]
-+lib_dirs = ['.', owrt_staging_dir + '/usr/lib64', owrt_staging_dir + '/usr/lib', owrt_staging_dir + '/usr/local/lib' ]
++lib_dirs = ['.', os.environ["STAGING_DIR"] + '/usr/lib']
  include_dirs = []
  
  with suppress(KeyError):