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