]> git.pld-linux.org Git - packages/re2.git/blob - re2.spec
up to 2015-11-01
[packages/re2.git] / re2.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4 %bcond_without  static_libs     # don't build static libraries
5
6 %define         subver  2015-11-01
7 %define         ver             %(echo %{subver} | tr -d -)
8 Summary:        C++ fast alternative to backtracking RE engines
9 Name:           re2
10 Version:        %{ver}
11 Release:        1
12 License:        BSD
13 Group:          Libraries
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)
20
21 %description
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.
25
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.
29
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).
34
35 %package devel
36 Summary:        C++ header files and library symbolic links for %{name}
37 Group:          Development/Libraries
38 Requires:       %{name} = %{version}-%{release}
39
40 %description devel
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.
44
45 %package static
46 Summary:        Static %{name} library
47 Summary(pl.UTF-8):      Statyczna biblioteka %{name}
48 Group:          Development/Libraries
49 Requires:       %{name}-devel = %{version}-%{release}
50
51 %description static
52 Static %{name} library.
53
54 %description static -l pl.UTF-8
55 Statyczna biblioteka %{name}.
56
57 %prep
58 %setup -q -n %{name}-%{subver}
59 %patch0 -p1
60
61 %build
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} \
65         CXX="%{__cxx}" \
66         CXXFLAGS="%{rpmcxxflags}" \
67         LDFLAGS="%{rpmldflags} -pthread" \
68         includedir=%{_includedir} \
69         libdir=%{_libdir}
70
71 %if %{with tests}
72 %{__make} test \
73         CXX="%{__cxx}" \
74         CXXFLAGS="%{rpmcxxflags}"
75 %endif
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 %{__make} install \
80         INSTALL="install -p" \
81         includedir=%{_includedir} \
82         libdir=%{_libdir} \
83         DESTDIR=$RPM_BUILD_ROOT
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %post   -p /sbin/ldconfig
89 %postun -p /sbin/ldconfig
90
91 %files
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
96
97 %files devel
98 %defattr(644,root,root,755)
99 %doc doc/syntax.txt
100 %{_includedir}/re2
101 %{_libdir}/libre2.so
102 %{_pkgconfigdir}/re2.pc
103
104 %if %{with static_libs}
105 %files static
106 %defattr(644,root,root,755)
107 %{_libdir}/libre2.a
108 %endif
This page took 0.095898 seconds and 3 git commands to generate.