From e4faa49641a70921fb77cbfe73204e54d3edc6a1 Mon Sep 17 00:00:00 2001 From: Eugene Shatokhin Date: Tue, 25 Nov 2014 16:12:53 +0300 Subject: [PATCH] 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. --- btrfs-progs.spec | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/btrfs-progs.spec b/btrfs-progs.spec index 1fc52f5..6d26815 100644 --- a/btrfs-progs.spec +++ b/btrfs-progs.spec @@ -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/*