1 |
%define pcre_major 1 |
2 |
%define pcrecpp_major 0 |
3 |
%define pcreposix_major 1 |
4 |
%define pcreposix_compat_major 0 |
5 |
%define libname_orig lib%{name} |
6 |
%define libname16_orig lib%{name}16 |
7 |
%define libname32_orig lib%{name}32 |
8 |
%define libname %mklibname pcre %{pcre_major} |
9 |
%define libname16 %mklibname pcre 16 %{pcrecpp_major} |
10 |
%define libname32 %mklibname pcre 32 %{pcrecpp_major} |
11 |
%define libnamecpp %mklibname pcrecpp %{pcrecpp_major} |
12 |
%define libnameposix %mklibname pcreposix %{pcreposix_major} |
13 |
%define libnameposix_compat %mklibname pcreposix %{pcreposix_compat_major} |
14 |
%define develname %mklibname -d pcre |
15 |
%define staticname %mklibname -s -d pcre |
16 |
%define develcpp %mklibname -d pcrecpp |
17 |
%define develposix %mklibname -d pcreposix |
18 |
%define olddevelname %mklibname %{name} 0 -d |
19 |
|
20 |
%define build_pcreposix_compat 1 |
21 |
|
22 |
Summary: Perl-compatible regular expression library |
23 |
Name: pcre |
24 |
Version: 8.45 |
25 |
Release: %mkrel 3 |
26 |
License: BSD-Style |
27 |
Group: File tools |
28 |
URL: https://www.pcre.org/ |
29 |
Source0: ftp://ftp.pcre.org/pub/pcre/%{name}-%{version}.tar.bz2 |
30 |
Source1: ftp://ftp.pcre.org/pub/pcre/%{name}-%{version}.tar.bz2.sig |
31 |
Patch0: pcre-0.6.5-fix-detect-into-kdelibs.patch |
32 |
Patch1: pcre-8.33-linkage-fix.patch |
33 |
# from debian |
34 |
Patch4: pcre-pcreposix-glibc-conflict.patch |
35 |
Patch5: bug2173.patch |
36 |
Patch6: pcre-8.45-bsc1199232-unicode-property-matching.patch |
37 |
BuildRequires: automake |
38 |
Requires: %{libname} = %{version}-%{release} |
39 |
|
40 |
%description |
41 |
PCRE has its own native API, but a set of "wrapper" functions that are based on |
42 |
the POSIX API are also supplied in the library libpcreposix. Note that this |
43 |
just provides a POSIX calling interface to PCRE: the regular expressions |
44 |
themselves still follow Perl syntax and semantics. |
45 |
This package contains a grep variant based on the PCRE library. |
46 |
|
47 |
%package -n %{libname} |
48 |
Group: System/Libraries |
49 |
Summary: Perl-compatible regular expression library |
50 |
Requires(pre): filesystem >= 2.1.9-18 |
51 |
Provides: %{libname_orig} = %{version}-%{release} |
52 |
|
53 |
%description -n %{libname} |
54 |
This package contains the shared library libpcre. |
55 |
|
56 |
%package -n %{libname16} |
57 |
Group: System/Libraries |
58 |
Summary: Perl-compatible regular expression library |
59 |
Requires(pre): filesystem >= 2.1.9-18 |
60 |
Provides: %{libname16_orig} = %{version}-%{release} |
61 |
Obsoletes: %{_lib}pcre16_1 < %{version}-%{release} |
62 |
|
63 |
%description -n %{libname16} |
64 |
This package contains the shared library libpcre. |
65 |
|
66 |
%package -n %{libname32} |
67 |
Group: System/Libraries |
68 |
Summary: Perl-compatible regular expression library |
69 |
Requires(pre): filesystem >= 2.1.9-18 |
70 |
Provides: %{libname32_orig} = %{version}-%{release} |
71 |
Obsoletes: %{_lib}pcre32_1 < %{version}-%{release} |
72 |
|
73 |
%description -n %{libname32} |
74 |
This package contains the shared library libpcre. |
75 |
|
76 |
%package -n %{libnamecpp} |
77 |
Group: System/Libraries |
78 |
Summary: Perl-compatible regular expression library |
79 |
Conflicts: %{_lib}pcre0 < 8.21-3 |
80 |
|
81 |
%description -n %{libnamecpp} |
82 |
This package contains the shared library libpcrecpp. |
83 |
|
84 |
|
85 |
%package -n %{libnameposix} |
86 |
Group: System/Libraries |
87 |
Summary: Perl-compatible regular expression library |
88 |
Conflicts: %{_lib}pcre0 < 8.21-3 |
89 |
|
90 |
%description -n %{libnameposix} |
91 |
This package contains the shared library libpcreposix. |
92 |
|
93 |
|
94 |
%package -n %{libnameposix_compat} |
95 |
Group: System/Libraries |
96 |
Summary: Perl-compatible regular expression library |
97 |
Conflicts: %{_lib}pcre0 < 8.21-3 |
98 |
|
99 |
%description -n %{libnameposix_compat} |
100 |
This package contains the shared library libpcreposix compat. |
101 |
|
102 |
|
103 |
%package -n %{develname} |
104 |
Group: Development/C |
105 |
Summary: Headers for pcre development |
106 |
Requires: %{libname} = %{version}-%{release} |
107 |
Requires: %{libname16} = %{version}-%{release} |
108 |
Requires: %{libname32} = %{version}-%{release} |
109 |
Provides: %{libname_orig}-devel = %{version}-%{release} |
110 |
Provides: %{name}-devel = %{version}-%{release} |
111 |
Obsoletes: %{olddevelname} < 8.21-3 |
112 |
|
113 |
%description -n %{develname} |
114 |
Install this package if you want do compile applications using the pcre |
115 |
library. |
116 |
|
117 |
%package -n %{develcpp} |
118 |
Group: Development/C++ |
119 |
Summary: Headers for pcrecpp development |
120 |
Provides: pcrecpp-devel = %{version}-%{release} |
121 |
Requires: %{libnamecpp} = %{version}-%{release} |
122 |
Requires: %{develname} = %{version}-%{release} |
123 |
Conflicts: pcre-devel < 8.32-4 |
124 |
|
125 |
%description -n %{develcpp} |
126 |
Install this package if you want do compile applications using the pcrecpp |
127 |
library. |
128 |
|
129 |
%package -n %{develposix} |
130 |
Group: Development/C |
131 |
Summary: Headers for pcreposix development |
132 |
Provides: pcreposix-devel = %{version}-%{release} |
133 |
Requires: %{libnameposix} = %{version}-%{release} |
134 |
Requires: %{develname} = %{version}-%{release} |
135 |
Conflicts: pcre-devel < 8.32-4 |
136 |
|
137 |
%description -n %{develposix} |
138 |
Install this package if you want do compile applications using the pcre |
139 |
library. |
140 |
|
141 |
The header file for the POSIX-style functions is called pcreposix.h. The |
142 |
official POSIX name is regex.h, but I didn't want to risk possible problems |
143 |
with existing files of that name by distributing it that way. To use it with an |
144 |
existing program that uses the POSIX API, it will have to be renamed or pointed |
145 |
at by a link. |
146 |
|
147 |
%package -n %{staticname} |
148 |
Group: Development/C |
149 |
Summary: Library file for linking statically to PCRE |
150 |
Provides: pcre-static-devel = %{version}-%{release} |
151 |
Requires: %{develname} = %{version}-%{release} |
152 |
|
153 |
%description -n %{staticname} |
154 |
Library file for linking statically against PCRE. |
155 |
|
156 |
%prep |
157 |
%setup -q |
158 |
%patch0 -p1 -b .detect-into-kdelibs |
159 |
%patch1 -p1 -b .linkage-fix |
160 |
|
161 |
%if %{build_pcreposix_compat} |
162 |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
163 |
# create a libpcreposix.so.0 without the patch |
164 |
cp -a . ../pcre-with-pcreposix_compat && mv ../pcre-with-pcreposix_compat . |
165 |
%endif |
166 |
%patch4 -p1 -b .symbol-conflict |
167 |
%patch5 -p1 |
168 |
%patch6 -p1 |
169 |
|
170 |
%build |
171 |
%if %{build_pcreposix_compat} |
172 |
dirs="pcre-with-pcreposix_compat ." |
173 |
%else |
174 |
dirs="." |
175 |
%endif |
176 |
for i in $dirs; do |
177 |
cd $i |
178 |
mkdir -p m4 |
179 |
autoreconf -fi |
180 |
%configure \ |
181 |
--enable-static \ |
182 |
--enable-utf \ |
183 |
--enable-unicode-properties \ |
184 |
--enable-pcre8 \ |
185 |
--enable-pcre16 \ |
186 |
--enable-pcre32 \ |
187 |
--enable-jit |
188 |
%make_build |
189 |
cd - |
190 |
done |
191 |
|
192 |
%check |
193 |
export LC_ALL=C |
194 |
%__make check |
195 |
|
196 |
%install |
197 |
%if %{build_pcreposix_compat} |
198 |
%make_install -C pcre-with-pcreposix_compat |
199 |
%endif |
200 |
%make_install |
201 |
|
202 |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
203 |
|
204 |
# Remove unwanted files |
205 |
rm -f %{buildroot}%{_docdir}/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
206 |
rm -f %{buildroot}%{_docdir}/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
207 |
rm -f %{buildroot}%{_docdir}/pcre/{pcretest.txt,README} |
208 |
rm -rf %{buildroot}%{_docdir}/pcre/html |
209 |
rm -f %{buildroot}%{_libdir}/*.la |
210 |
|
211 |
%files |
212 |
%doc AUTHORS COPYING LICENCE NEWS README |
213 |
%{_mandir}/man1/pcregrep.1* |
214 |
%{_mandir}/man1/pcretest.1* |
215 |
%{_bindir}/pcregrep |
216 |
%{_bindir}/pcretest |
217 |
|
218 |
%files -n %{libname} |
219 |
%{_libdir}/libpcre.so.%{pcre_major}{,.*} |
220 |
|
221 |
%files -n %{libname16} |
222 |
%{_libdir}/libpcre16.so.%{pcrecpp_major}{,.*} |
223 |
|
224 |
%files -n %{libname32} |
225 |
%{_libdir}/libpcre32.so.%{pcrecpp_major}{,.*} |
226 |
|
227 |
%files -n %{libnamecpp} |
228 |
%{_libdir}/libpcrecpp.so.%{pcrecpp_major}{,.*} |
229 |
|
230 |
%if %{build_pcreposix_compat} |
231 |
%files -n %{libnameposix_compat} |
232 |
%{_libdir}/libpcreposix.so.%{pcreposix_compat_major}{,.*} |
233 |
%endif |
234 |
|
235 |
%files -n %{libnameposix} |
236 |
%{_libdir}/libpcreposix.so.%{pcreposix_major}{,.*} |
237 |
|
238 |
%files -n %{develname} |
239 |
%doc doc/html |
240 |
%doc ChangeLog |
241 |
%{_libdir}/libpcre.so |
242 |
%{_libdir}/libpcre16.so |
243 |
%{_libdir}/libpcre32.so |
244 |
%{_includedir}/pcre.h |
245 |
%{_includedir}/pcre_*.h |
246 |
%{_libdir}/pkgconfig/libpcre.pc |
247 |
%{_libdir}/pkgconfig/libpcre16.pc |
248 |
%{_libdir}/pkgconfig/libpcre32.pc |
249 |
%{_bindir}/pcre-config |
250 |
%multiarch %{multiarch_bindir}/pcre-config |
251 |
%{_mandir}/man1/pcre-config.1* |
252 |
%{_mandir}/man3/*.3* |
253 |
%exclude %{_libdir}/libpcreposix.so |
254 |
%exclude %{_mandir}/man3/pcreposix.3* |
255 |
|
256 |
%files -n %{develcpp} |
257 |
%{_includedir}/pcrecpp*.h |
258 |
%{_libdir}/libpcrecpp.so |
259 |
%{_libdir}/pkgconfig/libpcrecpp.pc |
260 |
%{_mandir}/man3/pcrecpp.3* |
261 |
|
262 |
%files -n %{develposix} |
263 |
%{_includedir}/pcreposix.h |
264 |
%{_libdir}/libpcreposix.so |
265 |
%{_libdir}/pkgconfig/libpcreposix.pc |
266 |
%{_mandir}/man3/pcreposix.3* |
267 |
|
268 |
%files -n %{staticname} |
269 |
%{_libdir}/*.a |