Name:       btrfs-progs
Version:    5.7
Release:    1
Summary:    btrfs userspace programs
License:    GPLv2
URL:        http://www.btrfs.wiki.kernel.org/index.php/Main_Page
Source0:    https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.xz

BuildRequires:  python3-devel >= 3.4
BuildRequires:  libacl-devel, e2fsprogs-devel, libblkid-devel, libuuid-devel, zlib-devel, libzstd-devel, lzo-devel
BuildRequires:  git, gcc, asciidoc, systemd, xmlto, autoconf, automake

%define _root_sbindir /sbin

%description
Btrfs-progs provide userspace utilities to manage btrfs filesystem, including
repairing, modifying, creating etc.

%package        devel
Summary:        Including header files and libraries for developing btrfs related programs
Requires:       %{name} = %{version}-%{release}

%description    devel
This package includes header files and libraries for developing btrfs related programs

%package        help
Summary:        Including man files for btrfs-progs
BuildArch:      noarch
Requires:       man

%description    help
This package includes man files for btrfs-progs

%prep
%autosetup -n %{name}-v%{version} -p1 -S git

%build
./autogen.sh
%configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%make_build

%install
make mandir=%{_mandir} bindir=%{_sbindir} libdir=%{_libdir} incdir=%{_includedir} install DESTDIR=%{buildroot}

%files
%license COPYING
%{_libdir}/libbtrfs.so.0*
%{_sbindir}/btrfsck
%{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs
%{_sbindir}/btrfs-image
%{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-select-super
%{_sbindir}/btrfstune
%{_sbindir}/btrfs
%{_sbindir}/btrfs-map-logical
%{_sbindir}/btrfs-find-root
%{_udevrulesdir}/64-btrfs-dm.rules
%exclude %{_libdir}/*.a

%files devel
%{_includedir}/*
%{_libdir}/libbtrfs.so
%{_libdir}/libbtrfsutil.so*

%files help
%{_mandir}/man5/*.gz
%{_mandir}/man8/*.gz

%changelog
* Wed Jul 15 2020 Zhiqiang Liu <lzhq28@mail.ustc.edu.cn> - 5.7-1
- update to v5.7 version

* Wed Aug 28 2019 luoshijie <luoshijie1@huawei.com> - 4.17.1-3
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:openEuler Debranding

* Mon Aug 12 2019 luoshijie <luoshijie1@huawei.com> - 4.17.1-2
- Package init

