From 7958a6be5cbac7ab779e6b6693ac316d4800d312 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 13 Feb 2013 23:56:38 +0100 Subject: libselinux: add support for python wrapper Signed-off-by: Marc Kleine-Budde --- ...e-use-python-config-instead-of-pkg-config.patch | 24 ++++++++++++++++++++++ patches/libselinux-2.1.12/series | 3 ++- rules/libselinux.in | 13 ++++++++++-- rules/libselinux.make | 21 +++++++++++++++++-- 4 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 patches/libselinux-2.1.12/0006-makefile-use-python-config-instead-of-pkg-config.patch diff --git a/patches/libselinux-2.1.12/0006-makefile-use-python-config-instead-of-pkg-config.patch b/patches/libselinux-2.1.12/0006-makefile-use-python-config-instead-of-pkg-config.patch new file mode 100644 index 000000000..907c79880 --- /dev/null +++ b/patches/libselinux-2.1.12/0006-makefile-use-python-config-instead-of-pkg-config.patch @@ -0,0 +1,24 @@ +From: Marc Kleine-Budde +Date: Wed, 13 Feb 2013 23:14:46 +0100 +Subject: [PATCH] makefile: use python-config instead of pkg-config + +...because our python has no pkg-config yet. + +Signed-off-by: Marc Kleine-Budde +--- + src/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 109d372..e963009 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -12,7 +12,7 @@ LIBDIR ?= $(PREFIX)/lib + SHLIBDIR ?= $(DESTDIR)/lib + INCLUDEDIR ?= $(PREFIX)/include + PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])') +-PYINC ?= $(shell pkg-config --cflags $(PYPREFIX)) ++PYINC ?= $(shell $(PYTHON)-config --cflags) + PYLIBDIR ?= $(LIBDIR)/$(PYLIBVER) + RUBYLIBVER ?= $(shell $(RUBY) -e 'print RUBY_VERSION.split(".")[0..1].join(".")') + RUBYPLATFORM ?= $(shell $(RUBY) -e 'print RUBY_PLATFORM') diff --git a/patches/libselinux-2.1.12/series b/patches/libselinux-2.1.12/series index 2fa79069a..ecf97d5d7 100644 --- a/patches/libselinux-2.1.12/series +++ b/patches/libselinux-2.1.12/series @@ -5,4 +5,5 @@ 0003-makefile-remove-host-path-from-list-of-linker-search.patch 0004-makefile-fix-linking-to-shlib-if-prefix.patch 0005-makefile-move-lpcre-from-beginning-of-gcc-linker-cal.patch -# c9b08d5ea990e48e11ad41489377128a - git-ptx-patches magic +0006-makefile-use-python-config-instead-of-pkg-config.patch +# de4667aca3c8dbc6dbdf0d2d76be078e - git-ptx-patches magic diff --git a/rules/libselinux.in b/rules/libselinux.in index 5260706bc..c5c67d616 100644 --- a/rules/libselinux.in +++ b/rules/libselinux.in @@ -1,12 +1,21 @@ ## SECTION=selinux -config LIBSELINUX +menuconfig LIBSELINUX tristate - prompt "libselinux" + prompt "libselinux " select LIBPCRE select LIBSEPOL + select PYTHON if LIBSELINUX_PYTHON + select HOST_SWIG if LIBSELINUX_PYTHON help libselinux provides an API for SELinux applications to get and set process and file security contexts and to obtain security policy decisions. Required for any applications that use the SELinux API. + +if LIBSELINUX + +config LIBSELINUX_PYTHON + bool "python wrapper" + +endif diff --git a/rules/libselinux.make b/rules/libselinux.make index 960c00420..dc0ba70c6 100644 --- a/rules/libselinux.make +++ b/rules/libselinux.make @@ -30,9 +30,23 @@ LIBSELINUX_LICENSE := public_domain # ---------------------------------------------------------------------------- LIBSELINUX_CONF_TOOL := NO -LIBSELINUX_MAKE_ENV := \ +# no := due to CROSS_PYTHON +LIBSELINUX_MAKE_ENV = \ $(CROSS_ENV) \ - CFLAGS="-O2 -Wall -g" + CFLAGS="-O2 -Wall -g" \ + PYTHON=$(CROSS_PYTHON) +LIBSELINUX_MAKE_OPT := \ + LIBDIR=$(PTXDIST_SYSROOT_TARGET)/usr/lib \ + all +LIBSELINUX_INSTALL_OPT := \ + install + +LIBSELINUX_MAKE_PAR := NO + +ifdef PTXCONF_LIBSELINUX_PYTHON +LIBSELINUX_MAKE_OPT += pywrap +LIBSELINUX_INSTALL_OPT += install-pywrap +endif # ---------------------------------------------------------------------------- # Target-Install @@ -75,6 +89,9 @@ $(STATEDIR)/libselinux.targetinstall: @$(foreach prog, $(LIBSELINUX_PROGS), \ $(call install_copy, libselinux, 0, 0, 0755, -, /usr/sbin/$(prog));) +ifdef PTXCONF_LIBSELINUX_PYTHON + @$(call install_tree, libselinux, 0, 0, -, $(PYTHON_SITEPACKAGES)) +endif @$(call install_finish, libselinux) @$(call touch) -- cgit v1.2.3