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