diff --git a/0001-change-external-project-to-local-package.patch b/0001-change-external-project-to-local-package.patch new file mode 100644 index 0000000000000000000000000000000000000000..151054d01ad53648f9552a66f0580d0e6bdfbcbe --- /dev/null +++ b/0001-change-external-project-to-local-package.patch @@ -0,0 +1,76 @@ +diff --git a/third_party/fmt/CMakeLists.txt b/third_party/fmt/CMakeLists.txt +index cc6bae4..c26a7ec 100644 +--- a/third_party/fmt/CMakeLists.txt ++++ b/third_party/fmt/CMakeLists.txt +@@ -10,13 +10,9 @@ else () + include(ExternalProject) + ExternalProject_Add(fmt_dependency + URL +- https://github.com/fmtlib/fmt/archive/9.0.0.tar.gz ++ ${DEPEND_PATH}/fmt-9.0.0.tar.gz + URL_HASH + MD5=d56c8b0612b049bb1854f07c8b133f3c +- DOWNLOAD_NO_PROGRESS +- 1 +- UPDATE_COMMAND +- "" + LOG_CONFIGURE + 1 + LOG_BUILD +diff --git a/third_party/googletest/CMakeLists.txt b/third_party/googletest/CMakeLists.txt +index 42dbf27..322b37d 100644 +--- a/third_party/googletest/CMakeLists.txt ++++ b/third_party/googletest/CMakeLists.txt +@@ -12,13 +12,9 @@ else () + include(ExternalProject) + ExternalProject_Add(googletest_dependency + URL +- https://github.com/google/googletest/archive/release-1.12.1.tar.gz ++ ${DEPEND_PATH}/googletest-release-1.12.1.tar.gz + URL_HASH + MD5=e82199374acdfda3f425331028eb4e2a +- DOWNLOAD_NO_PROGRESS +- 1 +- UPDATE_COMMAND +- "" + LOG_CONFIGURE + 1 + LOG_BUILD +diff --git a/third_party/nlohmann_json/CMakeLists.txt b/third_party/nlohmann_json/CMakeLists.txt +index c4ec891..7e57f1d 100644 +--- a/third_party/nlohmann_json/CMakeLists.txt ++++ b/third_party/nlohmann_json/CMakeLists.txt +@@ -9,13 +9,9 @@ else () + include(ExternalProject) + ExternalProject_Add(nlohmann_json_dependency + URL +- https://github.com/nlohmann/json/archive/v3.10.5.tar.gz ++ ${DEPEND_PATH}/json-3.10.5.tar.gz + URL_HASH + MD5=5b946f7d892fa55eabec45e76a20286b +- DOWNLOAD_NO_PROGRESS +- 1 +- UPDATE_COMMAND +- "" + LOG_CONFIGURE + 1 + LOG_BUILD +diff --git a/third_party/spdlog/CMakeLists.txt b/third_party/spdlog/CMakeLists.txt +index 2d8a5da..cefba1d 100644 +--- a/third_party/spdlog/CMakeLists.txt ++++ b/third_party/spdlog/CMakeLists.txt +@@ -10,13 +10,9 @@ else () + include(ExternalProject) + ExternalProject_Add(spdlog_dependency + URL +- https://github.com/gabime/spdlog/archive/v1.10.0.tar.gz ++ ${DEPEND_PATH}/spdlog-1.10.0.tar.gz + URL_HASH + MD5=effea813cd81cfb5588806c5754e14f1 +- DOWNLOAD_NO_PROGRESS +- 1 +- UPDATE_COMMAND +- "" + LOG_CONFIGURE + 1 + LOG_BUILD diff --git a/Bear-3.0.20.tar.gz b/Bear-3.0.20.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..8877a77dcdaea04ddb4c010033ef0165858289dd Binary files /dev/null and b/Bear-3.0.20.tar.gz differ diff --git a/Bear.spec b/Bear.spec new file mode 100644 index 0000000000000000000000000000000000000000..79bef6e2e01f933a752d78a727d741bf8271243e --- /dev/null +++ b/Bear.spec @@ -0,0 +1,99 @@ +# +# spec file for package Bear +# +# Copyright (C) 2007 Free Software Foundation, Inc. +# Everyone is permitted to copy and distribute verbatim copies +# of this license document, but changing it is not allowed. +# +# This file is under the GNU GENERAL PUBLIC LICENSE Version 3. +# + +%bcond_with tests +Name: Bear +Version: 3.0.20 +Release: 1 +Summary: Tool to generate compilation database for clang tooling +License: GPL-3.0-or-later +URL: https://github.com/rizsotto/Bear +Source: %{name}-%{version}.tar.gz +BuildRequires: bash-completion +BuildRequires: gcc, gcc-c++, make +BuildRequires: protobuf-devel, grpc-devel, grpc-plugins +BuildRequires: c-ares-devel +BuildRequires: glibc-devel, glibc-debuginfo +BuildRequires: cmake +BuildRequires: pkgconfig(absl_synchronization) +BuildRequires: pkgconfig(grpc) +BuildRequires: pkgconfig(grpc++) >= 1.26 +BuildRequires: pkgconfig(protobuf) >= 3.11 +%if %{with tests} +BuildRequires: python +BuildRequires: python3-lit +BuildRequires: python3-setuptools +# one of the tests requires /usr/bin/more +BuildRequires: util-linux +# additional binaries for specific tests +BuildRequires: gcc-fortran +BuildRequires: fakeroot +BuildRequires: valgrind +# the fakeroot test requires xargs +BuildRequires: findutils +%endif + +Patch1: 0001-change-external-project-to-local-package.patch + + + +%description +Bear is a tool to generate compilation database for clang tooling. + +One way to get compilation database is to use cmake as build tool. When the +project compiles with no cmake, but another build system, there is no free json +file. Bear is a tool to generate such file during the build process. + +%prep +%autosetup -p1 -n %{name}-%{version} + +%build +BEAR_MFLAGS_JOBS="%{?_smp_mflags}" + +mkdir build +cd build + +%cmake .. \ + -DDEPEND_PATH=%{_sourcedir} \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ +%if %{with tests} + -DENABLE_UNIT_TESTS=ON \ + -DENABLE_FUNC_TESTS=ON +%else + -DENABLE_UNIT_TESTS=OFF \ + -DENABLE_FUNC_TESTS=OFF +%endif + +make $BEAR_MFLAGS_JOBS + +%install +pushd build +make DESTDIR=%{buildroot} install +# Let RPM install it correctly +rm -rf %{buildroot}%{_datadir}/doc +popd + +%files +%license COPYING +%doc README.md +%{_bindir}/bear +%{_bindir}/citnames +%{_bindir}/intercept +%{_mandir}/man1/bear.1* +%{_mandir}/man1/citnames.1* +%{_mandir}/man1/intercept.1* +%{_libdir}/bear/ + +%changelog +* Wed Nov 16 2022 zhaowenyu <804544223@qq.com> - 3.0.20-1 +- Type:Init +- ID:NA +- SUG:NA +- DESC:Init Bear 3.0.20 repository diff --git a/fmt-9.0.0.tar.gz b/fmt-9.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9e47375cea17e2f5edaa8111383f9ad4430f6072 Binary files /dev/null and b/fmt-9.0.0.tar.gz differ diff --git a/googletest-release-1.12.1.tar.gz b/googletest-release-1.12.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..01474122ae3e6d1c60997c9bf2511c3fc152c73c Binary files /dev/null and b/googletest-release-1.12.1.tar.gz differ diff --git a/json-3.10.5.tar.gz b/json-3.10.5.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..3c106def5b9b7a4c01f66a823c18261982836952 Binary files /dev/null and b/json-3.10.5.tar.gz differ diff --git a/spdlog-1.10.0.tar.gz b/spdlog-1.10.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..6b7aeaaee0f430dea153729712ed5a49d891177d Binary files /dev/null and b/spdlog-1.10.0.tar.gz differ