From b839b051ca2147dad322aedaf8225b8124fa4e9b Mon Sep 17 00:00:00 2001 From: "wenzong.fan@windriver.com" Date: Mon, 28 Jan 2013 14:59:32 +0800 Subject: [PATCH] sed: backport configure option with-selinux Backport configure option with-selinux from master. If the feature selinux is enabled, sed should depend on iti; Otherwise sed doesn't need to depend on selinux at all. Signed-off-by: Wenzong Fan Signed-off-by: Xin Ouyang --- .../sed-4.2.1/configure-option-selinux.patch | 67 +++++++++++++++++++ recipes-extended/sed/sed_4.2.1.bbappend | 9 ++- 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 recipes-extended/sed/sed-4.2.1/configure-option-selinux.patch diff --git a/recipes-extended/sed/sed-4.2.1/configure-option-selinux.patch b/recipes-extended/sed/sed-4.2.1/configure-option-selinux.patch new file mode 100644 index 0000000..1f648ea --- /dev/null +++ b/recipes-extended/sed/sed-4.2.1/configure-option-selinux.patch @@ -0,0 +1,67 @@ +Subject: [PATCH] sed: add configure option without-selinux + +Upstream-Status: Backport + +Signed-off-by: Wenzong Fan +--- + m4/selinux-selinux-h.m4 | 29 ++++++++++++++++++++++------- + 1 files changed, 22 insertions(+), 7 deletions(-) + +diff --git a/m4/selinux-selinux-h.m4 b/m4/selinux-selinux-h.m4 +index 542b4e6..dd92132 100644 +--- a/m4/selinux-selinux-h.m4 ++++ b/m4/selinux-selinux-h.m4 +@@ -10,10 +10,14 @@ + AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H], + [ + AC_REQUIRE([gl_LIBSELINUX]) +- AC_CHECK_HEADERS([selinux/selinux.h], ++ if test "$with_selinux" != no; then ++ AC_CHECK_HEADERS([selinux/selinux.h], + [SELINUX_SELINUX_H=], + [SELINUX_SELINUX_H=selinux/selinux.h]) +- AC_SUBST([SELINUX_SELINUX_H]) ++ AC_SUBST([SELINUX_SELINUX_H]) ++ else ++ ac_cv_header_selinux_selinux_h="no" ++ fi + + case "$ac_cv_search_setfilecon:$ac_cv_header_selinux_selinux_h" in + no:*) # already warned +@@ -28,17 +32,28 @@ AC_DEFUN([gl_LIBSELINUX], + [ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_CANONICAL_BUILD]) ++ ++ AC_ARG_WITH([selinux], ++ AS_HELP_STRING([--without-selinux], [do not use SELinux, even on systems with SELinux]), ++ [], [with_selinux=maybe]) ++ + LIB_SELINUX= +- gl_save_LIBS=$LIBS +- AC_SEARCH_LIBS([setfilecon], [selinux], +- [test "$ac_cv_search_setfilecon" = "none required" || +- LIB_SELINUX=$ac_cv_search_setfilecon]) ++ if test "$with_selinux" != no; then ++ gl_save_LIBS=$LIBS ++ AC_SEARCH_LIBS([setfilecon], [selinux], ++ [test "$ac_cv_search_setfilecon" = "none required" || ++ LIB_SELINUX=$ac_cv_search_setfilecon]) ++ ++ LIBS=$gl_save_LIBS ++ else ++ ac_cv_search_setfilecon="no" ++ fi + AC_SUBST([LIB_SELINUX]) ++ + if test "$ac_cv_search_setfilecon" != no && + test "$ac_cv_header_selinux_selinux_h" != no ; then + AC_DEFINE(HAVE_LIBSELINUX, 1, [libselinux enabled]) + fi +- LIBS=$gl_save_LIBS + + # Warn if SELinux is found but libselinux is absent; + if test "$ac_cv_search_setfilecon" = no && +-- +1.7.4.1 + diff --git a/recipes-extended/sed/sed_4.2.1.bbappend b/recipes-extended/sed/sed_4.2.1.bbappend index 0607d44..ecd6bb4 100644 --- a/recipes-extended/sed/sed_4.2.1.bbappend +++ b/recipes-extended/sed/sed_4.2.1.bbappend @@ -1,9 +1,8 @@ -PR .= ".2" +PR .= ".3" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" -SRC_URI += "file://sed-selinux-fix.patch" +SRC_URI += "file://sed-selinux-fix.patch \ + file://configure-option-selinux.patch" -inherit selinux - -DEPENDS += "${LIBSELINUX}" +inherit with-selinux