Place the binaries in /sbin rather than /usr/sbin

This is done similar to e2fsprogs where mkfs.*, fsck.* and other
FS-related tools are kept in /sbin.

Some of the system tools (e.g. systemd-fstab-generator) still need
fsck.* in /sbin.
This commit is contained in:
Eugene Shatokhin 2014-11-25 16:12:53 +03:00
parent 42b84c67f5
commit e4faa49641

View file

@ -1,3 +1,5 @@
%define _root_sbindir /sbin
%define _root_libdir /%{_lib}
%define libname_orig libbtrfs
%define major 0
%define libname %mklibname btrfs %{major}
@ -11,7 +13,8 @@ Summary: Userspace programs for btrfs
Group: System/Kernel and hardware
License: GPLv2
URL: http://btrfs.wiki.kernel.org/
Source0: http://www.kernel.org/pub/linux/kernel/people/mason/btrfs/%{name}-v%{version}.tar.xz
# Git: git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
Source0: http://www.kernel.org/pub/linux/kernel/people/mason/btrfs-progs/%{name}-v%{version}.tar.xz
# From http://www.spinics.net/lists/linux-btrfs/msg15899.html
Source1: btrfs-completion.sh
# From Fedora
@ -58,25 +61,33 @@ applications which will use btrfs
%make CFLAGS="%{optflags}" LDFLAGS="%{ldflags}"
%install
%makeinstall bindir=%{buildroot}%{_sbindir}
%makeinstall_std \
bindir=%{_root_sbindir} \
libdir=%{_root_libdir} \
incdir=%{_includedir}/btrfs \
mandir=%{_mandir}
rm -f %{buildroot}%{_root_libdir}/*.a
mkdir -p %{buildroot}%{_libdir}
mv %{buildroot}%{_root_libdir}/libbtrfs.so %{buildroot}%{_libdir}/
mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
cp %{SOURCE1} %{buildroot}%{_datadir}/bash-completion/completions/btrfs
rm -f %{buildroot}%{_libdir}/*.a
%files
%doc COPYING INSTALL
%{_sbindir}/btrfs
%{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-debug-tree
%{_sbindir}/btrfs-find-root
%{_sbindir}/btrfs-image
%{_sbindir}/btrfs-map-logical
%{_sbindir}/btrfs-zero-log
%{_sbindir}/btrfsck
%{_sbindir}/btrfstune
%{_sbindir}/btrfs-show-super
%{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs
%{_root_sbindir}/btrfs
%{_root_sbindir}/btrfs-convert
%{_root_sbindir}/btrfs-debug-tree
%{_root_sbindir}/btrfs-find-root
%{_root_sbindir}/btrfs-image
%{_root_sbindir}/btrfs-map-logical
%{_root_sbindir}/btrfs-zero-log
%{_root_sbindir}/btrfsck
%{_root_sbindir}/btrfstune
%{_root_sbindir}/btrfs-show-super
%{_root_sbindir}/fsck.btrfs
%{_root_sbindir}/mkfs.btrfs
%{_mandir}/man5/btrfs.5.*
%{_mandir}/man8/btrfs.8.*
%{_mandir}/man8/btrfs-*.8*
@ -87,7 +98,7 @@ rm -f %{buildroot}%{_libdir}/*.a
%{_datadir}/bash-completion/completions/btrfs
%files -n %{libname}
%{_libdir}/libbtrfs.so.%{major}*
%{_root_libdir}/libbtrfs.so.%{major}*
%files -n %{develname}
%{_includedir}/btrfs/*