]> git.pld-linux.org Git - packages/re2.git/blob - re2.spec
ff9369aeda2288df8a9b5fc84d0b55b5270e686e
[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  2016-09-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:  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)
21
22 %description
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.
26
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.
30
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).
35
36 %package devel
37 Summary:        C++ header files and library symbolic links for %{name}
38 Group:          Development/Libraries
39 Requires:       %{name} = %{version}-%{release}
40
41 %description devel
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.
45
46 %package static
47 Summary:        Static %{name} library
48 Summary(pl.UTF-8):      Statyczna biblioteka %{name}
49 Group:          Development/Libraries
50 Requires:       %{name}-devel = %{version}-%{release}
51
52 %description static
53 Static %{name} library.
54
55 %description static -l pl.UTF-8
56 Statyczna biblioteka %{name}.
57
58 %prep
59 %setup -q -n %{name}-%{subver}
60 %patch0 -p1
61
62 %build
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} \
66         CXX="%{__cxx}" \
67         CXXFLAGS="%{rpmcxxflags}" \
68         LDFLAGS="%{rpmldflags} -pthread" \
69         includedir=%{_includedir} \
70         libdir=%{_libdir}
71
72 %if %{with tests}
73 %{__make} test \
74         CXX="%{__cxx}" \
75         CXXFLAGS="%{rpmcxxflags}"
76 %endif
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 %{__make} install \
81         INSTALL="install -p" \
82         includedir=%{_includedir} \
83         libdir=%{_libdir} \
84         DESTDIR=$RPM_BUILD_ROOT
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %post   -p /sbin/ldconfig
90 %postun -p /sbin/ldconfig
91
92 %files
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
97
98 %files devel
99 %defattr(644,root,root,755)
100 %doc doc/syntax.txt
101 %{_includedir}/re2
102 %{_libdir}/libre2.so
103 %{_pkgconfigdir}/re2.pc
104
105 %if %{with static_libs}
106 %files static
107 %defattr(644,root,root,755)
108 %{_libdir}/libre2.a
109 %endif
This page took 0.063252 seconds and 2 git commands to generate.