From 6756999ced04c544708632a1003e8b405fb94047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 9 Apr 2024 17:32:50 +0200 Subject: [PATCH] Move ldconfig to %{_sbindir}, adjust paths for merged-sbin This implements https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin and https://pagure.io/packaging-committee/pull-request/1355. Since %{_sbindir} will point to /usr/bin, ldconfig is moved first to /usr/sbin, but then when the merge is implemented, to /usr/bin. Adjust the handling of zic and iconvconfig. Previously, they were sorted into the right subpackage based on the location, but now all files are in /usr/bin, so that doesn't work anymore. Before the merge, /sbin/ldconfig and /usr/sbin/ldconfig point to the same file, so both paths work. Virtual Provides:/sbin/ldconfig allows other rpms to refer to either path. After sbin-merge, the /usr/sbin/ symlink needs to be created by filesystem, so add the appropriate Requires. --- glibc.spec | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/glibc.spec b/glibc.spec index 9993fe2..20e18ed 100644 --- a/glibc.spec +++ b/glibc.spec @@ -134,10 +134,9 @@ function post_exec (msg, program, ...) end end --- Note: We use _prefix because Fedora's UsrMove says so. function call_ldconfig () - post_exec("Error: call to %{_prefix}/sbin/ldconfig failed.\n", - "%{_prefix}/sbin/ldconfig") + post_exec("Error: call to ldconfig failed.\n", + "ldconfig") end function update_gconv_modules_cache () @@ -170,7 +169,7 @@ Version: %{glibcversion} # - It allows using the Release number without the %%dist tag in the dependency # generator to make the generated requires interchangeable between Rawhide # and ELN (.elnYY < .fcXX). -%global baserelease 30 +%global baserelease 31 Release: %{baserelease}%{?dist} # Licenses: @@ -336,6 +335,10 @@ Patch23: glibc-python3.patch Obsoletes: glibc-profile < 2.4 Obsoletes: nscd < 2.35 Provides: ldconfig +%if "%{_sbindir}" == "%{_bindir}" +# We rely on filesystem to create the compat symlinks for us +Requires: filesystem(unmerged-sbin-symlinks) +%endif Provides: /sbin/ldconfig Provides: /usr/sbin/ldconfig @@ -584,6 +587,11 @@ Summary: Common binaries and locale data for glibc Requires: %{name} = %{version}-%{release} Recommends: tzdata >= 2003a +%if "%{_sbindir}" == "%{_bindir}" +# We rely on filesystem to create the compat symlinks for us +Requires: filesystem(unmerged-sbin-symlinks) +%endif + %description common The glibc-common package includes common binaries for the GNU libc libraries, as well as national language (locale) support. @@ -1452,6 +1460,12 @@ popd # via hardlinks, so we must group them ourselves. hardlink -c %{glibc_sysroot}/usr/lib/locale +# Implement Changes/UsrMerge and Changes/Unify_bin_and_sbin. +mv %{glibc_sysroot}/sbin/ldconfig %{glibc_sysroot}/%{_sbindir}/ +%if "%{_sbindir}" == "%{_bindir}" +mv %{glibc_sysroot}/usr/sbin/{iconvconfig,zic} %{glibc_sysroot}/%{_bindir}/ +%endif + # install_different: # Install all core libraries into DESTDIR/SUBDIR. Either the file is # installed as a copy or a symlink to the default install (if it is the @@ -1534,7 +1548,7 @@ mkdir -p %{glibc_sysroot}/var/cache/ldconfig truncate -s 0 %{glibc_sysroot}/var/cache/ldconfig/aux-cache # ldconfig is statically linked, so we can use the new version. -%{glibc_sysroot}/sbin/ldconfig -N -r %{glibc_sysroot} +%{glibc_sysroot}/%{_sbindir}/ldconfig -N -r %{glibc_sysroot} ############################################################################## # Install info files @@ -1895,10 +1909,7 @@ chmod 0444 master.filelist # - The info files '%{_infodir}/dir' # - The partial (lib*_p.a) static libraries, include files. # - The static files, objects, and unversioned DSOs. -# - The bin, locale, some sbin, and share. -# - We want iconvconfig in the main package and we do this by using -# a double negation of -v and [^i] so it removes all files in -# sbin *but* iconvconfig. +# - Share and ldconfig and iconvconfig # - All the libnss files (we add back the ones we want later). # - libc_malloc_debug.so, since it is a debugging library. # - All bench test binaries. @@ -1916,7 +1927,7 @@ cat master.filelist \ -e '%{_libdir}/gconv/gconv-modules.d/gconv-modules-extra\.conf$' \ -e '%{_prefix}/bin' \ -e '%{_prefix}/lib/locale' \ - -e '%{_prefix}/sbin/[^i]' \ + -e '%{_prefix}/sbin' \ -e '%{_prefix}/share' \ -e '/var/db/Makefile' \ -e '/libnss_.*\.so[0-9.]*$' \ @@ -1933,6 +1944,10 @@ cat master.filelist \ -e '/lib/.*\.so.*' \ %endif > glibc.filelist +cat master.filelist \ + | grep -E \ + -e 'bin/(ldconfig|iconvconfig)' \ + >> glibc.filelist # Add specific files: # - The nss_files, nss_compat, and nss_db files. @@ -2094,11 +2109,9 @@ grep '%{_libdir}/lib.*\.a' < master.filelist \ # iconvconfig which needs to go in glibc. The iconvconfig binary is kept in # the main glibc package because we use it in the post-install scriptlet to # rebuild the gconv-modules.cache. The makedb binary is in nss_db. -grep '%{_prefix}/bin' master.filelist \ - | grep -v '%{_prefix}/bin/makedb' \ +grep -E '%{_prefix}/s?bin' master.filelist \ + | grep -vE 'bin/(makedb|iconvconfig|ldconfig|memusage|mtrace|pcprofiledump|xtrace)' \ >> common.filelist -grep '%{_prefix}/sbin' master.filelist \ - | grep -v '%{_prefix}/sbin/iconvconfig' >> common.filelist # All of the files under share go into the common package since they should be # multilib-independent. # Exceptions: @@ -2561,6 +2574,10 @@ update_gconv_modules_cache () %endif %changelog +* Tue Jul 09 2024 Zbigniew Jędrzejewski-Szmek - 2.39.9000-31 +- Rebuilt for the bin-sbin merge +- ldconfig is moved to /usr/bin and paths are adjusted for merged-sbin + * Thu Jul 04 2024 Arjun Shankar - 2.39.9000-30 - Auto-sync with upstream branch master, commit 2b92982e2369d292560793bee8e730f695f48ff3: