diff --git a/re2.spec b/re2.spec index d2401aaed8fa8b45b177606b32f2526113f9aac4..edf2ad20e7b766dfb3e241c51055914a560bc96b 100644 --- a/re2.spec +++ b/re2.spec @@ -1,12 +1,16 @@ Name: re2 Version: 20240702 -Release: 1 +Release: 2 Summary: Provide backtracking RE engine -License: BSD -URL: http://github.com/google/re2/ +License: BSD-3-Clause +URL: https://github.com/google/re2/ Source0: https://github.com/google/re2/archive/re2-2024-07-02.tar.gz Patch1: add-some-testcases-for-abnormal-branches.patch -BuildRequires: gcc-c++ abseil-cpp-devel +BuildRequires: gcc-c++ +BuildRequires: cmake >= 3.13 +BuildRequires: ninja-build +BuildRequires: abseil-cpp-devel +BuildRequires: libicu-devel %description RE2 is a fast, safe, thread-friendly alternative to backtracking regular @@ -24,34 +28,30 @@ If you want to develop programs using re2, you need to install re2-devel. %autosetup -n %{name}-2024-07-02 -p1 %build -sed -i 's/RE2_LDFLAGS?=-pthread/RE2_LDFLAGS?=-pthread -Wl,--as-needed/g' Makefile -%make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++17" \ - LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread" \ - includedir=%{_includedir} libdir=%{_libdir} +%cmake \ + -DRE2_BUILD_TESTING:BOOL=OFF \ + -DRE2_USE_ICU:BOOL=ON \ + -GNinja +%cmake_build %install -%make_install includedir=%{_includedir} libdir=%{_libdir} - -%check -export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH -%ctest || true - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig +%cmake_install %files -%doc README LICENSE +%license LICENSE +%doc README %{_libdir}/lib%{name}.so.* %files devel %{_includedir}/%{name} -%{_libdir}/{lib%{name}.so,pkgconfig/%{name}.pc} -%exclude %{_libdir}/libre2.a +%{_libdir}/lib%{name}.so +%{_libdir}/cmake/re2 +%{_libdir}/pkgconfig/%{name}.pc %changelog +* Sun May 11 2025 Funda Wang - 20240702-2 +- build with cmake + * Mon Nov 04 2024 zhangxianjun - 20240702-1 - update to 20240702