1 |
%define major 0 |
%define pcre_major 1 |
2 |
|
%define pcrecpp_major 0 |
3 |
%define pcreposix_major 1 |
%define pcreposix_major 1 |
4 |
%define libname_orig lib%{name} |
%define pcreposix_compat_major 0 |
5 |
%define libname %mklibname pcre %{major} |
%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 |
%define develname %mklibname -d pcre |
15 |
|
%define develcpp %mklibname -d pcrecpp |
16 |
|
%define develposix %mklibname -d pcreposix |
17 |
|
%define olddevelname %mklibname %{name} 0 -d |
18 |
|
|
19 |
%define build_pcreposix_compat 1 |
%define build_pcreposix_compat 1 |
20 |
|
|
21 |
Summary: Perl-compatible regular expression library |
Summary: Perl-compatible regular expression library |
22 |
Name: pcre |
Name: pcre |
23 |
Version: 8.21 |
Version: 8.35 |
24 |
Release: %mkrel 1 |
Release: %mkrel 2 |
25 |
License: BSD-Style |
License: BSD-Style |
26 |
Group: File tools |
Group: File tools |
27 |
URL: http://www.pcre.org/ |
URL: http://www.pcre.org/ |
28 |
Source0: http://downloads.sourceforge.net/pcre/%{name}-%{version}.tar.bz2 |
Source0: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2 |
29 |
Source1: http://downloads.sourceforge.net/pcre/%{name}-%{version}.tar.bz2.sig |
Source1: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2.sig |
30 |
Requires: %{libname} = %{version}-%{release} |
Requires: %{libname} = %{version}-%{release} |
31 |
BuildRequires: automake |
BuildRequires: automake |
32 |
Patch1: pcre-0.6.5-fix-detect-into-kdelibs.patch |
Patch0: pcre-0.6.5-fix-detect-into-kdelibs.patch |
33 |
Patch2: pcre-linkage_fix.diff |
Patch1: pcre-8.33-linkage-fix.patch |
|
Patch3: pcre-7.8-format_not_a_string_literal_and_no_format_arguments.diff |
|
34 |
# from debian: |
# from debian: |
35 |
Patch4: pcre-pcreposix-glibc-conflict.patch |
Patch4: pcre-pcreposix-glibc-conflict.patch |
36 |
|
# from fedora |
37 |
|
# upstream bug #1463 |
38 |
|
Patch5: pcre-8.35-Do-not-rely-on-wrapping-signed-integer-while-parsein.patch |
39 |
|
# upstream bug #1492 |
40 |
|
Patch6: pcre-8.35-Fix-bad-starting-data-when-char-with-more-than-one-o.patch |
41 |
|
# upstream bug #1493 |
42 |
|
Patch7: pcre-8.35-Fix-not-including-VT-in-starting-characters-for-s.patch |
43 |
|
# upstream bug #1494 |
44 |
|
Patch8: pcre-8.35-Fix-bad-compile-of-Qx-.-where-x-is-any-character.patch |
45 |
|
# upstream bug #1500 |
46 |
|
Patch9: pcre-8.35-Fix-empty-matching-possessive-zero-repeat-groups-bug.patch |
47 |
|
# upstream bug #1502 |
48 |
|
Patch10: pcre-8.35-Fixed-several-memory-leaks-in-pcregrep.patch |
49 |
|
# upstream bug #1503 |
50 |
|
Patch11: pcre-8.35-Fix-compiler-crash-misbehaviour-for-zero-repeated-gr.patch |
51 |
|
# upstream bug #1515 |
52 |
|
Patch12: pcre-8.35-Fix-compile-time-loop-for-recursive-reference-within.patch |
53 |
|
|
54 |
|
|
55 |
%description |
%description |
56 |
PCRE has its own native API, but a set of "wrapper" functions that are based on |
PCRE has its own native API, but a set of "wrapper" functions that are based on |
62 |
%package -n %{libname} |
%package -n %{libname} |
63 |
Group: System/Libraries |
Group: System/Libraries |
64 |
Summary: Perl-compatible regular expression library |
Summary: Perl-compatible regular expression library |
65 |
|
Requires(pre): filesystem >= 2.1.9-18 |
66 |
Provides: %{libname_orig} = %{version}-%{release} |
Provides: %{libname_orig} = %{version}-%{release} |
|
Conflicts: pcre <= 4.0 |
|
67 |
|
|
68 |
%description -n %{libname} |
%description -n %{libname} |
69 |
PCRE has its own native API, but a set of "wrapper" functions that are based on |
This package contains the shared library libpcre. |
70 |
the POSIX API are also supplied in the library libpcreposix. Note that this |
|
71 |
just provides a POSIX calling interface to PCRE: the regular expressions |
%package -n %{libname16} |
72 |
themselves still follow Perl syntax and semantics. The header file |
Group: System/Libraries |
73 |
for the POSIX-style functions is called pcreposix.h. The official POSIX name is |
Summary: Perl-compatible regular expression library |
74 |
regex.h, but I didn't want to risk possible problems with existing files of |
Requires(pre): filesystem >= 2.1.9-18 |
75 |
that name by distributing it that way. To use it with an existing program that |
Provides: %{libname16_orig} = %{version}-%{release} |
76 |
uses the POSIX API, it will have to be renamed or pointed at by a link. |
Obsoletes: %{_lib}pcre16_1 < %{version}-%{release} |
77 |
|
|
78 |
|
%description -n %{libname16} |
79 |
|
This package contains the shared library libpcre. |
80 |
|
|
81 |
|
%package -n %{libname32} |
82 |
|
Group: System/Libraries |
83 |
|
Summary: Perl-compatible regular expression library |
84 |
|
Requires(pre): filesystem >= 2.1.9-18 |
85 |
|
Provides: %{libname32_orig} = %{version}-%{release} |
86 |
|
Obsoletes: %{_lib}pcre32_1 < %{version}-%{release} |
87 |
|
|
88 |
|
%description -n %{libname32} |
89 |
|
This package contains the shared library libpcre. |
90 |
|
|
91 |
|
%package -n %{libnamecpp} |
92 |
|
Group: System/Libraries |
93 |
|
Summary: Perl-compatible regular expression library |
94 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
95 |
|
|
96 |
|
%description -n %{libnamecpp} |
97 |
|
This package contains the shared library libpcrecpp. |
98 |
|
|
99 |
|
|
100 |
|
%package -n %{libnameposix} |
101 |
|
Group: System/Libraries |
102 |
|
Summary: Perl-compatible regular expression library |
103 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
104 |
|
|
105 |
|
%description -n %{libnameposix} |
106 |
|
This package contains the shared library libpcreposix. |
107 |
|
|
108 |
|
|
109 |
|
%package -n %{libnameposix_compat} |
110 |
|
Group: System/Libraries |
111 |
|
Summary: Perl-compatible regular expression library |
112 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
113 |
|
|
114 |
|
%description -n %{libnameposix_compat} |
115 |
|
This package contains the shared library libpcreposix compat. |
116 |
|
|
117 |
|
|
118 |
%package -n %{develname} |
%package -n %{develname} |
119 |
Group: Development/C |
Group: Development/C |
120 |
Summary: Headers and static lib for pcre development |
Summary: Headers and static lib for pcre development |
121 |
Requires: %{libname} = %{version}-%{release} |
Requires: %{libname} = %{version}-%{release} |
122 |
|
Requires: %{libname16} = %{version}-%{release} |
123 |
|
Requires: %{libname32} = %{version}-%{release} |
124 |
Provides: %{libname_orig}-devel = %{version}-%{release} |
Provides: %{libname_orig}-devel = %{version}-%{release} |
125 |
Provides: %{name}-devel = %{version}-%{release} |
Provides: %{name}-devel = %{version}-%{release} |
126 |
Obsoletes: %mklibname pcre 0 -d |
Obsoletes: %{olddevelname} < 8.21-3 |
|
Conflicts: pcre <= 4.0 |
|
127 |
|
|
128 |
%description -n %{develname} |
%description -n %{develname} |
129 |
Install this package if you want do compile applications using the pcre |
Install this package if you want do compile applications using the pcre |
130 |
library. |
library. |
131 |
|
|
132 |
%prep |
%package -n %{develcpp} |
133 |
|
Group: Development/C++ |
134 |
|
Summary: Headers and static lib for pcrecpp development |
135 |
|
Provides: pcrecpp-devel = %{version}-%{release} |
136 |
|
Requires: %{libnamecpp} = %{version}-%{release} |
137 |
|
Requires: %{develname} = %{version}-%{release} |
138 |
|
Conflicts: pcre-devel < 8.32-4 |
139 |
|
|
140 |
%setup -q |
%description -n %{develcpp} |
141 |
%patch1 -p1 -b .detect_into_kdelibs |
Install this package if you want do compile applications using the pcrecpp |
142 |
%patch2 -p0 |
library. |
143 |
|
|
144 |
|
%package -n %{develposix} |
145 |
|
Group: Development/C |
146 |
|
Summary: Headers and static lib for pcreposix development |
147 |
|
Provides: pcreposix-devel = %{version}-%{release} |
148 |
|
Requires: %{libnameposix} = %{version}-%{release} |
149 |
|
Requires: %{develname} = %{version}-%{release} |
150 |
|
Conflicts: pcre-devel < 8.32-4 |
151 |
|
|
152 |
|
%description -n %{develposix} |
153 |
|
Install this package if you want do compile applications using the pcre |
154 |
|
library. |
155 |
|
|
156 |
|
The header file for the POSIX-style functions is called pcreposix.h. The |
157 |
|
official POSIX name is regex.h, but I didn't want to risk possible problems |
158 |
|
with existing files of that name by distributing it that way. To use it with an |
159 |
|
existing program that uses the POSIX API, it will have to be renamed or pointed |
160 |
|
at by a link. |
161 |
|
|
162 |
|
%prep |
163 |
|
%setup -q |
164 |
|
%patch0 -p1 -b .detect-into-kdelibs |
165 |
|
%patch1 -p1 -b .linkage-fix |
166 |
|
%patch5 -p1 -b .do-not-rely |
167 |
|
%patch6 -p1 -b .bad-start |
168 |
|
%patch7 -p1 -b .vt-not-included |
169 |
|
%patch8 -p1 -b .bad-Qx-compile |
170 |
|
%patch9 -p1 -b .empty-matching |
171 |
|
%patch10 -p1 -b .memory-leaks |
172 |
|
%patch11 -p1 -b .zero-grs |
173 |
|
%patch12 -p1 -b .recurse-within |
174 |
|
|
175 |
%if %{build_pcreposix_compat} |
%if %{build_pcreposix_compat} |
176 |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
189 |
cd $i |
cd $i |
190 |
mkdir -p m4 |
mkdir -p m4 |
191 |
autoreconf -fi |
autoreconf -fi |
192 |
%configure2_5x --enable-utf8 --enable-unicode-properties |
%configure2_5x \ |
193 |
|
--disable-static \ |
194 |
|
--enable-utf \ |
195 |
|
--enable-unicode-properties \ |
196 |
|
--enable-pcre8 \ |
197 |
|
--enable-pcre16 \ |
198 |
|
--enable-pcre32 \ |
199 |
|
--enable-jit |
200 |
%make |
%make |
201 |
cd - |
cd - |
202 |
done |
done |
203 |
|
|
204 |
%check |
%check |
205 |
export LC_ALL=C |
export LC_ALL=C |
|
# Tests, patch out actual pcre_study_size in expected results |
|
|
#echo 'int main() { printf("%d", sizeof(pcre_study_data)); return 0; }' | \ |
|
|
#%{__cc} -xc - -include "pcre_internal.h" -I. -o study_size |
|
|
#STUDY_SIZE=`./study_size` |
|
|
#perl -pi -e "s,(Study size\s+=\s+)\d+,\${1}$STUDY_SIZE," testdata/testoutput* |
|
206 |
make check |
make check |
207 |
|
|
208 |
%install |
%install |
213 |
|
|
214 |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
215 |
|
|
|
mkdir -p %{buildroot}/%_lib |
|
|
mv %{buildroot}/%_libdir/lib%{name}.so.%{major}.* $RPM_BUILD_ROOT/%_lib |
|
|
cd %{buildroot}/%_libdir |
|
|
ln -s ../../%_lib/lib%{name}.so.%{major}.* . |
|
|
|
|
216 |
# Remove unwanted files |
# Remove unwanted files |
217 |
rm -f %{buildroot}/%_docdir/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
rm -f %{buildroot}%{_docdir}/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
218 |
rm -f %{buildroot}/%_docdir/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
rm -f %{buildroot}%{_docdir}/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
219 |
rm -f %{buildroot}/%_docdir/pcre/{pcretest.txt,README} |
rm -f %{buildroot}%{_docdir}/pcre/{pcretest.txt,README} |
220 |
rm -rf %{buildroot}/%_docdir/pcre/html |
rm -rf %{buildroot}%{_docdir}/pcre/html |
221 |
rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/*.a |
rm -f %{buildroot}%{_libdir}/*.la |
222 |
|
|
223 |
%files |
%files |
224 |
%_mandir/man1/pcregrep.1* |
%doc AUTHORS COPYING LICENCE NEWS README |
225 |
%_mandir/man1/pcretest.1* |
%{_mandir}/man1/pcregrep.1* |
226 |
%_bindir/pcregrep |
%{_mandir}/man1/pcretest.1* |
227 |
%_bindir/pcretest |
%{_bindir}/pcregrep |
228 |
|
%{_bindir}/pcretest |
229 |
|
|
230 |
%files -n %{libname} |
%files -n %{libname} |
231 |
%doc AUTHORS COPYING LICENCE NEWS README |
%{_libdir}/libpcre.so.%{pcre_major}* |
232 |
/%_lib/lib*.so.%{major}* |
|
233 |
%_libdir/lib*.so.%{major}* |
%files -n %{libname16} |
234 |
%_libdir/libpcreposix.so.%{pcreposix_major}* |
%{_libdir}/libpcre16.so.%{pcrecpp_major}* |
235 |
|
|
236 |
|
%files -n %{libname32} |
237 |
|
%{_libdir}/libpcre32.so.%{pcrecpp_major}* |
238 |
|
|
239 |
|
%files -n %{libnamecpp} |
240 |
|
%{_libdir}/libpcrecpp.so.%{pcrecpp_major}* |
241 |
|
|
242 |
|
%if %{build_pcreposix_compat} |
243 |
|
%files -n %{libnameposix_compat} |
244 |
|
%{_libdir}/libpcreposix.so.%{pcreposix_compat_major}* |
245 |
|
%endif |
246 |
|
|
247 |
|
%files -n %{libnameposix} |
248 |
|
%{_libdir}/libpcreposix.so.%{pcreposix_major}* |
249 |
|
|
250 |
%files -n %{develname} |
%files -n %{develname} |
251 |
%doc doc/html |
%doc doc/html |
252 |
%doc ChangeLog |
%doc ChangeLog |
253 |
%_libdir/lib*.so |
%{_libdir}/libpcre.so |
254 |
%_includedir/*.h |
%{_libdir}/libpcre16.so |
255 |
%_libdir/pkgconfig/libpcre.pc |
%{_libdir}/libpcre32.so |
256 |
%_libdir/pkgconfig/libpcrecpp.pc |
%{_includedir}/pcre.h |
257 |
%_libdir/pkgconfig/libpcreposix.pc |
%{_includedir}/pcre_*.h |
258 |
%_bindir/pcre-config |
%{_libdir}/pkgconfig/libpcre.pc |
259 |
|
%{_libdir}/pkgconfig/libpcre16.pc |
260 |
|
%{_libdir}/pkgconfig/libpcre32.pc |
261 |
|
%{_bindir}/pcre-config |
262 |
%multiarch %{multiarch_bindir}/pcre-config |
%multiarch %{multiarch_bindir}/pcre-config |
263 |
%_mandir/man1/pcre-config.1* |
%{_mandir}/man1/pcre-config.1* |
264 |
%_mandir/man3/*.3* |
%{_mandir}/man3/*.3* |
265 |
|
%exclude %{_libdir}/libpcreposix.so |
266 |
|
%exclude %{_mandir}/man3/pcreposix.3* |
267 |
|
|
268 |
|
%files -n %{develcpp} |
269 |
|
%{_includedir}/pcrecpp*.h |
270 |
|
%{_libdir}/libpcrecpp.so |
271 |
|
%{_libdir}/pkgconfig/libpcrecpp.pc |
272 |
|
%{_mandir}/man3/pcrecpp.3* |
273 |
|
|
274 |
|
%files -n %{develposix} |
275 |
|
%{_includedir}/pcreposix.h |
276 |
|
%{_libdir}/libpcreposix.so |
277 |
|
%{_libdir}/pkgconfig/libpcreposix.pc |
278 |
|
%{_mandir}/man3/pcreposix.3* |