]> git.pld-linux.org Git - packages/re2.git/blob - re2.spec
41f4b1fd478617d40e47886eb7549833d0cb9dc9
[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         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++
10 Name:           re2
11 Version:        %{ver}
12 Release:        1
13 License:        BSD
14 Group:          Libraries
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)
23
24 %description
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.
28
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.
32
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).
37
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.
42
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.
46
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
50 zapewnień).
51
52 %package devel
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
58
59 %description devel
60 This package contains the C++ header files and symbolic link to the
61 shared RE2 library.
62
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.
66
67 %package static
68 Summary:        Static RE2 library
69 Summary(pl.UTF-8):      Statyczna biblioteka RE2
70 Group:          Development/Libraries
71 Requires:       %{name}-devel = %{version}-%{release}
72
73 %description static
74 Static RE2 library.
75
76 %description static -l pl.UTF-8
77 Statyczna biblioteka RE2.
78
79 %prep
80 %setup -q -n %{name}-%{tagver}
81 %patch0 -p1
82
83 %build
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} \
87         CXX="%{__cxx}" \
88         CXXFLAGS="%{rpmcxxflags}" \
89         LDFLAGS="%{rpmldflags} -pthread" \
90         includedir=%{_includedir} \
91         libdir=%{_libdir}
92
93 %if %{with tests}
94 %{__make} test \
95         CXX="%{__cxx}" \
96         CXXFLAGS="%{rpmcxxflags}"
97 %endif
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101
102 %{__make} install \
103         INSTALL="install -p" \
104         includedir=%{_includedir} \
105         libdir=%{_libdir} \
106         DESTDIR=$RPM_BUILD_ROOT
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %post   -p /sbin/ldconfig
112 %postun -p /sbin/ldconfig
113
114 %files
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
119
120 %files devel
121 %defattr(644,root,root,755)
122 %doc doc/syntax.txt
123 %attr(755,root,root) %{_libdir}/libre2.so
124 %{_includedir}/re2
125 %{_pkgconfigdir}/re2.pc
126
127 %if %{with static_libs}
128 %files static
129 %defattr(644,root,root,755)
130 %{_libdir}/libre2.a
131 %endif
This page took 0.078754 seconds and 2 git commands to generate.