3 %bcond_without tests # build without tests
4 %bcond_without static_libs # don't build static libraries
6 %define subver 2015-11-01
7 %define ver %(echo %{subver} | tr -d -)
8 Summary: C++ fast alternative to backtracking RE engines
14 Source0: https://github.com/google/re2/archive/%{subver}/%{name}-%{version}.tar.gz
15 # Source0-md5: e98d80675420f698c1ce7996ec4c474b
16 Patch0: test-compile.patch
17 URL: https://github.com/google/re2
18 BuildRequires: libstdc++-devel
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 RE2 is a C++ library providing a fast, safe, thread-friendly
23 alternative to backtracking regular expression engines like those used
24 in PCRE, Perl, and Python.
26 Backtracking engines are typically full of features and convenient
27 syntactic sugar but can be forced into taking exponential amounts of
28 time on even small inputs.
30 In contrast, RE2 uses automata theory to guarantee that regular
31 expression searches run in time linear in the size of the input, at
32 the expense of some missing features (e.g back references and
33 generalized assertions).
36 Summary: C++ header files and library symbolic links for %{name}
37 Group: Development/Libraries
38 Requires: %{name} = %{version}-%{release}
41 This package contains the C++ header files and symbolic links to the
42 shared libraries for %{name}. If you would like to develop programs
43 using %{name}, you will need to install %{name}-devel.
46 Summary: Static %{name} library
47 Summary(pl.UTF-8): Statyczna biblioteka %{name}
48 Group: Development/Libraries
49 Requires: %{name}-devel = %{version}-%{release}
52 Static %{name} library.
54 %description static -l pl.UTF-8
55 Statyczna biblioteka %{name}.
58 %setup -q -n %{name}-%{subver}
62 # The -pthread flag issue has been submitted upstream:
63 # http://groups.google.com/forum/?fromgroups=#!topic/re2-dev/bkUDtO5l6Lo
64 %{__make} all %{?with_tests:compile-test} \
66 CXXFLAGS="%{rpmcxxflags}" \
67 LDFLAGS="%{rpmldflags} -pthread" \
68 includedir=%{_includedir} \
74 CXXFLAGS="%{rpmcxxflags}"
78 rm -rf $RPM_BUILD_ROOT
80 INSTALL="install -p" \
81 includedir=%{_includedir} \
83 DESTDIR=$RPM_BUILD_ROOT
86 rm -rf $RPM_BUILD_ROOT
88 %post -p /sbin/ldconfig
89 %postun -p /sbin/ldconfig
92 %defattr(644,root,root,755)
93 %doc AUTHORS CONTRIBUTORS LICENSE README
94 %attr(755,root,root) %{_libdir}/libre2.so.*.*.*
95 %ghost %{_libdir}/libre2.so.0
98 %defattr(644,root,root,755)
102 %{_pkgconfigdir}/re2.pc
104 %if %{with static_libs}
106 %defattr(644,root,root,755)