diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2023-12-16 16:21:30 +0800 |
---|---|---|
committer | Joe MacDonald <joe@deserted.net> | 2023-12-18 11:06:30 -0500 |
commit | 62b9c816a5000dc01b28e78213bde26b58cbca9d (patch) | |
tree | 15c1874f9ce12e9751b83584da40bf32629779f4 | |
parent | 1b43d4d92102ac8aa11fc5da566f28035232ec05 (diff) | |
download | meta-selinux-62b9c816a5000dc01b28e78213bde26b58cbca9d.tar.gz |
libselinux: upgrade 3.5 -> 3.6
* Refresh patches.
* Merge libselinux and libselinux-python.
The previous libselinux recipe was split into libselinux and
libselinux-python due to loop dependency[1]. Now this error is gone,
we can merge these two recipes into one again.
[1] https://git.yoctoproject.org/meta-selinux/commit/?id=7bb1507928f2e0f54ff8eac4135e15e821cdb1e2
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
-rw-r--r-- | recipes-security/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch | 10 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch | 8 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch | 21 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux_3.5.bb | 33 | ||||
-rw-r--r-- | recipes-security/selinux/libselinux_3.6.bb (renamed from recipes-security/selinux/libselinux-python_3.5.bb) | 20 |
5 files changed, 32 insertions, 60 deletions
diff --git a/recipes-security/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch b/recipes-security/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch index 1b9dfbb..b307b6f 100644 --- a/recipes-security/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch +++ b/recipes-security/selinux/libselinux/0001-Makefile-fix-python-modules-install-path-for-multili.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 57a087de68d6f7fe955268ee36b523cbe7c0c6db Mon Sep 17 00:00:00 2001 | 1 | From dff260851ccecf9723a6ddfce0103e09f3ba4613 Mon Sep 17 00:00:00 2001 |
2 | From: Yi Zhao <yi.zhao@windriver.com> | 2 | From: Yi Zhao <yi.zhao@windriver.com> |
3 | Date: Mon, 13 Apr 2020 12:44:23 +0800 | 3 | Date: Mon, 13 Apr 2020 12:44:23 +0800 |
4 | Subject: [PATCH] Makefile: fix python modules install path for multilib | 4 | Subject: [PATCH] Makefile: fix python modules install path for multilib |
@@ -11,15 +11,15 @@ Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | |||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 11 | 1 file changed, 1 insertion(+), 1 deletion(-) |
12 | 12 | ||
13 | diff --git a/src/Makefile b/src/Makefile | 13 | diff --git a/src/Makefile b/src/Makefile |
14 | index 36d5712..983f8af 100644 | 14 | index d3b981f..265f1be 100644 |
15 | --- a/src/Makefile | 15 | --- a/src/Makefile |
16 | +++ b/src/Makefile | 16 | +++ b/src/Makefile |
17 | @@ -187,7 +187,7 @@ install: all | 17 | @@ -191,7 +191,7 @@ install: all |
18 | ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET) | 18 | ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET) |
19 | 19 | ||
20 | install-pywrap: pywrap | 20 | install-pywrap: pywrap |
21 | - $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) . | 21 | - CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR) --ignore-installed --no-deps` $(PYTHON_SETUP_ARGS) . |
22 | + $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) . | 22 | + CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) . |
23 | install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py | 23 | install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py |
24 | ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) | 24 | ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) |
25 | 25 | ||
diff --git a/recipes-security/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch b/recipes-security/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch index cd5510d..7ebe64f 100644 --- a/recipes-security/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch +++ b/recipes-security/selinux/libselinux/0002-Do-not-use-PYCEXT-and-rely-on-the-installed-file-nam.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 1454521f2b9f2cbc3c40177aae9c260ec8966ae0 Mon Sep 17 00:00:00 2001 | 1 | From 303d8dfe53fcd02ea5818f976369cdb629bc1114 Mon Sep 17 00:00:00 2001 |
2 | From: Thomas Petazzoni <thomas.petazzoni@bootlin.com> | 2 | From: Thomas Petazzoni <thomas.petazzoni@bootlin.com> |
3 | Date: Fri, 25 Oct 2019 13:37:14 +0200 | 3 | Date: Fri, 25 Oct 2019 13:37:14 +0200 |
4 | Subject: [PATCH] Do not use PYCEXT, and rely on the installed file name | 4 | Subject: [PATCH] Do not use PYCEXT, and rely on the installed file name |
@@ -27,7 +27,7 @@ Signed-off-by: Changqing Li <changqing.li@windriver.com> | |||
27 | 1 file changed, 1 insertion(+), 2 deletions(-) | 27 | 1 file changed, 1 insertion(+), 2 deletions(-) |
28 | 28 | ||
29 | diff --git a/src/Makefile b/src/Makefile | 29 | diff --git a/src/Makefile b/src/Makefile |
30 | index 983f8af..3d777bb 100644 | 30 | index 265f1be..47e51d6 100644 |
31 | --- a/src/Makefile | 31 | --- a/src/Makefile |
32 | +++ b/src/Makefile | 32 | +++ b/src/Makefile |
33 | @@ -15,7 +15,6 @@ INCLUDEDIR ?= $(PREFIX)/include | 33 | @@ -15,7 +15,6 @@ INCLUDEDIR ?= $(PREFIX)/include |
@@ -38,9 +38,9 @@ index 983f8af..3d777bb 100644 | |||
38 | RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]') | 38 | RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + " -I" + RbConfig::CONFIG["rubyhdrdir"]') |
39 | RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]') | 39 | RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]') |
40 | RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]') | 40 | RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]') |
41 | @@ -189,7 +188,7 @@ install: all | 41 | @@ -193,7 +192,7 @@ install: all |
42 | install-pywrap: pywrap | 42 | install-pywrap: pywrap |
43 | $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) . | 43 | CFLAGS="$(CPPFLAGS) $(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) -m pip install --prefix=$(PREFIX) --root $(DESTDIR) --ignore-installed --no-deps $(PYTHON_SETUP_ARGS) . |
44 | install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py | 44 | install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py |
45 | - ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) | 45 | - ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT) |
46 | + ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/ | 46 | + ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux*.so $(DESTDIR)$(PYTHONLIBDIR)/ |
diff --git a/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch b/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch index 5b37395..0cd8f20 100644 --- a/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch +++ b/recipes-security/selinux/libselinux/0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From a822176c6f181d1e6989900dfc58bbdab6d9065a Mon Sep 17 00:00:00 2001 | 1 | From 6c2af45ec8cff9b282d599dc098db0ca127bdc59 Mon Sep 17 00:00:00 2001 |
2 | From: Renato Caldas <renato@calgera.com> | 2 | From: Renato Caldas <renato@calgera.com> |
3 | Date: Thu, 29 Jun 2023 13:59:11 +0100 | 3 | Date: Thu, 29 Jun 2023 13:59:11 +0100 |
4 | Subject: [PATCH] libselinux: restore: drop the obsolete LSF transitional API. | 4 | Subject: [PATCH] libselinux: restore: drop the obsolete LSF transitional API. |
@@ -10,23 +10,23 @@ Upstream-Status: Submitted [https://github.com/SELinuxProject/selinux/pull/401] | |||
10 | 10 | ||
11 | Signed-off-by: Renato Caldas <renato@calgera.com> | 11 | Signed-off-by: Renato Caldas <renato@calgera.com> |
12 | --- | 12 | --- |
13 | libselinux/src/selinux_restorecon.c | 4 ++-- | 13 | src/selinux_restorecon.c | 4 ++-- |
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | 14 | 1 file changed, 2 insertions(+), 2 deletions(-) |
15 | 15 | ||
16 | diff --git a/libselinux/src/selinux_restorecon.c b/libselinux/src/selinux_restorecon.c | 16 | diff --git a/src/selinux_restorecon.c b/src/selinux_restorecon.c |
17 | index 7ef2d45d..2ff920b0 100644 | 17 | index 38f10f1..5b3d035 100644 |
18 | --- a/src/selinux_restorecon.c | 18 | --- a/src/selinux_restorecon.c |
19 | +++ b/src/selinux_restorecon.c | 19 | +++ b/src/selinux_restorecon.c |
20 | @@ -437,7 +437,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, | 20 | @@ -436,7 +436,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, |
21 | file_spec_t *prevfl, *fl; | 21 | file_spec_t *prevfl, *fl; |
22 | uint32_t h; | 22 | uint32_t h; |
23 | int ret; | 23 | int ret; |
24 | - struct stat64 sb; | 24 | - struct stat64 sb; |
25 | + struct stat sb; | 25 | + struct stat sb; |
26 | 26 | ||
27 | __pthread_mutex_lock(&fl_mutex); | 27 | __pthread_mutex_lock(&fl_mutex); |
28 | 28 | ||
29 | @@ -451,7 +451,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, | 29 | @@ -450,7 +450,7 @@ static int filespec_add(ino_t ino, const char *con, const char *file, |
30 | for (prevfl = &fl_head[h], fl = fl_head[h].next; fl; | 30 | for (prevfl = &fl_head[h], fl = fl_head[h].next; fl; |
31 | prevfl = fl, fl = fl->next) { | 31 | prevfl = fl, fl = fl->next) { |
32 | if (ino == fl->ino) { | 32 | if (ino == fl->ino) { |
@@ -35,5 +35,6 @@ index 7ef2d45d..2ff920b0 100644 | |||
35 | if (ret < 0 || sb.st_ino != ino) { | 35 | if (ret < 0 || sb.st_ino != ino) { |
36 | freecon(fl->con); | 36 | freecon(fl->con); |
37 | free(fl->file); | 37 | free(fl->file); |
38 | -- | 38 | -- |
39 | 2.41.0 | 39 | 2.25.1 |
40 | |||
diff --git a/recipes-security/selinux/libselinux_3.5.bb b/recipes-security/selinux/libselinux_3.5.bb deleted file mode 100644 index 37383eb..0000000 --- a/recipes-security/selinux/libselinux_3.5.bb +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | SUMMARY = "SELinux library and simple utilities" | ||
2 | DESCRIPTION = "libselinux provides an API for SELinux applications to get and set \ | ||
3 | process and file security contexts and to obtain security policy \ | ||
4 | decisions. Required for any applications that use the SELinux API." | ||
5 | SECTION = "base" | ||
6 | LICENSE = "PD" | ||
7 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | ||
8 | |||
9 | require selinux_common.inc | ||
10 | |||
11 | inherit lib_package pkgconfig | ||
12 | |||
13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" | ||
14 | SRC_URI += "\ | ||
15 | file://0003-libselinux-restore-drop-the-obsolete-LSF-transitiona.patch \ | ||
16 | " | ||
17 | |||
18 | DEPENDS = "libsepol libpcre2" | ||
19 | DEPENDS:append:libc-musl = " fts" | ||
20 | |||
21 | S = "${WORKDIR}/git/libselinux" | ||
22 | |||
23 | def get_policyconfigarch(d): | ||
24 | import re | ||
25 | target = d.getVar('TARGET_ARCH') | ||
26 | p = re.compile('i.86') | ||
27 | target = p.sub('i386',target) | ||
28 | return "ARCH=%s" % (target) | ||
29 | |||
30 | EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" | ||
31 | EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" | ||
32 | |||
33 | BBCLASSEXTEND = "native" | ||
diff --git a/recipes-security/selinux/libselinux-python_3.5.bb b/recipes-security/selinux/libselinux_3.6.bb index b382be1..dab4965 100644 --- a/recipes-security/selinux/libselinux-python_3.5.bb +++ b/recipes-security/selinux/libselinux_3.6.bb | |||
@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=84b4d2c6ef954a2d4081e775a270d0d0" | |||
8 | 8 | ||
9 | require selinux_common.inc | 9 | require selinux_common.inc |
10 | 10 | ||
11 | inherit python3targetconfig pkgconfig | 11 | inherit lib_package pkgconfig python3targetconfig |
12 | 12 | ||
13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" | 13 | FILESEXTRAPATHS:prepend := "${THISDIR}/libselinux:" |
14 | SRC_URI += "\ | 14 | SRC_URI += "\ |
@@ -22,8 +22,6 @@ S = "${WORKDIR}/git/libselinux" | |||
22 | DEPENDS = "libsepol libpcre2 swig-native python3-setuptools-scm-native" | 22 | DEPENDS = "libsepol libpcre2 swig-native python3-setuptools-scm-native" |
23 | DEPENDS:append:libc-musl = " fts" | 23 | DEPENDS:append:libc-musl = " fts" |
24 | 24 | ||
25 | RDEPENDS:${PN} = "libselinux python3-core python3-shell" | ||
26 | |||
27 | def get_policyconfigarch(d): | 25 | def get_policyconfigarch(d): |
28 | import re | 26 | import re |
29 | target = d.getVar('TARGET_ARCH') | 27 | target = d.getVar('TARGET_ARCH') |
@@ -34,19 +32,17 @@ def get_policyconfigarch(d): | |||
34 | EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" | 32 | EXTRA_OEMAKE = "${@get_policyconfigarch(d)}" |
35 | EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" | 33 | EXTRA_OEMAKE:append:libc-musl = " FTS_LDLIBS=-lfts" |
36 | 34 | ||
37 | FILES:${PN} = "${PYTHON_SITEPACKAGES_DIR}/*" | 35 | do_compile:append() { |
38 | INSANE_SKIP:${PN} = "dev-so" | ||
39 | |||
40 | do_compile() { | ||
41 | oe_runmake pywrap -j1 \ | 36 | oe_runmake pywrap -j1 \ |
42 | PYLIBVER='python${PYTHON_BASEVERSION}' \ | 37 | PYLIBVER='python${PYTHON_BASEVERSION}' \ |
43 | PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \ | 38 | PYINC='-I${STAGING_INCDIR}/${PYLIBVER}' \ |
44 | PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}' | 39 | PYLIBS='-L${STAGING_LIBDIR}/${PYLIBVER} -l${PYLIBVER}' |
45 | } | 40 | } |
46 | 41 | ||
47 | do_install() { | 42 | do_install:append() { |
48 | oe_runmake install-pywrap \ | 43 | oe_runmake install-pywrap \ |
49 | DESTDIR=${D} \ | 44 | DESTDIR=${D} \ |
45 | PREFIX=${prefix} | ||
50 | PYLIBVER='python${PYTHON_BASEVERSION}' \ | 46 | PYLIBVER='python${PYTHON_BASEVERSION}' \ |
51 | PYTHONLIBDIR='${PYTHON_SITEPACKAGES_DIR}' | 47 | PYTHONLIBDIR='${PYTHON_SITEPACKAGES_DIR}' |
52 | 48 | ||
@@ -54,3 +50,11 @@ do_install() { | |||
54 | sed -i -e 's,${WORKDIR},,g' \ | 50 | sed -i -e 's,${WORKDIR},,g' \ |
55 | ${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/direct_url.json | 51 | ${D}${PYTHON_SITEPACKAGES_DIR}/selinux-${PV}.dist-info/direct_url.json |
56 | } | 52 | } |
53 | |||
54 | PACKAGES += "${PN}-python" | ||
55 | RDEPENDS:${PN}-python = "python3-core python3-shell" | ||
56 | |||
57 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/*" | ||
58 | INSANE_SKIP:${PN}-python = "dev-so" | ||
59 | |||
60 | BBCLASSEXTEND = "native" | ||