diff --git a/0013-Do-not-link-to-libsepol-or-libselinux.patch b/0013-Do-not-link-to-libsepol-or-libselinux.patch new file mode 100644 index 0000000..196732b --- /dev/null +++ b/0013-Do-not-link-to-libsepol-or-libselinux.patch @@ -0,0 +1,143 @@ +From 2a2e05f09be4dd350bc91747f03378e7c534265d Mon Sep 17 00:00:00 2001 +From: Petr Lautrbach +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 +--- + 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 + * Don't detect AIX physical volumes as msdos partition tables + * Code for manipulating AIX PVs + +-Martin von Löwis ++Martin von Löwis + * German translations + + Baty Jean-Marc +@@ -113,7 +113,7 @@ Ben Collins + * Sun disk label support (libparted/disk_sun.c) + * stubs for UFS + +-Vincent Stelhé ++Vincent Stelhé + * move syntax patch (make END specification optional). Trivial + for copyright purposes (no disclaimer needed) + +@@ -132,7 +132,7 @@ Matt Domsch + Kjetil Torgrim Homme + * Norweigen translations + +-Jörgen Tegnér ++Jörgen Tegnér + * Swedish translations + + Keld Simonsen +@@ -153,7 +153,7 @@ Vicente E. Llorens + Yury Umanets + * basis of libparted/fs_reiserfs + +-Bernardo João Torres da Silveira ++Bernardo João Torres da Silveira + + * 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 + diff --git a/parted.spec b/parted.spec index 13c77b5..637aeea 100644 --- a/parted.spec +++ b/parted.spec @@ -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 - 3.3-7 +- Do not link to libselinux + * Fri Sep 25 2020 Brian C. Lane - 3.3-6 - tests: Add a test for resizepart on a busy partition (bcl) - parted: Preserve resizepart End when prompted for busy partition (bcl)