875f38a spec: use /usr/sbin paths for Fedora 40+

Authored and Committed by zbyszek 3 months ago
    spec: use /usr/sbin paths for Fedora 40+
    
    Based on the patch from Oyvind Albrigtsen <oalbrigt@redhat.com>:
    https://github.com/ClusterLabs/resource-agents/commit/6516e089c9975eb78a71a7943b633520aae107f6.
    
    Note that the upstream commit updates all paths, but it turns out that
    this is not what we need. nfs-utils actually has files with both /sbin
    and /usr/sbin:
    
      $ rpm -ql nfs-utils|grep bin
      /sbin/mount.nfs
      /sbin/mount.nfs4
      /sbin/nfsdcltrack
      /sbin/rpc.statd
      /sbin/umount.nfs
      /sbin/umount.nfs4
      /usr/sbin/blkmapd
      /usr/sbin/exportfs
      /usr/sbin/fsidd
      /usr/sbin/mountstats
      /usr/sbin/nfsconf
      /usr/sbin/nfsdcld
      /usr/sbin/nfsdclddb
      /usr/sbin/nfsdclnts
      /usr/sbin/nfsidmap
      /usr/sbin/nfsiostat
      /usr/sbin/nfsref
      /usr/sbin/nfsstat
      /usr/sbin/rpc.gssd
      /usr/sbin/rpc.idmapd
      /usr/sbin/rpc.mountd
      /usr/sbin/rpc.nfsd
      /usr/sbin/rpcctl
      /usr/sbin/rpcdebug
      /usr/sbin/showmount
      /usr/sbin/sm-notify
      /usr/sbin/start-statd
    
    I was confused by the fact that a) the paths in the file system are
    actually always /usr/s?bin, because /bin and /sbin and symlinks, and
    b) rpm query works for the real paths:
    
      $ rpm -qf /sbin/mount.nfs /usr/sbin/mount.nfs
      nfs-utils-2.6.4-0.rc2.fc39.x86_64
      nfs-utils-2.6.4-0.rc2.fc39.x86_64
    
    But we can only use the declared path in dependencies, and that is
    /sbin/* in a few cases.
    
    I was surprised by this, but nfs-utils is actually following the
    Packaging Guidelines in this case [1]:
    
      > As a packager you may need to pay attention to where other
      > packages expect to find your files. Things that history has placed
      > into /bin, /sbin, /lib, or /lib64 should be listed in the %files
      > section as being in those directories. Things that history placed
      > in /usr/bin, /usr/sbin, etc, should be listed in the %files
      > section as being in %{_bindir}, %{_sbindir}, etc.
    
    I think the Packaging Guidelines should be updated to drop this, but
    currently they are what they are. Thus, this patch updates the paths
    the are _declared_ as /usr/s?bin/* in other packages only.
    
    [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/#_effect_of_the_usrmove_fedora_feature
    
        
file modified
+11 -2