Blob Blame History Raw
Name:           bear
Version:        3.0.14
Release:        %autorelease
Summary:        Tool that generates a compilation database for clang tooling

License:        GPLv3+
URL:            https://github.com/rizsotto/%{name}
Source:         %{url}/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  cmake(fmt)
BuildRequires:  cmake(gtest)
BuildRequires:  cmake(nlohmann_json)
BuildRequires:  cmake(spdlog)
BuildRequires:  gcc
BuildRequires:  gcc-c++
BuildRequires:  gmock-devel
BuildRequires:  grpc-plugins
BuildRequires:  make
BuildRequires:  pkgconfig(protobuf)
BuildRequires:  pkgconfig(grpc++)
BuildRequires:  python3

# Needed for (disabled) functional tests
# BuildRequires:  python3dist(lit)

# Work around RHBZ#1959600 (https://github.com/rizsotto/Bear/issues/309), which
# caused a test failure on s390x. It may only be happenstance that no other
# architectures were affected.
%global _lto_cflags %{nil}

%description
Build ear produces compilation database in JSON format. This database describes
how single compilation unit should be processed and can be used by Clang
tooling.

%prep
%autosetup -p 1 -n Bear-%{version}


%build
# Functional tests are broken for some unknown reason, disable for now.
%cmake -DENABLE_FUNC_TESTS=OFF
%cmake_build

%install
%cmake_install

mv %{buildroot}/%{_docdir}/Bear %{buildroot}/%{_docdir}/bear

%check
# Tests run as part of build, because it's the same build target.
# There is no check target.


%files
%{_bindir}/bear
%{_bindir}/citnames
%{_bindir}/intercept
%{_libexecdir}/bear
%{_mandir}/man1/bear.1*
%{_mandir}/man1/citnames.1*
%{_mandir}/man1/intercept.1*

# rpmbuild on RHEL won't automatically pick up ChangeLog.md & README.md
%if 0%{?rhel}
%{_datadir}/doc/bear
%endif

%license COPYING
%doc %{_docdir}/bear

%changelog
%autochangelog