2c9bf4e
Name:           bear
fe7a57f
Version:        3.0.20
9d47cab
Release:        %autorelease
e3a8802
Summary:        Tool that generates a compilation database for clang tooling
2c9bf4e
e3a8802
License:        GPLv3+
e3a8802
URL:            https://github.com/rizsotto/%{name}
0cde90f
Source:         %{url}/archive/%{version}/%{name}-%{version}.tar.gz
2c9bf4e
e3a8802
BuildRequires:  cmake
9bc4964
BuildRequires:  cmake(fmt)
9bc4964
BuildRequires:  cmake(gtest)
9bc4964
BuildRequires:  cmake(nlohmann_json)
9bc4964
BuildRequires:  cmake(spdlog)
e3a8802
BuildRequires:  gcc
e3a8802
BuildRequires:  gcc-c++
e103b48
BuildRequires:  gmock-devel
e103b48
BuildRequires:  grpc-plugins
9bc4964
BuildRequires:  make
eea5714
BuildRequires:  pkgconfig(protobuf)
eea5714
BuildRequires:  pkgconfig(grpc++)
9bc4964
BuildRequires:  python3
9bc4964
b142593
# Needed for functional tests
3d3de76
BuildRequires:  python3dist(lit)
b142593
BuildRequires:  /usr/bin/more
b142593
BuildRequires:  /usr/bin/xargs
b142593
BuildRequires:  gcc-fortran
b142593
BuildRequires:  valgrind
b142593
BuildRequires:  fakeroot
2c9bf4e
8a5d8af
# Work around RHBZ#1959600 (https://github.com/rizsotto/Bear/issues/309), which
8a5d8af
# caused a test failure on s390x. It may only be happenstance that no other
8a5d8af
# architectures were affected.
8a5d8af
%global _lto_cflags %{nil}
8a5d8af
2c9bf4e
%description
e3a8802
Build ear produces compilation database in JSON format. This database describes
e3a8802
how single compilation unit should be processed and can be used by Clang
e3a8802
tooling.
2c9bf4e
2c9bf4e
%prep
9bc4964
%autosetup -p 1 -n Bear-%{version}
2c9bf4e
2c9bf4e
2c9bf4e
%build
3d3de76
for f in $(ls test/bin/); do
3d3de76
    sed -i "s|^#\!/usr/bin/env\s\+python\s\?$|#!%{__python3}|" test/bin/$f
3d3de76
done
3d3de76
9bc4964
# Functional tests are broken for some unknown reason, disable for now.
b142593
%cmake -DENABLE_FUNC_TESTS=ON -DENABLE_UNIT_TESTS=ON
9ba158a
%cmake_build
2c9bf4e
2c9bf4e
%install
9ba158a
%cmake_install
2c9bf4e
9bc4964
mv %{buildroot}/%{_docdir}/Bear %{buildroot}/%{_docdir}/bear
2c9bf4e
2c9bf4e
%check
9bc4964
# Tests run as part of build, because it's the same build target.
9bc4964
# There is no check target.
e3a8802
2c9bf4e
e3a8802
%files
e3a8802
%{_bindir}/bear
9bc4964
%{_bindir}/citnames
9bc4964
%{_bindir}/intercept
e66f7de
%{_libdir}/bear
e3a8802
%{_mandir}/man1/bear.1*
9bc4964
%{_mandir}/man1/citnames.1*
9bc4964
%{_mandir}/man1/intercept.1*
e3a8802
e3a8802
# rpmbuild on RHEL won't automatically pick up ChangeLog.md & README.md
e3a8802
%if 0%{?rhel}
e3a8802
%{_datadir}/doc/bear
e3a8802
%endif
e3a8802
e3a8802
%license COPYING
9bc4964
%doc %{_docdir}/bear
2c9bf4e
2c9bf4e
%changelog
9d47cab
%autochangelog