%bcond_with man

Name:           btrfs-progs
Version:        6.9.2
Release:        1%{?_dist_release}
Summary:        Userspace programs for btrfs
Summary(ja):    btrfs ファイルシステム用ユーザスペースプログラム集
Group:          system
Vendor:         Project Vine
Distribution:   Vine Linux

License:        GPLv2
URL:            https://btrfs.readthedocs.io/en/latest/
Source0:        https://www.kernel.org/pub/linux/kernel/people/kdave/%{name}/%{name}-v%{version}.tar.xz

BuildRequires:  autoconf, automake
BuildRequires:  e2fsprogs-devel, libuuid-devel
BuildRequires:  libacl-devel, libblkid-devel, lzo-devel
BuildRequires:  libzstd-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
%if %{with man}
BuildRequires:  python3-sphinx
%endif

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

%description -l ja
btrfs-progs パッケージには、btrfs ファイルシステムを作成、チェック、
変更、不整合の修正などを行うためのユーザスペースプログラムが収録されています。


%package devel
Summary:        btrfs filesystem-specific libraries and headers
Summary(ja):    btrfs ファイルシステム固有のライブラリ・ヘッダ
Group:          programming
Requires:       btrfs-progs = %{version}-%{release}

%description devel
btrfs-progs-devel contains the libraries and header files needed to
develop btrfs filesystem-specific programs.

You should install btrfs-progs-devel if you want to develop
btrfs filesystem-specific programs.

%description -l ja devel
　btrfs-progs-develにはbtrfs固有のプログラムを開発するために必要な
ライブラリ・ヘッダファイルが収録されています。


%debug_package


%define _udevrulesdir /usr/lib/udev/rules.d

%prep
%setup -q -n %{name}-v%{version}


%build
./autogen.sh
%configure CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \
	--with-crypto=libgcrypt \
	--disable-documentation \
	--disable-python
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make mandir=%{_mandir} bindir=%{_sbindir} libdir=%{_libdir} incdir=%{_includedir}/btrfs install DESTDIR=$RPM_BUILD_ROOT
install -Dpm0644 btrfs-completion %{buildroot}%{_datadir}/bash-completion/completions/btrfs
# Nuke the static lib
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a


%files
%license COPYING
%{_sbindir}/btrfs
%{_sbindir}/btrfs-convert
%{_sbindir}/btrfs-find-root
%{_sbindir}/btrfs-image
%{_sbindir}/btrfs-map-logical
%{_sbindir}/btrfs-select-super
%{_sbindir}/btrfsck
%{_sbindir}/btrfstune
%{_sbindir}/fsck.btrfs
%{_sbindir}/mkfs.btrfs
%{_libdir}/libbtrfs*.so.*
%{_udevrulesdir}/64-btrfs-dm.rules
%{_udevrulesdir}/64-btrfs-zoned.rules
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/btrfs
%if %{with man}
%{_mandir}/man5/*.gz
%{_mandir}/man8/*.gz
%endif

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


%changelog
* Thu Jul 11 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 6.9.2-1
- new upstream release.

* Sun Mar 29 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 5.4.1-1
- new upstream release.

* Sun Dec 13 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 4.3.1-1
- new upstream release.

* Thu Mar 22 2012 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.19-2
- rebuild

* Wed Sep 22 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.19-1
- initial package for Vine Linux

* Wed Mar 24 2010 Josef Bacik <josef@toxicpanda.com> 0.19-12
- bring btrfs-progs uptodate with upstream so we can use the new kernel
  features, such as the default subvol stuff and snapshot listing.

* Thu Mar 11 2010 Josef Bacik <josef@toxicpanda.com> 0.19-11
- fix convert build for DSO linking stuff

* Thu Mar 11 2010 Josef Bacik <josef@toxicpanda.com> 0.19-10
- add btrfs-progs-ustream.patch so we are aligned with upstream

* Tue Feb 2 2010 Josef Bacik <josef@toxicpanda.com> 0.19-9
- fix btrfsck so it builds on newer glibcs

* Tue Feb 2 2010 Josef Bacik <josef@toxicpanda.com> 0.19-8
- fix btrfsctl to return 0 on success and 1 on failure

* Tue Aug 25 2009 Josef Bacik <josef@toxicpanda.com> 0.19-7
- add btrfs-progs-valgrind.patch to fix memory leaks and segfaults

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Jul 15 2009 Josef Bacik <josef@toxicpanda.com> 0.19-5
- add e2fsprogs-devel back to BuildRequires since its needed for the converter

* Wed Jul 15 2009 Josef Bacik <josef@toxicpanda.com> 0.19-4
- change BuildRequires for e2fsprogs-devel to libuuid-devel

* Fri Jun 19 2009 Josef Bacik <josef@toxicpanda.com> 0.19-3
- added man pages to the files list and made sure they were installed properly

* Fri Jun 19 2009 Josef Bacik <josef@toxicpanda.com> 0.19-2
- add a patch for the Makefile to make it build everything again

* Fri Jun 19 2009 Josef Bacik <josef@toxicpanda.com> 0.19-1
- update to v0.19 of btrfs-progs for new format

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jan 22 2009 Josef Bacik <josef@toxicpanda.com> 0.18-3
- updated label patch

* Thu Jan 22 2009 Josef Bacik <josef@toxicpanda.com> 0.18-2
- add a patch to handle having /'s in labels

* Sat Jan 17 2009 Josef Bacik <josef@toxicpanda.com> 0.18-1
- updated to 0.18 because of the ioctl change in 2.6.29-rc2

* Fri Jan 16 2009 Marek Mahut <mmahut@fedoraproject.org> 0.17-4
- RHBZ#480219 btrfs-convert is missing

* Mon Jan 12 2009 Josef Bacik <josef@toxicpanda.com> 0.17-2
- fixed wrong sources upload

* Mon Jan 12 2009 Josef Bacik <josef@toxicpanda.com> 0.17
- Upstream release 0.17

* Sat Jan 10 2009 Kyle McMartin <kyle@redhat.com> 0.16.git1-1
- Upstream git sync from -g72359e8 (needed for kernel...)

* Sat Jan 10 2009 Marek Mahut <mmahut@fedoraproject.org> 0.16-1
- Upstream release 0.16

* Wed Jun 25 2008 Josef Bacik <josef@toxicpanda.com> 0.15-4
-use fedoras normal CFLAGS

* Mon Jun 23 2008 Josef Bacik <josef@toxicpanda.com> 0.15-3
-Actually defined _root_sbindir
-Fixed the make install line so it would install to the proper dir

* Mon Jun 23 2008 Josef Bacik <josef@toxicpanda.com> 0.15-2
-Removed a . at the end of the description
-Fixed the copyright to be GPLv2 since GPL doesn't work anymore

* Mon Jun 23 2008 Josef Bacik <josef@toxicpanda.com> 0.15-1
-Initial build
