#%%global _hardened_build 0 %global debug_package %{nil} Name: bear Version: 4.0.2 Release: 1%{?dist} Summary: Tool that generates a compilation database for clang tooling License: GPL-3.0-or-later URL: https://github.com/rizsotto/Bear Source0: https://github.com/rizsotto/Bear/archive/refs/tags/%{version}.tar.gz BuildRequires: rust >= 1.70 BuildRequires: cargo BuildRequires: pkgconfig BuildRequires: rust-libsystemd-devel BuildRequires: systemd-devel BuildRequires: clang BuildRequires: gcc BuildRequires: make BuildRequires: openssl-devel BuildRequires: cargo-rpm-macros Requires: %{_bindir}/bear # Requires: %{rust_cargo} %description Bear generates a JSON compilation database for clang tooling by intercepting compiler calls during a build. This database can be used with tools such as clang-tidy, clangd, or other clang-based analyzers.:contentReference[oaicite:1]{index=1} %prep %autosetup -p1 -n Bear-%{version} # Ensure Cargo.lock is present for reproducible builds %build # Build with Cargo in release mode export RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=lld" unset LDFLAGS unset CFLAGS unset CXXFLAGS cargo build --release --locked %install # Install the compiled binary install -Dm0755 target/release/bear %{buildroot}%{_bindir}/bear # Man page (falls vorhanden im Projekt) install -Dm0644 man/bear.1 %{buildroot}%{_mandir}/man1/bear.1 # License and docs install -Dm0644 COPYING %{buildroot}%{_license_dir}/COPYING install -Dm0644 README.md %{buildroot}%{_docdir}/bear/README.md install -Dm0644 INSTALL.md %{buildroot}%{_docdir}/bear/INSTALL.md %files %license COPYING %doc %{_docdir}/bear %{_bindir}/bear %{_mandir}/man1/bear.1* %changelog * Sun Jan 18 2026 - 4.0.2-1 - Initial Fedora 43 package for Bear 4.0.2, built with cargo