1 |
%define major 0 |
%define pcre_major 1 |
2 |
|
%define pcrecpp_major 0 |
3 |
%define pcreposix_major 1 |
%define pcreposix_major 1 |
4 |
|
%define pcreposix_compat_major 0 |
5 |
%define libname_orig lib%{name} |
%define libname_orig lib%{name} |
6 |
%define libname %mklibname pcre %{major} |
%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 |
%define develname %mklibname -d pcre |
11 |
|
|
12 |
%define build_pcreposix_compat 1 |
%define build_pcreposix_compat 1 |
13 |
|
|
14 |
Summary: Perl-compatible regular expression library |
Summary: Perl-compatible regular expression library |
15 |
Name: pcre |
Name: pcre |
16 |
Version: 8.21 |
Version: 8.32 |
17 |
Release: %mkrel 1 |
Release: %mkrel 1 |
18 |
License: BSD-Style |
License: BSD-Style |
19 |
Group: File tools |
Group: File tools |
24 |
BuildRequires: automake |
BuildRequires: automake |
25 |
Patch1: pcre-0.6.5-fix-detect-into-kdelibs.patch |
Patch1: pcre-0.6.5-fix-detect-into-kdelibs.patch |
26 |
Patch2: pcre-linkage_fix.diff |
Patch2: pcre-linkage_fix.diff |
|
Patch3: pcre-7.8-format_not_a_string_literal_and_no_format_arguments.diff |
|
27 |
# from debian: |
# from debian: |
28 |
Patch4: pcre-pcreposix-glibc-conflict.patch |
Patch4: pcre-pcreposix-glibc-conflict.patch |
29 |
|
|
37 |
%package -n %{libname} |
%package -n %{libname} |
38 |
Group: System/Libraries |
Group: System/Libraries |
39 |
Summary: Perl-compatible regular expression library |
Summary: Perl-compatible regular expression library |
40 |
|
Requires(pre): filesystem >= 2.1.9-18 |
41 |
Provides: %{libname_orig} = %{version}-%{release} |
Provides: %{libname_orig} = %{version}-%{release} |
|
Conflicts: pcre <= 4.0 |
|
42 |
|
|
43 |
%description -n %{libname} |
%description -n %{libname} |
44 |
PCRE has its own native API, but a set of "wrapper" functions that are based on |
This package contains the shared library libpcre. |
45 |
the POSIX API are also supplied in the library libpcreposix. Note that this |
|
46 |
just provides a POSIX calling interface to PCRE: the regular expressions |
|
47 |
themselves still follow Perl syntax and semantics. The header file |
%package -n %{libnamecpp} |
48 |
for the POSIX-style functions is called pcreposix.h. The official POSIX name is |
Group: System/Libraries |
49 |
regex.h, but I didn't want to risk possible problems with existing files of |
Summary: Perl-compatible regular expression library |
50 |
that name by distributing it that way. To use it with an existing program that |
Conflicts: %{_lib}pcre0 < 8.21-3 |
51 |
uses the POSIX API, it will have to be renamed or pointed at by a link. |
|
52 |
|
%description -n %{libnamecpp} |
53 |
|
This package contains the shared library libpcrecpp. |
54 |
|
|
55 |
|
|
56 |
|
%package -n %{libnameposix} |
57 |
|
Group: System/Libraries |
58 |
|
Summary: Perl-compatible regular expression library |
59 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
60 |
|
|
61 |
|
%description -n %{libnameposix} |
62 |
|
This package contains the shared library libpcreposix. |
63 |
|
|
64 |
|
|
65 |
|
%package -n %{libnameposix_compat} |
66 |
|
Group: System/Libraries |
67 |
|
Summary: Perl-compatible regular expression library |
68 |
|
Conflicts: %{_lib}pcre0 < 8.21-3 |
69 |
|
|
70 |
|
%description -n %{libnameposix_compat} |
71 |
|
This package contains the shared library libpcreposix compat. |
72 |
|
|
73 |
|
|
74 |
%package -n %{develname} |
%package -n %{develname} |
75 |
Group: Development/C |
Group: Development/C |
76 |
Summary: Headers and static lib for pcre development |
Summary: Headers and static lib for pcre development |
77 |
Requires: %{libname} = %{version}-%{release} |
Requires: %{libname} = %{version}-%{release} |
78 |
|
Requires: %{libnamecpp} = %{version}-%{release} |
79 |
|
Requires: %{libnameposix} = %{version}-%{release} |
80 |
|
Requires: %{libnameposix_compat} = %{version}-%{release} |
81 |
Provides: %{libname_orig}-devel = %{version}-%{release} |
Provides: %{libname_orig}-devel = %{version}-%{release} |
82 |
Provides: %{name}-devel = %{version}-%{release} |
Provides: %{name}-devel = %{version}-%{release} |
83 |
Obsoletes: %mklibname pcre 0 -d |
Obsoletes: %mklibname pcre 0 -d |
|
Conflicts: pcre <= 4.0 |
|
84 |
|
|
85 |
%description -n %{develname} |
%description -n %{develname} |
86 |
Install this package if you want do compile applications using the pcre |
Install this package if you want do compile applications using the pcre |
87 |
library. |
library. |
88 |
|
|
89 |
%prep |
The header file for the POSIX-style functions is called pcreposix.h. The |
90 |
|
official POSIX name is regex.h, but I didn't want to risk possible problems |
91 |
|
with existing files of that name by distributing it that way. To use it with an |
92 |
|
existing program that uses the POSIX API, it will have to be renamed or pointed |
93 |
|
at by a link. |
94 |
|
|
95 |
|
%prep |
96 |
%setup -q |
%setup -q |
97 |
%patch1 -p1 -b .detect_into_kdelibs |
%patch1 -p1 -b .detect_into_kdelibs |
98 |
%patch2 -p0 |
%patch2 -p0 |
99 |
|
|
|
|
|
100 |
%if %{build_pcreposix_compat} |
%if %{build_pcreposix_compat} |
101 |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
102 |
# create a libpcreposix.so.0 without the patch |
# create a libpcreposix.so.0 without the patch |
114 |
cd $i |
cd $i |
115 |
mkdir -p m4 |
mkdir -p m4 |
116 |
autoreconf -fi |
autoreconf -fi |
117 |
%configure2_5x --enable-utf8 --enable-unicode-properties |
%configure2_5x \ |
118 |
|
--disable-static \ |
119 |
|
--enable-utf \ |
120 |
|
--enable-unicode-properties \ |
121 |
|
--enable-jit |
122 |
%make |
%make |
123 |
cd - |
cd - |
124 |
done |
done |
140 |
|
|
141 |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
142 |
|
|
|
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}.* . |
|
|
|
|
143 |
# Remove unwanted files |
# Remove unwanted files |
144 |
rm -f %{buildroot}/%_docdir/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
rm -f %{buildroot}%{_docdir}/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
145 |
rm -f %{buildroot}/%_docdir/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
rm -f %{buildroot}%{_docdir}/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
146 |
rm -f %{buildroot}/%_docdir/pcre/{pcretest.txt,README} |
rm -f %{buildroot}%{_docdir}/pcre/{pcretest.txt,README} |
147 |
rm -rf %{buildroot}/%_docdir/pcre/html |
rm -rf %{buildroot}%{_docdir}/pcre/html |
148 |
rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/*.a |
rm -f %{buildroot}%{_libdir}/*.la |
149 |
|
|
150 |
%files |
%files |
151 |
%_mandir/man1/pcregrep.1* |
%doc AUTHORS COPYING LICENCE NEWS README |
152 |
%_mandir/man1/pcretest.1* |
%{_mandir}/man1/pcregrep.1* |
153 |
%_bindir/pcregrep |
%{_mandir}/man1/pcretest.1* |
154 |
%_bindir/pcretest |
%{_bindir}/pcregrep |
155 |
|
%{_bindir}/pcretest |
156 |
|
|
157 |
%files -n %{libname} |
%files -n %{libname} |
158 |
%doc AUTHORS COPYING LICENCE NEWS README |
%{_libdir}/libpcre.so.%{pcre_major}* |
159 |
/%_lib/lib*.so.%{major}* |
|
160 |
%_libdir/lib*.so.%{major}* |
%files -n %{libnamecpp} |
161 |
%_libdir/libpcreposix.so.%{pcreposix_major}* |
%{_libdir}/libpcrecpp.so.%{pcrecpp_major}* |
162 |
|
|
163 |
|
%if %{build_pcreposix_compat} |
164 |
|
%files -n %{libnameposix_compat} |
165 |
|
%{_libdir}/libpcreposix.so.%{pcreposix_compat_major}* |
166 |
|
%endif |
167 |
|
|
168 |
|
%files -n %{libnameposix} |
169 |
|
%{_libdir}/libpcreposix.so.%{pcreposix_major}* |
170 |
|
|
171 |
%files -n %{develname} |
%files -n %{develname} |
172 |
%doc doc/html |
%doc doc/html |
173 |
%doc ChangeLog |
%doc ChangeLog |
174 |
%_libdir/lib*.so |
%{_libdir}/lib*.so |
175 |
%_includedir/*.h |
%{_includedir}/*.h |
176 |
%_libdir/pkgconfig/libpcre.pc |
%{_libdir}/pkgconfig/libpcre.pc |
177 |
%_libdir/pkgconfig/libpcrecpp.pc |
%{_libdir}/pkgconfig/libpcrecpp.pc |
178 |
%_libdir/pkgconfig/libpcreposix.pc |
%{_libdir}/pkgconfig/libpcreposix.pc |
179 |
%_bindir/pcre-config |
%{_bindir}/pcre-config |
180 |
%multiarch %{multiarch_bindir}/pcre-config |
%multiarch %{multiarch_bindir}/pcre-config |
181 |
%_mandir/man1/pcre-config.1* |
%{_mandir}/man1/pcre-config.1* |
182 |
%_mandir/man3/*.3* |
%{_mandir}/man3/*.3* |