* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libselinux/files/
@ 2017-10-10 6:46 Jason Zaman
0 siblings, 0 replies; 3+ messages in thread
From: Jason Zaman @ 2017-10-10 6:46 UTC (permalink / raw
To: gentoo-commits
commit: 76eb43412b532a045d92d524dfa5ed1b1bcca671
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Sun Oct 1 13:47:28 2017 +0000
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Mon Oct 9 18:45:09 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76eb4341
sys-libs/libselinux: remove unused patches
.../0005-use-ruby-include-with-rubylibver.patch | 12 --
...07-build-related-fixes-bug-500674-for-2.5.patch | 69 -----------
...nux-2.5-0001-only-mount-proc-if-necessary.patch | 54 ---------
...ing-proc-outside-of-selinux_init_load_pol.patch | 129 ---------------------
...5-0003-Change-the-location-of-_selinux.so.patch | 44 -------
5 files changed, 308 deletions(-)
diff --git a/sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch b/sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch
deleted file mode 100644
index 0fc84141a3d..00000000000
--- a/sys-libs/libselinux/files/0005-use-ruby-include-with-rubylibver.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -uNr libselinux-2.2.2.orig/src/Makefile libselinux-2.2.2/src/Makefile
---- libselinux-2.2.2.orig/src/Makefile 2013-11-06 20:56:30.000000000 +0100
-+++ libselinux-2.2.2/src/Makefile 2013-11-25 21:02:05.327561766 +0100
-@@ -16,7 +16,7 @@
- PYLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
- RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
- RUBYPLATFORM ?= $(shell $(RUBY) -e 'print RUBY_PLATFORM')
--RUBYINC ?= $(shell pkg-config --cflags ruby)
-+RUBYINC ?= $(shell pkg-config --cflags ruby-$(RUBYLIBVER))
- RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
- LIBBASE ?= $(shell basename $(LIBDIR))
-
diff --git a/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch b/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch
deleted file mode 100644
index 67e47ad40a6..00000000000
--- a/sys-libs/libselinux/files/0007-build-related-fixes-bug-500674-for-2.5.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-https://bugs.gentoo.org/500674
-
-random fixes:
-- make sure PCRE_CFLAGS get used
-- use PCRE_LIBS via pkg-config
-- move LDFLAGS to before objects, not after
-- do not hardcode -L$(LIBDIR) (let the toolchain handle it)
-- do not hardcode -I$(INCLUDEDIR) (let the toolchain handle it)
-
-diff -uNr libselinux-2.5.orig/src/Makefile libselinux-2.5/src/Makefile
---- libselinux-2.5.orig/src/Makefile 2016-03-13 19:27:07.091000000 +0100
-+++ libselinux-2.5/src/Makefile 2016-03-13 19:27:16.495000000 +0100
-@@ -73,7 +73,7 @@
- -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
- -Werror -Wno-aggregate-return -Wno-redundant-decls
-
--override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(EMFLAGS)
-+override CFLAGS += -I../include $(PCRE_CFLAGS) -D_GNU_SOURCE $(EMFLAGS)
-
- SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \
- -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations
-@@ -102,17 +102,17 @@
- $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
-
- $(SWIGSO): $(SWIGLOBJ)
-- $(CC) $(CFLAGS) -shared -o $@ $< -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux
-
- $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
-- $(CC) $(CFLAGS) -shared -o $@ $^ -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux
-
- $(LIBA): $(OBJS)
- $(AR) rcs $@ $^
- $(RANLIB) $@
-
- $(LIBSO): $(LOBJS)
-- $(CC) $(CFLAGS) -shared -o $@ $^ -lpcre -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -ldl $(PCRE_LIBS) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
- ln -sf $@ $(TARGET)
-
- $(LIBPC): $(LIBPC).in ../VERSION
-@@ -125,7 +125,7 @@
- $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
-
- $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
-- $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a
-
- %.o: %.c policy.h
- $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
-diff -uNr libselinux-2.5.orig/utils/Makefile libselinux-2.5/utils/Makefile
---- libselinux-2.5.orig/utils/Makefile 2016-03-13 19:27:07.102000000 +0100
-+++ libselinux-2.5/utils/Makefile 2016-03-13 19:27:40.297000000 +0100
-@@ -24,11 +24,12 @@
- -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
- -Werror -Wno-aggregate-return -Wno-redundant-decls
- override CFLAGS += -I../include -D_GNU_SOURCE $(EMFLAGS)
--LDLIBS += -L../src -lselinux -L$(LIBDIR)
-+LDLIBS += -L../src -lselinux
-
- TARGETS=$(patsubst %.c,%,$(wildcard *.c))
-
--sefcontext_compile: LDLIBS += -lpcre ../src/libselinux.a -lsepol
-+sefcontext_compile: CFLAGS += $(PCRE_FLAGS)
-+sefcontext_compile: LDLIBS += $(PCRE_LIBS) -lsepol ../src/libselinux.a
-
- selinux_restorecon: LDLIBS += -lsepol
-
diff --git a/sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch b/sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch
deleted file mode 100644
index dfa6a0fa555..00000000000
--- a/sys-libs/libselinux/files/libselinux-2.5-0001-only-mount-proc-if-necessary.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 5a8d8c499b2ef80eaa7b5abe2ec68d7101e613bf Mon Sep 17 00:00:00 2001
-From: Stephen Smalley <sds@tycho.nsa.gov>
-Date: Mon, 29 Feb 2016 10:10:55 -0500
-Subject: [PATCH] libselinux: only mount /proc if necessary
-
-Commit 9df498884665d ("libselinux: Mount procfs before checking
-/proc/filesystems") changed selinuxfs_exists() to always try
-mounting /proc before reading /proc/filesystems. However, this is
-unnecessary if /proc is already mounted and can produce avc denials
-if the process is not allowed to perform the mount. Check first
-to see if /proc is already present and only try the mount if it is not.
-
-Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
----
- libselinux/src/init.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/libselinux/src/init.c b/libselinux/src/init.c
-index 3db4de0..3530594 100644
---- libselinux/src/init.c
-+++ libselinux/src/init.c
-@@ -12,6 +12,7 @@
- #include <stdint.h>
- #include <limits.h>
- #include <sys/mount.h>
-+#include <linux/magic.h>
-
- #include "dso.h"
- #include "policy.h"
-@@ -57,13 +58,19 @@ static int verify_selinuxmnt(const char *mnt)
-
- int selinuxfs_exists(void)
- {
-- int exists = 0, mnt_rc = 0;
-+ int exists = 0, mnt_rc = -1, rc;
-+ struct statfs sb;
- FILE *fp = NULL;
- char *buf = NULL;
- size_t len;
- ssize_t num;
-
-- mnt_rc = mount("proc", "/proc", "proc", 0, 0);
-+ do {
-+ rc = statfs("/proc", &sb);
-+ } while (rc < 0 && errno == EINTR);
-+
-+ if (rc == 0 && ((uint32_t)sb.f_type != (uint32_t)PROC_SUPER_MAGIC))
-+ mnt_rc = mount("proc", "/proc", "proc", 0, 0);
-
- fp = fopen("/proc/filesystems", "r");
- if (!fp) {
---
-2.7.3
-
diff --git a/sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch b/sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch
deleted file mode 100644
index c811450ba39..00000000000
--- a/sys-libs/libselinux/files/libselinux-2.5-0002-Avoid-mounting-proc-outside-of-selinux_init_load_pol.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-From 32773a99b1f0cf2b61b5f5a33359684b18aab1ed Mon Sep 17 00:00:00 2001
-From: Stephen Smalley <sds@tycho.nsa.gov>
-Date: Fri, 13 May 2016 11:59:47 -0400
-Subject: [PATCH] Avoid mounting /proc outside of selinux_init_load_policy().
-
-Temporarily mounting /proc within selinuxfs_exists() can cause
-problems since it can be called by a libselinux constructor and
-therefore may be invoked by every program linked with libselinux.
-Since this was only motivated originally by a situation where
-selinuxfs_exists() was called from selinux_init_load_policy()
-before /proc was mounted, fix it in selinux_init_load_policy() instead.
-
-This reverts commit 5a8d8c499b2ef80eaa7b5abe2ec68d7101e613bf
-("libselinux: only mount /proc if necessary") and
-commit 9df498884665d79474b79f0f30d1cd67df11bd3e
-("libselinux: Mount procfs before checking /proc/filesystems").
-
-Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
----
- libselinux/src/init.c | 27 +++------------------------
- libselinux/src/load_policy.c | 15 ++++++++++-----
- 2 files changed, 13 insertions(+), 29 deletions(-)
-
-diff --git a/libselinux/src/init.c b/libselinux/src/init.c
-index 3530594..3c687a2 100644
---- libselinux/src/init.c
-+++ libselinux/src/init.c
-@@ -11,8 +11,6 @@
- #include <sys/vfs.h>
- #include <stdint.h>
- #include <limits.h>
--#include <sys/mount.h>
--#include <linux/magic.h>
-
- #include "dso.h"
- #include "policy.h"
-@@ -58,26 +56,15 @@ static int verify_selinuxmnt(const char *mnt)
-
- int selinuxfs_exists(void)
- {
-- int exists = 0, mnt_rc = -1, rc;
-- struct statfs sb;
-+ int exists = 0;
- FILE *fp = NULL;
- char *buf = NULL;
- size_t len;
- ssize_t num;
-
-- do {
-- rc = statfs("/proc", &sb);
-- } while (rc < 0 && errno == EINTR);
--
-- if (rc == 0 && ((uint32_t)sb.f_type != (uint32_t)PROC_SUPER_MAGIC))
-- mnt_rc = mount("proc", "/proc", "proc", 0, 0);
--
- fp = fopen("/proc/filesystems", "r");
-- if (!fp) {
-- exists = 1; /* Fail as if it exists */
-- goto out;
-- }
--
-+ if (!fp)
-+ return 1; /* Fail as if it exists */
- __fsetlocking(fp, FSETLOCKING_BYCALLER);
-
- num = getline(&buf, &len, fp);
-@@ -91,14 +78,6 @@ int selinuxfs_exists(void)
-
- free(buf);
- fclose(fp);
--
--out:
--#ifndef MNT_DETACH
--#define MNT_DETACH 2
--#endif
-- if (mnt_rc == 0)
-- umount2("/proc", MNT_DETACH);
--
- return exists;
- }
- hidden_def(selinuxfs_exists)
-diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
-index 21ee58b..4f39fc7 100644
---- libselinux/src/load_policy.c
-+++ libselinux/src/load_policy.c
-@@ -17,6 +17,10 @@
- #include "policy.h"
- #include <limits.h>
-
-+#ifndef MNT_DETACH
-+#define MNT_DETACH 2
-+#endif
-+
- int security_load_policy(void *data, size_t len)
- {
- char path[PATH_MAX];
-@@ -348,11 +352,6 @@ int selinux_init_load_policy(int *enforce)
- fclose(cfg);
- free(buf);
- }
--#ifndef MNT_DETACH
--#define MNT_DETACH 2
--#endif
-- if (rc == 0)
-- umount2("/proc", MNT_DETACH);
-
- /*
- * Determine the final desired mode.
-@@ -400,11 +399,17 @@ int selinux_init_load_policy(int *enforce)
- /* Only emit this error if selinux was not disabled */
- fprintf(stderr, "Mount failed for selinuxfs on %s: %s\n", SELINUXMNT, strerror(errno));
- }
-+
-+ if (rc == 0)
-+ umount2("/proc", MNT_DETACH);
-
- goto noload;
- }
- set_selinuxmnt(mntpoint);
-
-+ if (rc == 0)
-+ umount2("/proc", MNT_DETACH);
-+
- /*
- * Note: The following code depends on having selinuxfs
- * already mounted and selinuxmnt set above.
---
-2.7.3
-
diff --git a/sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch b/sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch
deleted file mode 100644
index 542acfdc243..00000000000
--- a/sys-libs/libselinux/files/libselinux-2.5-0003-Change-the-location-of-_selinux.so.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From a9604c30a5e2f71007d31aa6ba41cf7b95d94822 Mon Sep 17 00:00:00 2001
-From: Petr Lautrbach <plautrba@redhat.com>
-Date: Mon, 27 Jun 2016 10:46:13 +0200
-Subject: [PATCH] libselinux: Change the location of _selinux.so
-
-There was a change in swig-3.10 to use importlib instead of imp. While
-the implementation with imp looked for _selinux.so also into the same directory
-as __init__.py is, a new module with importlib searchs only standard paths.
-It means that we need to move _selinux.so from $(PYLIBDIR)/site-packages/selinux/
-to $(PYLIBDIR)/site-packages/.
-
-Fixes:
->>> import selinux
-Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 21, in <module>
- _selinux = swig_import_helper()
- File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 20, in swig_import_helper
- return importlib.import_module('_selinux')
- File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
- __import__(name)
-ImportError: No module named _selinux
-
-Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
----
- libselinux/src/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
-index d94163e..37d01af 100644
---- libselinux/src/Makefile
-+++ libselinux/src/Makefile
-@@ -156,7 +156,7 @@ install: all
-
- install-pywrap: pywrap
- test -d $(PYLIBDIR)/site-packages/selinux || install -m 755 -d $(PYLIBDIR)/site-packages/selinux
-- install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/selinux/_selinux.so
-+ install -m 755 $(SWIGSO) $(PYLIBDIR)/site-packages/_selinux.so
- install -m 755 $(AUDIT2WHYSO) $(PYLIBDIR)/site-packages/selinux/audit2why.so
- install -m 644 $(SWIGPYOUT) $(PYLIBDIR)/site-packages/selinux/__init__.py
-
---
-2.7.3
-
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libselinux/files/
@ 2018-05-27 16:11 Aaron Bauman
0 siblings, 0 replies; 3+ messages in thread
From: Aaron Bauman @ 2018-05-27 16:11 UTC (permalink / raw
To: gentoo-commits
commit: 11c3c8ee81bcbd256e05d1e1c7319fc419d4a095
Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Sun May 27 11:58:49 2018 +0000
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
CommitDate: Sun May 27 16:09:30 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11c3c8ee
sys-libs/libselinux: remove unused patch(es)
...x-2.6-0007-build-related-fixes-bug-500674.patch | 91 ----------------------
1 file changed, 91 deletions(-)
diff --git a/sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch b/sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch
deleted file mode 100644
index 83596e8e0a7..00000000000
--- a/sys-libs/libselinux/files/libselinux-2.6-0007-build-related-fixes-bug-500674.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-https://bugs.gentoo.org/500674
-
-random fixes:
-- make sure PCRE_CFLAGS get used
-- use PCRE_LIBS via pkg-config
-- move LDFLAGS to before objects, not after
-- do not hardcode -L$(LIBDIR) (let the toolchain handle it)
-- do not hardcode -I$(INCLUDEDIR) (let the toolchain handle it)
-
-diff --git a/libselinux/Makefile b/libselinux/Makefile
-index baa0db3..4dc5aa0 100644
---- libselinux/Makefile
-+++ libselinux/Makefile
-@@ -1,5 +1,6 @@
- SUBDIRS = src include utils man
-
-+PKG_CONFIG ?= pkg-config
- DISABLE_SETRANS ?= n
- DISABLE_RPM ?= n
- ANDROID_HOST ?= n
-@@ -20,10 +21,11 @@ export DISABLE_SETRANS DISABLE_RPM DISABLE_FLAGS ANDROID_HOST
-
- USE_PCRE2 ?= n
- ifeq ($(USE_PCRE2),y)
-- PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8
-- PCRE_LDFLAGS := -lpcre2-8
-+ PCRE_CFLAGS := -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 $(shell $(PKG_CONFIG) --cflags libpcre2-8)
-+ PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre2-8)
- else
-- PCRE_LDFLAGS := -lpcre
-+ PCRE_CFLAGS := $(shell $(PKG_CONFIG) --cflags libpcre)
-+ PCRE_LDFLAGS := $(shell $(PKG_CONFIG) --libs libpcre)
- endif
- export PCRE_CFLAGS PCRE_LDFLAGS
-
-diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
-index 13501cd..42cb2f6 100644
---- libselinux/src/Makefile
-+++ libselinux/src/Makefile
-@@ -67,7 +67,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi
-
- PCRE_LDFLAGS ?= -lpcre
-
--override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
-+override CFLAGS += -I../include -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
-
- SWIG_CFLAGS += -Wno-error -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter \
- -Wno-shadow -Wno-uninitialized -Wno-missing-prototypes -Wno-missing-declarations
-@@ -107,17 +107,17 @@ $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
- $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
-
- $(SWIGSO): $(SWIGLOBJ)
-- $(CC) $(CFLAGS) -shared -o $@ $< -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< -L. -lselinux
-
- $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
-- $(CC) $(CFLAGS) -shared -o $@ $^ -L. -lselinux $(LDFLAGS) -L$(LIBDIR)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux
-
- $(LIBA): $(OBJS)
- $(AR) rcs $@ $^
- $(RANLIB) $@
-
- $(LIBSO): $(LOBJS)
-- $(CC) $(CFLAGS) -shared -o $@ $^ $(PCRE_LDFLAGS) -ldl $(LDFLAGS) -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs,-z,relro
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ $(PCRE_LDFLAGS) -ldl -Wl,-soname,$(LIBSO),-z,defs,-z,relro
- ln -sf $@ $(TARGET)
-
- $(LIBPC): $(LIBPC).in ../VERSION
-@@ -130,7 +130,7 @@ $(AUDIT2WHYLOBJ): audit2why.c
- $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
-
- $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
-- $(CC) $(CFLAGS) -shared -o $@ $^ -L. $(LDFLAGS) -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
-+ $(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a
-
- %.o: %.c policy.h
- $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
-diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
-index e56a953..6fd205a 100644
---- libselinux/utils/Makefile
-+++ libselinux/utils/Makefile
-@@ -25,7 +25,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi
- -fipa-pure-const -Wno-suggest-attribute=pure -Wno-suggest-attribute=const \
- -Werror -Wno-aggregate-return -Wno-redundant-decls
- override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE $(DISABLE_FLAGS) $(PCRE_CFLAGS)
--LDLIBS += -L../src -lselinux -L$(LIBDIR)
-+LDLIBS += -L../src -lselinux
- PCRE_LDFLAGS ?= -lpcre
-
- ifeq ($(ANDROID_HOST),y)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libselinux/files/
@ 2021-02-27 15:38 Conrad Kostecki
0 siblings, 0 replies; 3+ messages in thread
From: Conrad Kostecki @ 2021-02-27 15:38 UTC (permalink / raw
To: gentoo-commits
commit: a9d90852c5246ec40f4c80eb53692ef86cf8063d
Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Mon Feb 22 16:35:18 2021 +0000
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sat Feb 27 15:35:14 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9d90852
sys-libs/libselinux: remove unused patch(es)
Closes: https://github.com/gentoo/gentoo/pull/19601
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
...Use-Python-distutils-to-install-SELinux-p.patch | 205 ---------------------
1 file changed, 205 deletions(-)
diff --git a/sys-libs/libselinux/files/0001-libselinux-Use-Python-distutils-to-install-SELinux-p.patch b/sys-libs/libselinux/files/0001-libselinux-Use-Python-distutils-to-install-SELinux-p.patch
deleted file mode 100644
index 896876a00d6..00000000000
--- a/sys-libs/libselinux/files/0001-libselinux-Use-Python-distutils-to-install-SELinux-p.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-From 2efa06857575e4118e91ca250b6b92da68b130d5 Mon Sep 17 00:00:00 2001
-From: Petr Lautrbach <plautrba@redhat.com>
-Date: Fri, 7 Jun 2019 17:35:44 +0200
-Subject: [PATCH] libselinux: Use Python distutils to install SELinux python
- bindings
-
-Follow officially documented way how to build C extension modules using
-distutils - https://docs.python.org/3.8/extending/building.html#building
-
-Fixes:
-
-- selinux python module fails to load when it's built using SWIG-4.0:
-
->>> import selinux
-Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/usr/lib64/python3.7/site-packages/selinux/__init__.py", line 13, in <module>
- from . import _selinux
-ImportError: cannot import name '_selinux' from 'selinux' (/usr/lib64/python3.7/site-packages/selinux/__init__.py)
-
-SWIG-4.0 changed (again?) its behavior so that it uses: from . import _selinux
-which looks for _selinux module in the same directory as where __init__.py is -
-$(PYLIBDIR)/site-packages/selinux. But _selinux module is installed into
-$(PYLIBDIR)/site-packages/ since a9604c30a5e2f ("libselinux: Change the location
-of _selinux.so").
-
-- audit2why python module fails to build with Python 3.8
-
-cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DOVERRIDE_GETTID=0 -I../include -D_GNU_SOURCE -DDISABLE_RPM -DNO_ANDROID_BACKEND -DUSE_PCRE2 -DPCRE2_CODE_UNIT_WIDTH=8 -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -L. -shared -o python-3.8audit2why.so python-3.8audit2why.lo -lselinux -l:libsepol.a -Wl,-soname,audit2why.so,--version-script=audit2why.map,-z,defs
-/usr/bin/ld: python-3.8audit2why.lo: in function `finish':
-/builddir/build/BUILD/libselinux-2.9/src/audit2why.c:166: undefined reference to `PyArg_ParseTuple'
-/usr/bin/ld: python-3.8audit2why.lo: in function `_Py_INCREF':
-/usr/include/python3.8/object.h:449: undefined reference to `_Py_NoneStruct'
-/usr/bin/ld: /usr/include/python3.8/object.h:449: undefined reference to `_Py_NoneStruct'
-/usr/bin/ld: python-3.8audit2why.lo: in function `check_booleans':
-/builddir/build/BUILD/libselinux-2.9/src/audit2why.c:84: undefined reference to `PyExc_RuntimeError'
-...
-
-It's related to the following Python change
-https://docs.python.org/dev/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build
-
-Python distutils adds correct link options automatically.
-
-- selinux python module doesn't provide any Python metadata
-
-When selinux python module was built manually, it didn't provide any metadata.
-distutils takes care about that so that selinux Python module is visible for
-pip:
-
-$ pip3 list | grep selinux
-selinux 2.9
-
-Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
----
- libselinux/src/.gitignore | 2 +-
- libselinux/src/Makefile | 36 ++++++++----------------------------
- libselinux/src/setup.py | 24 ++++++++++++++++++++++++
- 3 files changed, 33 insertions(+), 29 deletions(-)
- create mode 100644 libselinux/src/setup.py
-
-diff --git libselinux/src/.gitignore libselinux/src/.gitignore
-index 4dcc3b3b..428afe5a 100644
---- libselinux/src/.gitignore
-+++ libselinux/src/.gitignore
-@@ -1,4 +1,4 @@
- selinux.py
--selinuxswig_wrap.c
-+selinuxswig_python_wrap.c
- selinuxswig_python_exception.i
- selinuxswig_ruby_wrap.c
-diff --git libselinux/src/Makefile libselinux/src/Makefile
-index e9ed0383..2b1696a0 100644
---- libselinux/src/Makefile
-+++ libselinux/src/Makefile
-@@ -36,7 +36,7 @@ TARGET=libselinux.so
- LIBPC=libselinux.pc
- SWIGIF= selinuxswig_python.i selinuxswig_python_exception.i
- SWIGRUBYIF= selinuxswig_ruby.i
--SWIGCOUT= selinuxswig_wrap.c
-+SWIGCOUT= selinuxswig_python_wrap.c
- SWIGPYOUT= selinux.py
- SWIGRUBYCOUT= selinuxswig_ruby_wrap.c
- SWIGLOBJ:= $(patsubst %.c,$(PYPREFIX)%.lo,$(SWIGCOUT))
-@@ -55,7 +55,7 @@ ifeq ($(LIBSEPOLA),)
- LDLIBS_LIBSEPOLA := -l:libsepol.a
- endif
-
--GENERATED=$(SWIGCOUT) $(SWIGRUBYCOUT) selinuxswig_python_exception.i
-+GENERATED=$(SWIGCOUT) $(SWIGRUBYCOUT) $(SWIGCOUT) selinuxswig_python_exception.i
- SRCS= $(filter-out $(GENERATED) audit2why.c, $(sort $(wildcard *.c)))
-
- MAX_STACK_SIZE=32768
-@@ -125,25 +125,18 @@ DISABLE_FLAGS+= -DNO_ANDROID_BACKEND
- SRCS:= $(filter-out label_backends_android.c, $(SRCS))
- endif
-
--SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ $(DISABLE_FLAGS)
--
- SWIGRUBY = swig -Wall -ruby -o $(SWIGRUBYCOUT) -outdir ./ $(DISABLE_FLAGS)
-
- all: $(LIBA) $(LIBSO) $(LIBPC)
-
--pywrap: all $(SWIGFILES) $(AUDIT2WHYSO)
-+pywrap: all selinuxswig_python_exception.i
-+ CFLAGS="$(CFLAGS) $(SWIG_CFLAGS)" $(PYTHON) setup.py build_ext -I $(DESTDIR)$(INCLUDEDIR) -L $(DESTDIR)$(LIBDIR)
-
- rubywrap: all $(SWIGRUBYSO)
-
--$(SWIGLOBJ): $(SWIGCOUT)
-- $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(PYINC) -fPIC -DSHARED -c -o $@ $<
--
- $(SWIGRUBYLOBJ): $(SWIGRUBYCOUT)
- $(CC) $(CFLAGS) $(SWIG_CFLAGS) $(RUBYINC) -fPIC -DSHARED -c -o $@ $<
-
--$(SWIGSO): $(SWIGLOBJ)
-- $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $< -lselinux $(PYLIBS)
--
- $(SWIGRUBYSO): $(SWIGRUBYLOBJ)
- $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $^ -lselinux $(RUBYLIBS)
-
-@@ -161,29 +154,15 @@ $(LIBPC): $(LIBPC).in ../VERSION
- selinuxswig_python_exception.i: ../include/selinux/selinux.h
- bash -e exception.sh > $@ || (rm -f $@ ; false)
-
--$(AUDIT2WHYLOBJ): audit2why.c
-- $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $<
--
--$(AUDIT2WHYSO): $(AUDIT2WHYLOBJ) $(LIBSEPOLA)
-- $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $^ -lselinux $(LDLIBS_LIBSEPOLA) $(PYLIBS) -Wl,-soname,audit2why.so,--version-script=audit2why.map,-z,defs
--
- %.o: %.c policy.h
- $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
-
- %.lo: %.c policy.h
- $(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
-
--$(SWIGCOUT): $(SWIGIF)
-- $(SWIG) $<
--
--$(SWIGPYOUT): $(SWIGCOUT)
--
- $(SWIGRUBYCOUT): $(SWIGRUBYIF)
- $(SWIGRUBY) $<
-
--swigify: $(SWIGIF)
-- $(SWIG) $<
--
- install: all
- test -d $(DESTDIR)$(LIBDIR) || install -m 755 -d $(DESTDIR)$(LIBDIR)
- install -m 644 $(LIBA) $(DESTDIR)$(LIBDIR)
-@@ -194,10 +173,9 @@ install: all
- ln -sf --relative $(DESTDIR)$(SHLIBDIR)/$(LIBSO) $(DESTDIR)$(LIBDIR)/$(TARGET)
-
- install-pywrap: pywrap
-- test -d $(DESTDIR)$(PYTHONLIBDIR)/selinux || install -m 755 -d $(DESTDIR)$(PYTHONLIBDIR)/selinux
-- install -m 755 $(SWIGSO) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
-- install -m 755 $(AUDIT2WHYSO) $(DESTDIR)$(PYTHONLIBDIR)/selinux/audit2why$(PYCEXT)
-+ $(PYTHON) setup.py install --prefix=$(PREFIX) `test -n "$(DESTDIR)" && echo --root $(DESTDIR)`
- install -m 644 $(SWIGPYOUT) $(DESTDIR)$(PYTHONLIBDIR)/selinux/__init__.py
-+ ln -sf --relative $(DESTDIR)$(PYTHONLIBDIR)/selinux/_selinux$(PYCEXT) $(DESTDIR)$(PYTHONLIBDIR)/_selinux$(PYCEXT)
-
- install-rubywrap: rubywrap
- test -d $(DESTDIR)$(RUBYINSTALL) || install -m 755 -d $(DESTDIR)$(RUBYINSTALL)
-@@ -208,6 +186,8 @@ relabel:
-
- clean-pywrap:
- -rm -f $(SWIGLOBJ) $(SWIGSO) $(AUDIT2WHYLOBJ) $(AUDIT2WHYSO)
-+ $(PYTHON) setup.py clean
-+ -rm -rf build *~ \#* *pyc .#*
-
- clean-rubywrap:
- -rm -f $(SWIGRUBYLOBJ) $(SWIGRUBYSO)
-diff --git libselinux/src/setup.py libselinux/src/setup.py
-new file mode 100644
-index 00000000..4dc03f55
---- /dev/null
-+++ libselinux/src/setup.py
-@@ -0,0 +1,24 @@
-+#!/usr/bin/python3
-+
-+from distutils.core import Extension, setup
-+
-+setup(
-+ name="selinux",
-+ version="2.9",
-+ description="SELinux python 3 bindings",
-+ author="SELinux Project",
-+ author_email="selinux@vger.kernel.org",
-+ ext_modules=[
-+ Extension('selinux._selinux',
-+ sources=['selinuxswig_python.i'],
-+ include_dirs=['../include'],
-+ library_dirs=['.'],
-+ libraries=['selinux']),
-+ Extension('selinux.audit2why',
-+ sources=['audit2why.c'],
-+ include_dirs=['../include'],
-+ library_dirs=['.'],
-+ libraries=['selinux'],
-+ extra_link_args=['-l:libsepol.a', '-Wl,--version-script=audit2why.map'])
-+ ],
-+)
---
-2.21.0
-
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-27 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-27 16:11 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libselinux/files/ Aaron Bauman
-- strict thread matches above, loose matches on Subject: below --
2021-02-27 15:38 Conrad Kostecki
2017-10-10 6:46 Jason Zaman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox