[dpkg] 17/187: build: Fix and update libselinux check

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository dpkg.

commit a65b903c5b4303f85573df0f511151afc5c375fa
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Sep 13 03:40:51 2016 +0200

    build: Fix and update libselinux check
    
    Require libselinux 2.0.99, which introduced the selinux_status_* API.
    Switch to use the pkg-config file unconditionally, introduced in
    libselinux 2.0.89. Remove the static linking support. Perform refinement
    checks only if libselinux is available.
---
 debian/changelog |  3 +++
 m4/dpkg-libs.m4  | 38 ++++++++++++--------------------------
 2 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index da95cf2..d4439cd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,9 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Add support for running the test suite in parallel.
     - Specify exec argument for TAP::Harness to gracefully handle non-perl
       executables with older versions of the module.
+    - Require libselinux 2.0.99 for baseline API, remove static linking
+      support, use pkg-config unconditionally, and perform refinement checks
+      only if available.
 
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
diff --git a/m4/dpkg-libs.m4 b/m4/dpkg-libs.m4
index ce39717..50519d6 100644
--- a/m4/dpkg-libs.m4
+++ b/m4/dpkg-libs.m4
@@ -97,42 +97,28 @@ AC_DEFUN([DPKG_LIB_SELINUX], [
     [AS_HELP_STRING([--with-libselinux],
       [use selinux library to set security contexts])],
     [], [with_libselinux=check])
+  SELINUX_MIN_VERSION=2.0.99
   have_libselinux="no"
   AS_IF([test "x$with_libselinux" != "xno"], [
-    AC_CHECK_LIB([selinux], [is_selinux_enabled], [
-      AC_DEFINE([WITH_LIBSELINUX], [1],
-        [Define to 1 to compile in SELinux support])
-      PKG_CHECK_EXISTS([libselinux], [
-        AS_IF([test "x$with_libselinux" = "xstatic"], [
-          dpkg_selinux_libs="-Wl,-Bstatic "$($PKG_CONFIG --static --libs libselinux)" -Wl,-Bdynamic"
-        ], [
-          dpkg_selinux_libs=$($PKG_CONFIG --libs libselinux)
-        ])
+    PKG_CHECK_MODULES([SELINUX], [libselinux >= $SELINUX_MIN_VERSION], [
+      AC_CHECK_HEADER([selinux/selinux.h], [
+        AC_DEFINE([WITH_LIBSELINUX], [1],
+          [Define to 1 to compile in SELinux support])
+        have_libselinux="yes"
       ], [
-        AS_IF([test "x$with_libselinux" = "xstatic"], [
-          dpkg_selinux_libs="-Wl,-Bstatic -lselinux -lsepol -Wl,-Bdynamic"
-        ], [
-          dpkg_selinux_libs="-lselinux"
-        ])
-      ])
-      SELINUX_LIBS="${SELINUX_LIBS:+$SELINUX_LIBS }$dpkg_selinux_libs"
-
-      AC_CHECK_HEADER([selinux/selinux.h], [], [
         AS_IF([test "x$with_libselinux" != "xcheck"], [
-          AC_MSG_FAILURE([selinux header not found])
+          AC_MSG_FAILURE([libselinux header not found])
         ])
       ])
-
-      have_libselinux="yes"
+      AC_CHECK_LIB([selinux], [setexecfilecon], [
+        AC_DEFINE([HAVE_SETEXECFILECON], [1],
+          [Define to 1 if SELinux setexecfilecon is present])
+      ])
     ], [
       AS_IF([test "x$with_libselinux" != "xcheck"], [
-        AC_MSG_FAILURE([selinux library not found])
+        AC_MSG_FAILURE([libselinux at least $SELINUX_MIN_VERSION not found])
       ])
     ])
-    AC_CHECK_LIB([selinux], [setexecfilecon], [
-      AC_DEFINE([HAVE_SETEXECFILECON], [1],
-                [Define to 1 if SELinux setexecfilecon is present])
-    ])
   ])
   AM_CONDITIONAL([WITH_LIBSELINUX], [test "x$have_libselinux" = "xyes"])
   AM_CONDITIONAL([HAVE_SETEXECFILECON],

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list