Name:           btrfs-progs
Version:        3.12
Release:        1
Summary:        Userspace programs for btrfs

Group:          System Environment/Base
License:        GPLv2
URL:            http://btrfs.wiki.kernel.org
ExclusiveArch:  x86_64
Source0:        %{name}-v%{version}.tar.bz2

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  e2fsprogs-devel, libuuid-devel, zlib-devel, libacl-devel, libblkid-devel, lzo-devel

%define _root_sbindir /sbin
%define _root_libdir /lib
%define _root_includedir /include/btrfs

%description
The btrfs-progs package provides all the userpsace programs needed to create,
check, modify and correct any inconsistencies in the btrfs filesystem.

%prep
%setup -q -n btrfs-progs-v%{version}

%build
make CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" %{?_smp_mflags} all

%install
rm -rf $RPM_BUILD_ROOT
make mandir=%{_mandir} bindir=%{_root_sbindir} libdir=%{_root_libdir} incdir=%{_root_includedir} install DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc COPYING INSTALL
%{_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-show-super
%{_root_sbindir}/btrfs-zero-log
%{_root_sbindir}/btrfsck
%{_root_sbindir}/btrfstune
%{_root_sbindir}/mkfs.btrfs

%{_mandir}/man8/btrfs-convert.8.gz
%{_mandir}/man8/btrfs-debug-tree.8.gz
%{_mandir}/man8/btrfs-find-root.8.gz
%{_mandir}/man8/btrfs-image.8.gz
%{_mandir}/man8/btrfs-map-logical.8.gz
%{_mandir}/man8/btrfs-show-super.8.gz
%{_mandir}/man8/btrfs-zero-log.8.gz
%{_mandir}/man8/btrfs.8.gz
%{_mandir}/man8/btrfsck.8.gz
%{_mandir}/man8/btrfstune.8.gz
%{_mandir}/man8/mkfs.btrfs.8.gz

%{_root_libdir}/libbtrfs.so*
%{_root_libdir}/libbtrfs.a

%{_root_includedir}/*.h


%changelog
* Tue Feb 04 2014 Evaggelos Balaskas <ebalaskas@ebalaskas.gr>  v3.12 (Nov 2013)
-  Major performance improvement for send/receive with large numbers of subvolumes
-  Support for batch deduplication (userspace tools required)
-  new mount option commit to set the commit interval
-  Lots of stability and bugfix patches