3 %bcond_without tests # build without tests
4 %bcond_without static_libs # don't build static libraries
6 %define subver 2016-09-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: 760ebe39914f81635ad85623502bcb20
16 Patch0: test-compile.patch
17 URL: https://github.com/google/re2
18 BuildRequires: libstdc++-devel
19 BuildRequires: rpmbuild(macros) >= 1.734
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 RE2 is a C++ library providing a fast, safe, thread-friendly
24 alternative to backtracking regular expression engines like those used
25 in PCRE, Perl, and Python.
27 Backtracking engines are typically full of features and convenient
28 syntactic sugar but can be forced into taking exponential amounts of
29 time on even small inputs.
31 In contrast, RE2 uses automata theory to guarantee that regular
32 expression searches run in time linear in the size of the input, at
33 the expense of some missing features (e.g back references and
34 generalized assertions).
37 Summary: C++ header files and library symbolic links for %{name}
38 Group: Development/Libraries
39 Requires: %{name} = %{version}-%{release}
42 This package contains the C++ header files and symbolic links to the
43 shared libraries for %{name}. If you would like to develop programs
44 using %{name}, you will need to install %{name}-devel.
47 Summary: Static %{name} library
48 Summary(pl.UTF-8): Statyczna biblioteka %{name}
49 Group: Development/Libraries
50 Requires: %{name}-devel = %{version}-%{release}
53 Static %{name} library.
55 %description static -l pl.UTF-8
56 Statyczna biblioteka %{name}.
59 %setup -q -n %{name}-%{subver}
63 # The -pthread flag issue has been submitted upstream:
64 # http://groups.google.com/forum/?fromgroups=#!topic/re2-dev/bkUDtO5l6Lo
65 %{__make} all %{?with_tests:compile-test} \
67 CXXFLAGS="%{rpmcxxflags}" \
68 LDFLAGS="%{rpmldflags} -pthread" \
69 includedir=%{_includedir} \
75 CXXFLAGS="%{rpmcxxflags}"
79 rm -rf $RPM_BUILD_ROOT
81 INSTALL="install -p" \
82 includedir=%{_includedir} \
84 DESTDIR=$RPM_BUILD_ROOT
87 rm -rf $RPM_BUILD_ROOT
89 %post -p /sbin/ldconfig
90 %postun -p /sbin/ldconfig
93 %defattr(644,root,root,755)
94 %doc AUTHORS CONTRIBUTORS LICENSE README
95 %attr(755,root,root) %{_libdir}/libre2.so.*.*.*
96 %ghost %{_libdir}/libre2.so.0
99 %defattr(644,root,root,755)
103 %{_pkgconfigdir}/re2.pc
105 %if %{with static_libs}
107 %defattr(644,root,root,755)