]> git.pld-linux.org Git - packages/re2.git/blob - re2.spec
- added cmake configs (for grpc)
[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 Source1:        re2Config.cmake
19 Source2:        re2Config-pld.cmake.in
20 Patch0:         test-compile.patch
21 URL:            https://github.com/google/re2
22 BuildRequires:  libstdc++-devel >= 6:4.7
23 BuildRequires:  rpmbuild(macros) >= 1.734
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %description
27 RE2 is a C++ library providing a fast, safe, thread-friendly
28 alternative to backtracking regular expression engines like those used
29 in PCRE, Perl, and Python.
30
31 Backtracking engines are typically full of features and convenient
32 syntactic sugar but can be forced into taking exponential amounts of
33 time on even small inputs.
34
35 In contrast, RE2 uses automata theory to guarantee that regular
36 expression searches run in time linear in the size of the input, at
37 the expense of some missing features (e.g back references and
38 generalized assertions).
39
40 %description -l pl.UTF-8
41 RE2 to biblioteka C++ będąca szybką, bezpieczną, przyjazną dla wątków
42 alternatywą dla silników wyrażeń regularnych ze śledzeniem, takimi jak
43 używane w PCRE, Perlu i Pythonie.
44
45 Silniki ze śledzeniem mają zwykle dużo możliwości i wygodny lukier
46 składniowy, ale można je zmusić do wykładniczej złożoności czasowej
47 nawet przy niewielkim wejściu.
48
49 Dla odmiany RE2 używa teorii automatów, aby zagwarantować czas
50 wyszukiwania liniowy względem rozmiaru wejścia kosztem braku
51 niektórych możliwości (np. odwołań wstecznych i uogólnionych
52 zapewnień).
53
54 %package devel
55 Summary:        C++ header files and library symbolic link for RE2
56 Summary(pl.UTF-8):      Pliki nagłówkowe C++ i dowiązanie do biblioteki RE2
57 Group:          Development/Libraries
58 Requires:       %{name} = %{version}-%{release}
59 Requires:       libstdc++-devel >= 6:4.7
60
61 %description devel
62 This package contains the C++ header files and symbolic link to the
63 shared RE2 library.
64
65 %description devel -l pl.UTF-8
66 Ten pakiet zawiera pliki nagłówkowe C++ oraz dowiązanie symboliczne do
67 biblioteki współdzielonej RE2.
68
69 %package static
70 Summary:        Static RE2 library
71 Summary(pl.UTF-8):      Statyczna biblioteka RE2
72 Group:          Development/Libraries
73 Requires:       %{name}-devel = %{version}-%{release}
74
75 %description static
76 Static RE2 library.
77
78 %description static -l pl.UTF-8
79 Statyczna biblioteka RE2.
80
81 %prep
82 %setup -q -n %{name}-%{tagver}
83 %patch0 -p1
84
85 %build
86 # cmake doesn't set soname, doesn't install .pc file - still use plain makefiles
87
88 # The -pthread flag issue has been submitted upstream:
89 # http://groups.google.com/forum/?fromgroups=#!topic/re2-dev/bkUDtO5l6Lo
90 %{__make} all %{?with_tests:compile-test} \
91         CXX="%{__cxx}" \
92         CXXFLAGS="%{rpmcxxflags}" \
93         LDFLAGS="%{rpmldflags} -pthread" \
94         includedir=%{_includedir} \
95         libdir=%{_libdir}
96
97 %if %{with tests}
98 %{__make} test \
99         CXX="%{__cxx}" \
100         CXXFLAGS="%{rpmcxxflags}"
101 %endif
102
103 %install
104 rm -rf $RPM_BUILD_ROOT
105
106 %{__make} install \
107         INSTALL="install -p" \
108         includedir=%{_includedir} \
109         libdir=%{_libdir} \
110         DESTDIR=$RPM_BUILD_ROOT
111
112 # ...but some users require cmake config files, so fake them
113 install -d $RPM_BUILD_ROOT%{_libdir}/cmake/re2
114 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_libdir}/cmake/re2
115 sed -e 's,@libdir@,%{_libdir},' %{SOURCE2} >$RPM_BUILD_ROOT%{_libdir}/cmake/re2/re2Config-pld.cmake
116
117 %clean
118 rm -rf $RPM_BUILD_ROOT
119
120 %post   -p /sbin/ldconfig
121 %postun -p /sbin/ldconfig
122
123 %files
124 %defattr(644,root,root,755)
125 %doc AUTHORS CONTRIBUTORS LICENSE README
126 %attr(755,root,root) %{_libdir}/libre2.so.*.*.*
127 %attr(755,root,root) %ghost %{_libdir}/libre2.so.8
128
129 %files devel
130 %defattr(644,root,root,755)
131 %doc doc/syntax.txt
132 %attr(755,root,root) %{_libdir}/libre2.so
133 %{_includedir}/re2
134 %{_pkgconfigdir}/re2.pc
135 %{_libdir}/cmake/re2
136
137 %if %{with static_libs}
138 %files static
139 %defattr(644,root,root,755)
140 %{_libdir}/libre2.a
141 %endif
This page took 0.071181 seconds and 3 git commands to generate.