python3-libselinux: Update to 3.5, rename source/target package
authorJeffery To <jeffery.to@gmail.com>
Thu, 8 Jun 2023 07:34:09 +0000 (15:34 +0800)
committerJeffery To <jeffery.to@gmail.com>
Mon, 19 Jun 2023 07:47:09 +0000 (15:47 +0800)
* Rename:

  * Source package from python3-libselinux to python-selinux
  * Target package from python3-libselinux to python3-selinux

* Update dependents with new target package name

* Remove patches:

  * 010-setup-py-custom-cc.patch: LDSHARED is already set as part of
    $(PYTHON3_VARS)

  * 020-Make-use-of-variables-when-defining-libdir-and-inclu.patch: This
    package doesn't install the libselinux.pc file

* Update package title and dependencies

* Remove Build/InstallDev (files not used by any other package)

* Use Py3Package to build Python bytecode and source packages

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lang/python/python-selinux/Makefile [new file with mode: 0644]
lang/python/python3-libselinux/Makefile [deleted file]
lang/python/python3-libselinux/patches/010-setup-py-custom-cc.patch [deleted file]
lang/python/python3-libselinux/patches/020-Make-use-of-variables-when-defining-libdir-and-inclu.patch [deleted file]
utils/selinux-python/Makefile

diff --git a/lang/python/python-selinux/Makefile b/lang/python/python-selinux/Makefile
new file mode 100644 (file)
index 0000000..5736ef0
--- /dev/null
@@ -0,0 +1,74 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-selinux
+PKG_VERSION:=3.5
+PKG_RELEASE:=1
+
+SRC_NAME:=libselinux
+PKG_SOURCE:=$(SRC_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
+PKG_HASH:=9a3a3705ac13a2ccca2de6d652b6356fead10f36fb33115c185c5ccdf29eec19
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(SRC_NAME)-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+PKG_LICENSE:=libselinux-1.0
+PKG_LICENSE_FILES:=LICENSE
+PKG_CPE_ID:=cpe:/a:selinuxproject:libselinux
+
+PKG_BUILD_DEPENDS:=swig/host
+PKG_BUILD_PARALLEL:=1
+PYTHON3_PKG_BUILD:=0
+
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+
+define Package/python3-selinux
+  SUBMENU:=Python
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=SELinux runtime library bindings
+  DEPENDS:=+python3-light +libselinux
+  URL:=http://selinuxproject.org/page/Main_Page
+endef
+
+define Package/python3-selinux/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_VARS += \
+       $(PYTHON3_VARS) \
+       $(HOST_PYTHON3_PIP_VARS) \
+       PYTHON_SETUP_ARGS=--no-compile
+
+MAKE_FLAGS += \
+       SHLIBDIR=/usr/lib
+
+ifneq ($(CONFIG_USE_MUSL),)
+  MAKE_FLAGS += FTS_LDLIBS=-lfts
+  TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
+endif
+
+define Build/Compile
+       $(call Build/Compile/Default,pywrap)
+endef
+
+define Build/Install
+       $(call Build/Install/Default,install-pywrap)
+endef
+
+$(eval $(call Py3Package,python3-selinux))
+$(eval $(call BuildPackage,python3-selinux))
+$(eval $(call BuildPackage,python3-selinux-src))
diff --git a/lang/python/python3-libselinux/Makefile b/lang/python/python3-libselinux/Makefile
deleted file mode 100644 (file)
index f56483b..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-# 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.3
-PKG_RELEASE:=3
-
-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/$(PKG_VERSION)
-PKG_HASH:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057
-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
-
-ifneq ($(CONFIG_USE_MUSL),)
-  TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
-endif
-
-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))
diff --git a/lang/python/python3-libselinux/patches/010-setup-py-custom-cc.patch b/lang/python/python3-libselinux/patches/010-setup-py-custom-cc.patch
deleted file mode 100644 (file)
index 8fe8165..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -139,7 +139,7 @@ SWIGRUBY = swig -Wall -ruby -o $(SWIGRUB
- all: $(LIBA) $(LIBSO) $(LIBPC)
- pywrap: all selinuxswig_python_exception.i
--      CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext
-+      LDSHARED="$(CC) -shared" CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext
- rubywrap: all $(SWIGRUBYSO)
diff --git a/lang/python/python3-libselinux/patches/020-Make-use-of-variables-when-defining-libdir-and-inclu.patch b/lang/python/python3-libselinux/patches/020-Make-use-of-variables-when-defining-libdir-and-inclu.patch
deleted file mode 100644 (file)
index c900ff1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-Pkg-config definitions commonly make use of ${exec_prefix} and ${prefix}
-when defining libdir and includedir, respectively. OpenWrt, for example,
-relies on this when it adjusts things for cross compiling.
-
-Signed-off-by: W. Michael Petullo <mike@flyn.org>
----
- src/libselinux.pc.in | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/src/libselinux.pc.in
-+++ b/src/libselinux.pc.in
-@@ -1,7 +1,7 @@
- prefix=@prefix@
- exec_prefix=${prefix}
--libdir=@libdir@
--includedir=@includedir@
-+libdir=${exec_prefix}/lib
-+includedir=${prefix}/include
- Name: libselinux
- Description: SELinux utility library
index ffaa99c7ffa0fd01bb9e584385cfa56ea3d80017..af025c7b0e002846f033bd1cde4661f80a3a69a5 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=selinux-python
 PKG_VERSION:=3.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/$(PKG_VERSION)
@@ -28,7 +28,7 @@ include ../../lang/python/python3-package.mk
 
 define Package/selinux-python/Default
   SECTION:=utils
-  DEPENDS:=+python3 +python3-libselinux
+  DEPENDS:=+python3 +python3-selinux
   CATEGORY:=Utilities
   URL:=http://selinuxproject.org/page/Main_Page
 endef