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.13 |
Version: 8.37 |
24 |
Release: %mkrel 1 |
Release: %mkrel 1 |
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: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%name-%version.tar.bz2 |
Source0: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/%{name}-%{version}.tar.bz2 |
29 |
Source1: ftp://ftp.csx.cam.ac.uk/pub/software/programming/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 |
|
|
37 |
|
|
38 |
%description |
%description |
39 |
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 |
40 |
the POSIX API are also supplied in the library libpcreposix. Note that this |
the POSIX API are also supplied in the library libpcreposix. Note that this |
45 |
%package -n %{libname} |
%package -n %{libname} |
46 |
Group: System/Libraries |
Group: System/Libraries |
47 |
Summary: Perl-compatible regular expression library |
Summary: Perl-compatible regular expression library |
48 |
|
Requires(pre): filesystem >= 2.1.9-18 |
49 |
Provides: %{libname_orig} = %{version}-%{release} |
Provides: %{libname_orig} = %{version}-%{release} |
|
Conflicts: pcre <= 4.0 |
|
50 |
|
|
51 |
%description -n %{libname} |
%description -n %{libname} |
52 |
PCRE has its own native API, but a set of "wrapper" functions that are based on |
This package contains the shared library libpcre. |
53 |
the POSIX API are also supplied in the library libpcreposix. Note that this |
|
54 |
just provides a POSIX calling interface to PCRE: the regular expressions |
%package -n %{libname16} |
55 |
themselves still follow Perl syntax and semantics. The header file |
Group: System/Libraries |
56 |
for the POSIX-style functions is called pcreposix.h. The official POSIX name is |
Summary: Perl-compatible regular expression library |
57 |
regex.h, but I didn't want to risk possible problems with existing files of |
Requires(pre): filesystem >= 2.1.9-18 |
58 |
that name by distributing it that way. To use it with an existing program that |
Provides: %{libname16_orig} = %{version}-%{release} |
59 |
uses the POSIX API, it will have to be renamed or pointed at by a link. |
Obsoletes: %{_lib}pcre16_1 < %{version}-%{release} |
60 |
|
|
61 |
|
%description -n %{libname16} |
62 |
|
This package contains the shared library libpcre. |
63 |
|
|
64 |
|
%package -n %{libname32} |
65 |
|
Group: System/Libraries |
66 |
|
Summary: Perl-compatible regular expression library |
67 |
|
Requires(pre): filesystem >= 2.1.9-18 |
68 |
|
Provides: %{libname32_orig} = %{version}-%{release} |
69 |
|
Obsoletes: %{_lib}pcre32_1 < %{version}-%{release} |
70 |
|
|
71 |
|
%description -n %{libname32} |
72 |
|
This package contains the shared library libpcre. |
73 |
|
|
74 |
|
%package -n %{libnamecpp} |
75 |
|
Group: System/Libraries |
76 |
|
Summary: Perl-compatible regular expression library |
77 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
78 |
|
|
79 |
|
%description -n %{libnamecpp} |
80 |
|
This package contains the shared library libpcrecpp. |
81 |
|
|
82 |
|
|
83 |
|
%package -n %{libnameposix} |
84 |
|
Group: System/Libraries |
85 |
|
Summary: Perl-compatible regular expression library |
86 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
87 |
|
|
88 |
|
%description -n %{libnameposix} |
89 |
|
This package contains the shared library libpcreposix. |
90 |
|
|
91 |
|
|
92 |
|
%package -n %{libnameposix_compat} |
93 |
|
Group: System/Libraries |
94 |
|
Summary: Perl-compatible regular expression library |
95 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
96 |
|
|
97 |
|
%description -n %{libnameposix_compat} |
98 |
|
This package contains the shared library libpcreposix compat. |
99 |
|
|
100 |
|
|
101 |
%package -n %{develname} |
%package -n %{develname} |
102 |
Group: Development/C |
Group: Development/C |
103 |
Summary: Headers and static lib for pcre development |
Summary: Headers and static lib for pcre development |
104 |
Requires: %{libname} = %{version}-%{release} |
Requires: %{libname} = %{version}-%{release} |
105 |
|
Requires: %{libname16} = %{version}-%{release} |
106 |
|
Requires: %{libname32} = %{version}-%{release} |
107 |
Provides: %{libname_orig}-devel = %{version}-%{release} |
Provides: %{libname_orig}-devel = %{version}-%{release} |
108 |
Provides: %{name}-devel = %{version}-%{release} |
Provides: %{name}-devel = %{version}-%{release} |
109 |
Obsoletes: %mklibname pcre 0 -d |
Obsoletes: %{olddevelname} < 8.21-3 |
|
Conflicts: pcre <= 4.0 |
|
110 |
|
|
111 |
%description -n %{develname} |
%description -n %{develname} |
112 |
Install this package if you want do compile applications using the pcre |
Install this package if you want do compile applications using the pcre |
113 |
library. |
library. |
114 |
|
|
115 |
%prep |
%package -n %{develcpp} |
116 |
|
Group: Development/C++ |
117 |
|
Summary: Headers and static lib for pcrecpp development |
118 |
|
Provides: pcrecpp-devel = %{version}-%{release} |
119 |
|
Requires: %{libnamecpp} = %{version}-%{release} |
120 |
|
Requires: %{develname} = %{version}-%{release} |
121 |
|
Conflicts: pcre-devel < 8.32-4 |
122 |
|
|
123 |
%setup -q |
%description -n %{develcpp} |
124 |
%patch1 -p1 -b .detect_into_kdelibs |
Install this package if you want do compile applications using the pcrecpp |
125 |
%patch2 -p0 |
library. |
126 |
|
|
127 |
|
%package -n %{develposix} |
128 |
|
Group: Development/C |
129 |
|
Summary: Headers and static lib for pcreposix development |
130 |
|
Provides: pcreposix-devel = %{version}-%{release} |
131 |
|
Requires: %{libnameposix} = %{version}-%{release} |
132 |
|
Requires: %{develname} = %{version}-%{release} |
133 |
|
Conflicts: pcre-devel < 8.32-4 |
134 |
|
|
135 |
|
%description -n %{develposix} |
136 |
|
Install this package if you want do compile applications using the pcre |
137 |
|
library. |
138 |
|
|
139 |
|
The header file for the POSIX-style functions is called pcreposix.h. The |
140 |
|
official POSIX name is regex.h, but I didn't want to risk possible problems |
141 |
|
with existing files of that name by distributing it that way. To use it with an |
142 |
|
existing program that uses the POSIX API, it will have to be renamed or pointed |
143 |
|
at by a link. |
144 |
|
|
145 |
|
%prep |
146 |
|
%setup -q |
147 |
|
%patch0 -p1 -b .detect-into-kdelibs |
148 |
|
%patch1 -p1 -b .linkage-fix |
149 |
|
|
150 |
%if %{build_pcreposix_compat} |
%if %{build_pcreposix_compat} |
151 |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
164 |
cd $i |
cd $i |
165 |
mkdir -p m4 |
mkdir -p m4 |
166 |
autoreconf -fi |
autoreconf -fi |
167 |
%configure2_5x --enable-utf8 --enable-unicode-properties |
%configure2_5x \ |
168 |
|
--disable-static \ |
169 |
|
--enable-utf \ |
170 |
|
--enable-unicode-properties \ |
171 |
|
--enable-pcre8 \ |
172 |
|
--enable-pcre16 \ |
173 |
|
--enable-pcre32 \ |
174 |
|
--enable-jit |
175 |
%make |
%make |
176 |
cd - |
cd - |
177 |
done |
done |
178 |
|
|
179 |
%check |
%check |
180 |
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* |
|
181 |
make check |
make check |
182 |
|
|
183 |
%install |
%install |
|
rm -rf $RPM_BUILD_ROOT |
|
184 |
%if %{build_pcreposix_compat} |
%if %{build_pcreposix_compat} |
185 |
%makeinstall_std -C pcre-with-pcreposix_compat |
%makeinstall_std -C pcre-with-pcreposix_compat |
186 |
%endif |
%endif |
187 |
%makeinstall_std |
%makeinstall_std |
188 |
|
|
189 |
%multiarch_binaries $RPM_BUILD_ROOT%{_bindir}/pcre-config |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%_lib |
|
|
mv $RPM_BUILD_ROOT/%_libdir/lib%{name}.so.%{major}.* $RPM_BUILD_ROOT/%_lib |
|
|
cd $RPM_BUILD_ROOT/%_libdir |
|
|
ln -s ../../%_lib/lib%{name}.so.%{major}.* . |
|
190 |
|
|
191 |
# Remove unwanted files |
# Remove unwanted files |
192 |
rm -f $RPM_BUILD_ROOT/%_docdir/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
rm -f %{buildroot}%{_docdir}/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
193 |
rm -f $RPM_BUILD_ROOT/%_docdir/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
rm -f %{buildroot}%{_docdir}/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
194 |
rm -f $RPM_BUILD_ROOT/%_docdir/pcre/{pcretest.txt,README} |
rm -f %{buildroot}%{_docdir}/pcre/{pcretest.txt,README} |
195 |
rm -rf $RPM_BUILD_ROOT/%_docdir/pcre/html |
rm -rf %{buildroot}%{_docdir}/pcre/html |
196 |
|
rm -f %{buildroot}%{_libdir}/*.la |
|
%clean |
|
|
rm -rf $RPM_BUILD_ROOT |
|
197 |
|
|
198 |
%files |
%files |
199 |
%defattr(-,root,root) |
%doc AUTHORS COPYING LICENCE NEWS README |
200 |
|
%{_mandir}/man1/pcregrep.1* |
201 |
|
%{_mandir}/man1/pcretest.1* |
202 |
|
%{_bindir}/pcregrep |
203 |
|
%{_bindir}/pcretest |
204 |
|
|
205 |
%_mandir/man1/pcregrep.1* |
%files -n %{libname} |
206 |
%_mandir/man1/pcretest.1* |
%{_libdir}/libpcre.so.%{pcre_major}* |
|
%_bindir/pcregrep |
|
|
%_bindir/pcretest |
|
207 |
|
|
208 |
|
%files -n %{libname16} |
209 |
|
%{_libdir}/libpcre16.so.%{pcrecpp_major}* |
210 |
|
|
211 |
# |
%files -n %{libname32} |
212 |
%files -n %{libname} |
%{_libdir}/libpcre32.so.%{pcrecpp_major}* |
|
%defattr(-,root,root) |
|
|
%doc AUTHORS COPYING LICENCE NEWS README |
|
213 |
|
|
214 |
/%_lib/lib*.so.%{major}* |
%files -n %{libnamecpp} |
215 |
%_libdir/lib*.so.%{major}* |
%{_libdir}/libpcrecpp.so.%{pcrecpp_major}* |
|
%_libdir/libpcreposix.so.%{pcreposix_major}* |
|
216 |
|
|
217 |
|
%if %{build_pcreposix_compat} |
218 |
|
%files -n %{libnameposix_compat} |
219 |
|
%{_libdir}/libpcreposix.so.%{pcreposix_compat_major}* |
220 |
|
%endif |
221 |
|
|
222 |
|
%files -n %{libnameposix} |
223 |
|
%{_libdir}/libpcreposix.so.%{pcreposix_major}* |
224 |
|
|
|
# |
|
225 |
%files -n %{develname} |
%files -n %{develname} |
|
%defattr(-,root,root) |
|
226 |
%doc doc/html |
%doc doc/html |
227 |
%doc ChangeLog |
%doc ChangeLog |
228 |
|
%{_libdir}/libpcre.so |
229 |
%_libdir/lib*.a |
%{_libdir}/libpcre16.so |
230 |
%_libdir/lib*.la |
%{_libdir}/libpcre32.so |
231 |
%_libdir/lib*.so |
%{_includedir}/pcre.h |
232 |
%_includedir/*.h |
%{_includedir}/pcre_*.h |
233 |
%_libdir/pkgconfig/libpcre.pc |
%{_libdir}/pkgconfig/libpcre.pc |
234 |
%_libdir/pkgconfig/libpcrecpp.pc |
%{_libdir}/pkgconfig/libpcre16.pc |
235 |
%_libdir/pkgconfig/libpcreposix.pc |
%{_libdir}/pkgconfig/libpcre32.pc |
236 |
|
%{_bindir}/pcre-config |
|
%_bindir/pcre-config |
|
237 |
%multiarch %{multiarch_bindir}/pcre-config |
%multiarch %{multiarch_bindir}/pcre-config |
238 |
|
%{_mandir}/man1/pcre-config.1* |
239 |
%_mandir/man1/pcre-config.1* |
%{_mandir}/man3/*.3* |
240 |
%_mandir/man3/*.3* |
%exclude %{_libdir}/libpcreposix.so |
241 |
|
%exclude %{_mandir}/man3/pcreposix.3* |
242 |
|
|
243 |
|
%files -n %{develcpp} |
244 |
|
%{_includedir}/pcrecpp*.h |
245 |
|
%{_libdir}/libpcrecpp.so |
246 |
|
%{_libdir}/pkgconfig/libpcrecpp.pc |
247 |
|
%{_mandir}/man3/pcrecpp.3* |
248 |
|
|
249 |
|
%files -n %{develposix} |
250 |
|
%{_includedir}/pcreposix.h |
251 |
|
%{_libdir}/libpcreposix.so |
252 |
|
%{_libdir}/pkgconfig/libpcreposix.pc |
253 |
|
%{_mandir}/man3/pcreposix.3* |