## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 11;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%global forgeurl https://github.com/adam900710/btrfs-fuse
%global commit 812c4b70c6fd4e2efdd13256c3b5c4a7fd596b2a
%forgemeta

Name:           btrfs-fuse
Version:        0
Release:        %autorelease
Summary:        Read-only, license friendly, FUSE based btrfs implementation

License:        GPLv2 and MIT
URL:            %{forgeurl}
Source0:        %{forgesource}

BuildRequires:  gcc
BuildRequires:  meson
BuildRequires:  btrfs-progs-devel
BuildRequires:  fuse3-devel
BuildRequires:  libaio-devel
BuildRequires:  libattr-devel
BuildRequires:  libb2-devel
BuildRequires:  liburing-devel
BuildRequires:  libuuid-devel
BuildRequires:  libzstd-devel
BuildRequires:  lzo-devel
BuildRequires:  openssl-devel
BuildRequires:  xfsprogs-devel
BuildRequires:  xxhash-devel
BuildRequires:  zlib-devel

%description
This is a read-only btrfs implementation using FUSE (Filesystem in Userspace).

Although btrfs is already in mainline Linux kernel, there are still use-cases
for such read-only btrfs implementation:
- Educational purpose: let new developers get a quick way to learn how a
  complex and modern filesystem works;
- For certain bootloaders: certain bootloaders need code base compatible with
  their license;
- As a last resort method for subpage/multipage support: currently (v5.16-rc)
  the Linux kernel can only support sectorsize == pagesize , and 4K sectorsize
  with 64K page size; thus this project can act as a last resort method to read
  data from filesystem with unsupported sectorsize.

%prep
%forgesetup

%build
%meson
%meson_build

%install
%meson_install

%files
%license LICENSE
%doc README.md
%{_bindir}/btrfs-fuse

%changelog
* Thu Jan 19 2023 Davide Cavalca <dcavalca@fedoraproject.org> - 0-11
- Update to git snapshot 812c4b7

* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Mar 01 2022 Davide Cavalca <dcavalca@fedoraproject.org> - 0-8
- Update to git snapshot ca53ed5

* Wed Feb 02 2022 Davide Cavalca <dcavalca@fedoraproject.org> - 0-7
- Update to git snapshot 2dfabc1

* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sat Nov 13 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-5
- Update to git snapshot 8635fbc

* Fri Nov 12 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-4
- Update to git snapshot 3905399; Fixes: RHBZ#2022035

* Wed Nov 10 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-3
- Exclude pcc64le for now

* Wed Nov 10 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-2
- Update to git snapshot 89b9390

* Wed Nov 10 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-1
- Initial import; Fixes: RHBZ#2021615