## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    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

%bcond_with toolchain_clang

%if %{with toolchain_clang}
%global toolchain clang
%endif

%global forgeurl https://github.com/facebook/fb303/

# need to figure out how to get the Python bindings to build later
%bcond_with python

# No tests were found!!!
%bcond_without check

Name:           fb303
Version:        2024.08.19.00
Release:        %autorelease
Summary:        Base Thrift service and a common set of functionality

License:        Apache-2.0
URL:            %{forgeurl}
Source0:        %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

ExclusiveArch:  x86_64 aarch64 ppc64le riscv64

BuildRequires:  cmake
%if %{with toolchain_clang}
BuildRequires:  clang
%else
BuildRequires:  gcc-c++
%endif
BuildRequires:  fbthrift-devel = %{version}
BuildRequires:  fizz-devel = %{version}
BuildRequires:  folly-devel = %{version}
BuildRequires:  mvfst-devel = %{version}
BuildRequires:  gflags-devel
BuildRequires:  glog-devel
%if %{with python}
BuildRequires:  python3-devel
BuildRequires:  python3-fbthrift-devel
%endif
BuildRequires:  wangle-devel

%global _description %{expand:
fb303 is a base Thrift service and a common set of functionality for querying
stats, options, and other information from a service.}

%description %{_description}


%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       cmake-filesystem
Obsoletes:      %{name}-static < 0^20220221gitfd133d9-1

%description    devel %{_description}

The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%autosetup -p1


%build
%cmake \
  -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
  -DPACKAGE_VERSION=%{version} \
%if %{with python}
  -DPYTHON_EXTENSIONS=ON
%else
  -DPYTHON_EXTENSIONS=OFF
%endif
%cmake_build


%install
%cmake_install


%if %{with check}
%check
%ctest
%endif


%files
%license LICENSE
%doc README.md
%{_libdir}/*.so.%{version}

%files devel
%doc CODE_OF_CONDUCT.md CONTRIBUTING.md
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/cmake/%{name}/


%changelog
## START: Generated by rpmautospec
* Wed Aug 21 2024 Michel Lind <salimma@fedoraproject.org> - 2024.08.19.00-1
- Update to version 2024.08.19.00; Fixes: RHBZ#2300388

* Fri Jul 26 2024 Michel Lind <salimma@fedoraproject.org> - 2024.07.22.00-1
- Update to 2024.07.22.00 (rhbz#2266162)

* Wed Jul 17 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2024.02.19.00-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Wed Apr 10 2024 Jasen Chao <JasenChao@gmail.com> - 2024.02.19.00-2
- Add riscv64 support

* Sat Feb 24 2024 Michel Lind <salimma@fedoraproject.org> - 2024.02.19.00-1
- Update to 2024.02.19.00

* Thu Jan 25 2024 Michel Lind <salimma@fedoraproject.org> - 2024.01.22.00-1
- Update to 2024.01.22.00

* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2023.10.16.00-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2023.10.16.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Wed Oct 18 2023 Michel Lind <salimma@fedoraproject.org> - 2023.10.16.00-1
- Update to 2023.10.16.00

* Tue Oct 17 2023 Michel Lind <salimma@fedoraproject.org> - 2023.10.09.00-1
- Update to 2023.10.09.00

* Tue Sep 12 2023 Michel Lind <salimma@fedoraproject.org> - 2023.09.11.00-1
- Update to 2023.09.11.00

* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2023.07.03.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Fri Jul 07 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 2023.07.03.00-1
- Update to 2023.07.03.00
- Use SPDX license identifier

* Wed Jun 28 2023 Vitaly Zaitsev <vitaly@easycoding.org> - 2023.04.24.00-2
- Rebuilt due to fmt 10 update.

* Tue Apr 25 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 2023.04.24.00-1
- Update to 2023.04.24.00

* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2022.07.11.00-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Jul 21 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 2022.07.11.00-1
- Update to 2022.07.11.00

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2022.03.14.00-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Jul 20 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2022.03.14.00-2
- Build with gcc, rebuild for fmt-9, enable ppc64le

* Tue Mar 15 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 2022.03.14.00-1
- Update to 2022.03.14.00

* Tue Mar 08 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 2022.03.07.00-1
- Upgrade to 2022.03.07.00 (resolves: rhbz#2061209)

* Wed Mar 02 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 2022.02.28.00-1
- Update to 2022.02.28.00

* Tue Mar 01 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 2022.02.21.00-1
- Switch to weekly tags

* Tue Mar 01 2022 Michel Alexandre Salim <salimma@fedoraproject.org> - 0^20220221gitfd133d9-1
- Update to snapshot from 2022.02.21

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Dec 24 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.6.20211220gitbd92ca8
- Update to snapshot from 20211220
- Opt in to rpmautospec (changelog only)

* Fri Aug 06 2021 Jonathan Wakely <jwakely@redhat.com> - 0-0.6.20210722git5b60630
- Rebuilt for Boost 1.76

* Thu Jul 29 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.5-20210722git5b60630
- Update to snapshot from 20210722

* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.5.20210628git8ef9085
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Mon Jul 12 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.4.20210628git8ef9085
- Update to snapshot from 20210628

* Mon Jul 05 2021 Richard Shaw <hobbes1069@gmail.com> - 0-0.4.20210510git74978e1
- Rebuild for new fmt version.

* Mon May 10 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.3.20210510git74978e1
- Update to snapshot from 20210510

* Mon Apr 26 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.3.20210426git3843360
- Update to snapshot from 20210426

* Fri Apr 16 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.3.20210412git9066fd2
- Update to snapshot from 20210412
- Stop using forge macros in case we want to build for EPEL8

* Mon Mar 29 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.0-3.20210329gitbf56c7a
- Update to snapshot from 20210329

* Wed Mar 24 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.3.20210322git90a5e0c
- Update to snapshot from 20210322

* Mon Mar 15 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.3.20210314git042a0d3
- Update to snapshot from 20210314

* Wed Feb  3 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.3.20210201git72505c4
- Update to snapshot from 20210201

* Tue Jan 26 2021 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.1.20210125git7b67e06
- Update to snapshot from 20210125

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3.20201228git7700913
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Jan 22 2021 Jonathan Wakely <jwakely@redhat.com> - 0-0.2.20201228git7700913
- Rebuilt for Boost 1.75

* Tue Dec 29 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.1.20201228git7700913
- Update to snapshot from 20201228

* Tue Dec 22 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.1.20201221git96ae845
- Update to snapshot from 20201221

* Mon Nov 30 14:54:10 PST 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.1.20201130git2b3b110
- Update to snapshot from 20201130

* Mon Nov 23 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 0-0.1.20201123git94cac88
- Initial package

## END: Generated by rpmautospec