3 %bcond_without tests # build without tests
4 %bcond_without static_libs # don't build static libraries
6 %define tagver 2020-08-01
7 %define ver %(echo %{tagver} | tr -d -)
8 Summary: C++ fast alternative to backtracking RE engines
9 Summary(pl.UTF-8): Szybka alternatywna dla silników RE w C++
15 #Source0Download: https://github.com/google/re2/releases
16 Source0: https://github.com/google/re2/archive/%{tagver}/%{name}-%{tagver}.tar.gz
17 # Source0-md5: 6dbd1d52b21d2d0307495bf075e45d42
18 Patch0: test-compile.patch
19 URL: https://github.com/google/re2
20 BuildRequires: libstdc++-devel >= 6:4.7
21 BuildRequires: rpmbuild(macros) >= 1.734
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 RE2 is a C++ library providing a fast, safe, thread-friendly
26 alternative to backtracking regular expression engines like those used
27 in PCRE, Perl, and Python.
29 Backtracking engines are typically full of features and convenient
30 syntactic sugar but can be forced into taking exponential amounts of
31 time on even small inputs.
33 In contrast, RE2 uses automata theory to guarantee that regular
34 expression searches run in time linear in the size of the input, at
35 the expense of some missing features (e.g back references and
36 generalized assertions).
38 %description -l pl.UTF-8
39 RE2 to biblioteka C++ będąca szybką, bezpieczną, przyjazną dla wątków
40 alternatywą dla silników wyrażeń regularnych ze śledzeniem, takimi jak
41 używane w PCRE, Perlu i Pythonie.
43 Silniki ze śledzeniem mają zwykle dużo możliwości i wygodny lukier
44 składniowy, ale można je zmusić do wykładniczej złożoności czasowej
45 nawet przy niewielkim wejściu.
47 Dla odmiany RE2 używa teorii automatów, aby zagwarantować czas
48 wyszukiwania liniowy względem rozmiaru wejścia kosztem braku
49 niektórych możliwości (np. odwołań wstecznych i uogólnionych
53 Summary: C++ header files and library symbolic link for RE2
54 Summary(pl.UTF-8): Pliki nagłówkowe C++ i dowiązanie do biblioteki RE2
55 Group: Development/Libraries
56 Requires: %{name} = %{version}-%{release}
57 Requires: libstdc++-devel >= 6:4.7
60 This package contains the C++ header files and symbolic link to the
63 %description devel -l pl.UTF-8
64 Ten pakiet zawiera pliki nagłówkowe C++ oraz dowiązanie symboliczne do
65 biblioteki współdzielonej RE2.
68 Summary: Static RE2 library
69 Summary(pl.UTF-8): Statyczna biblioteka RE2
70 Group: Development/Libraries
71 Requires: %{name}-devel = %{version}-%{release}
76 %description static -l pl.UTF-8
77 Statyczna biblioteka RE2.
80 %setup -q -n %{name}-%{tagver}
84 # The -pthread flag issue has been submitted upstream:
85 # http://groups.google.com/forum/?fromgroups=#!topic/re2-dev/bkUDtO5l6Lo
86 %{__make} all %{?with_tests:compile-test} \
88 CXXFLAGS="%{rpmcxxflags}" \
89 LDFLAGS="%{rpmldflags} -pthread" \
90 includedir=%{_includedir} \
96 CXXFLAGS="%{rpmcxxflags}"
100 rm -rf $RPM_BUILD_ROOT
103 INSTALL="install -p" \
104 includedir=%{_includedir} \
106 DESTDIR=$RPM_BUILD_ROOT
109 rm -rf $RPM_BUILD_ROOT
111 %post -p /sbin/ldconfig
112 %postun -p /sbin/ldconfig
115 %defattr(644,root,root,755)
116 %doc AUTHORS CONTRIBUTORS LICENSE README
117 %attr(755,root,root) %{_libdir}/libre2.so.*.*.*
118 %attr(755,root,root) %ghost %{_libdir}/libre2.so.8
121 %defattr(644,root,root,755)
123 %attr(755,root,root) %{_libdir}/libre2.so
125 %{_pkgconfigdir}/re2.pc
127 %if %{with static_libs}
129 %defattr(644,root,root,755)