- Do not link to libselinux

This commit is contained in:
Brian C. Lane 2020-11-05 09:38:13 -08:00
parent 0dd29ac6e1
commit 28a7decb69
2 changed files with 149 additions and 3 deletions

View File

@ -0,0 +1,143 @@
From 2a2e05f09be4dd350bc91747f03378e7c534265d Mon Sep 17 00:00:00 2001
From: Petr Lautrbach <plautrba@redhat.com>
Date: Tue, 3 Nov 2020 15:06:34 +0100
Subject: [PATCH] Do not link to libsepol or libselinux
Given that there's no code which would use it there's no reason to link
to libsepol or libselinux even when they are available.
Signed-off-by: Brian C. Lane <bcl@redhat.com>
---
AUTHORS | 8 ++++----
configure.ac | 12 ------------
libparted/Makefile.am | 1 -
parted.spec.in | 15 ++-------------
4 files changed, 6 insertions(+), 30 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 530a28b..8119934 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -72,7 +72,7 @@ Matthew Wilson <msw@redhat.com>
* Don't detect AIX physical volumes as msdos partition tables
* Code for manipulating AIX PVs
-Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de>
+Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de>
* German translations
Baty Jean-Marc <baty@club-internet.fr>
@@ -113,7 +113,7 @@ Ben Collins <bcollins@debian.org>
* Sun disk label support (libparted/disk_sun.c)
* stubs for UFS
-Vincent Stelhé <vincent.stelhe@free.fr>
+Vincent Stelhé <vincent.stelhe@free.fr>
* move syntax patch (make END specification optional). Trivial
for copyright purposes (no disclaimer needed)
@@ -132,7 +132,7 @@ Matt Domsch <Matt_Domsch@dell.com>
Kjetil Torgrim Homme <kjetilho@linpro.no>
* Norweigen translations
-Jörgen Tegnér <jorgen.tegner@telia.com>
+Jörgen Tegnér <jorgen.tegner@telia.com>
* Swedish translations
Keld Simonsen <keld@dkuug.dk>
@@ -153,7 +153,7 @@ Vicente E. Llorens <vllorens@mundofree.com>
Yury Umanets <torque@ukrpost.net>
* basis of libparted/fs_reiserfs
-Bernardo João Torres da Silveira
+Bernardo João Torres da Silveira
<bernardojts@ig.com.br>
* pt_BR translation of FAQ and parted.texi
diff --git a/configure.ac b/configure.ac
index c46a3ff..ef78600 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,11 +89,6 @@ if test $ENABLE_DEVICE_MAPPER = yes; then
1, [device mapper (libdevmapper) support])
fi
-AC_ARG_ENABLE([selinux],
- [ --enable-selinux enable SELinux support [default=no]], ,
- enable_selinux=no
-)
-
AC_ARG_ENABLE([discover-only],
[ --enable-discover-only support only reading/probing [default=no]], ,
enable_discover_only=no
@@ -320,13 +315,6 @@ package as well (it may be called device-mapper-devel or something similar).]
fi
AC_SUBST([DM_LIBS])
-dnl Check for SELinux
-SELINUX_LIBS=""
-if test "$enable_selinux" = yes; then
- SELINUX_LIBS="-lselinux -lsepol"
-fi
-AC_SUBST([SELINUX_LIBS])
-
dnl Check for termcap
if test "$with_readline" = yes; then
OLD_LIBS="$LIBS"
diff --git a/libparted/Makefile.am b/libparted/Makefile.am
index bcdde77..e52aa2a 100644
--- a/libparted/Makefile.am
+++ b/libparted/Makefile.am
@@ -55,7 +55,6 @@ libparted_la_LIBADD = \
$(top_builddir)/lib/libgnulib.la \
$(OS_LIBS) \
$(DM_LIBS) \
- $(SELINUX_LIBS) \
$(LIB_BLKID) \
$(UUID_LIBS) \
$(INTLLIBS)
diff --git a/parted.spec.in b/parted.spec.in
index bdbe218..d0e2b11 100644
--- a/parted.spec.in
+++ b/parted.spec.in
@@ -1,15 +1,9 @@
-# Default to disabling device-mapper and SELinux
+# Default to disabling device-mapper
%define use_devmapper 0
-%define use_selinux 0
-%define use_sepol 0
# Enable device-mapper support if we find devmapper
%define use_devmapper %(pkg-config --libs devmapper >/dev/null 2>&1; [ $? -eq 0 ] && echo 1)
-# Enable SELinux if we find libselinux and libsepol
-%define use_selinux %([ -r %{_libdir}/libselinux.a ] && echo 1)
-%define use_sepol %([ -r %{_libdir}/libsepol.so ] && echo 1)
-
Summary: The GNU disk partition manipulation program
Name: @PACKAGE@
Version: @VERSION@
@@ -22,7 +16,7 @@ Group: Applications/System
BuildRequires: e2fsprogs-devel readline-devel ncurses-devel gperf
BuildRequires: automake libtool gettext-devel texinfo pkgconfig
-BuildRequires: device-mapper-devel, libselinux-devel libsepol-devel
+BuildRequires: device-mapper-devel
Prereq: /sbin/install-info
@@ -52,11 +46,6 @@ Parted library, you need to install this package.
--enable-device-mapper \
%else
--disable-devmapper \
-%endif
-%if "%{use_selinux}" == "1" && "%{use_sepol}" == "1"
- --enable-selinux \
-%else
- --disable-selinux \
%endif
--enable-part-static \
--enable-pc98=no \
--
2.26.2

View File

@ -4,7 +4,7 @@
Summary: The GNU disk partition manipulation program
Name: parted
Version: 3.3
Release: 6%{?dist}
Release: 7%{?dist}
License: GPLv3+
URL: http://www.gnu.org/software/parted
@ -25,6 +25,7 @@ Patch0008: 0009-Add-support-for-the-F2FS-filesystem.patch
Patch0009: 0010-tests-Add-f2fs-to-the-fs-probe-test.patch
Patch0010: 0011-parted-Preserve-resizepart-End-when-prompted-for-bus.patch
Patch0011: 0012-tests-Add-a-test-for-resizepart-on-a-busy-partition.patch
Patch0012: 0013-Do-not-link-to-libsepol-or-libselinux.patch
BuildRequires: gcc
BuildRequires: e2fsprogs-devel
@ -33,7 +34,6 @@ BuildRequires: ncurses-devel
BuildRequires: gettext-devel
BuildRequires: texinfo
BuildRequires: device-mapper-devel
BuildRequires: libselinux-devel
BuildRequires: libuuid-devel
BuildRequires: libblkid-devel >= 2.17
BuildRequires: gnupg2
@ -81,7 +81,7 @@ iconv -f ISO-8859-1 -t UTF8 AUTHORS > tmp; touch -r AUTHORS tmp; mv tmp AUTHORS
autoreconf
autoconf
CFLAGS="$RPM_OPT_FLAGS -Wno-unused-but-set-variable"; export CFLAGS
%configure --enable-selinux --disable-static --disable-gcc-warnings
%configure --disable-static --disable-gcc-warnings
# Don't use rpath!
%{__sed} -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
%{__sed} -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
@ -129,6 +129,9 @@ make check
%changelog
* Thu Nov 05 2020 Brian C. Lane <bcl@redhat.com> - 3.3-7
- Do not link to libselinux
* Fri Sep 25 2020 Brian C. Lane <bcl@redhat.com> - 3.3-6
- tests: Add a test for resizepart on a busy partition (bcl)
- parted: Preserve resizepart End when prompted for busy partition (bcl)