1 |
blino |
581 |
%define major 0 |
2 |
|
|
%define pcreposix_major 1 |
3 |
|
|
%define libname_orig lib%{name} |
4 |
|
|
%define libname %mklibname pcre %{major} |
5 |
|
|
%define develname %mklibname -d pcre |
6 |
|
|
|
7 |
|
|
%define build_pcreposix_compat 1 |
8 |
|
|
|
9 |
|
|
Summary: Perl-compatible regular expression library |
10 |
|
|
Name: pcre |
11 |
fwang |
187740 |
Version: 8.21 |
12 |
colin |
273158 |
Release: %mkrel 2 |
13 |
blino |
581 |
License: BSD-Style |
14 |
|
|
Group: File tools |
15 |
|
|
URL: http://www.pcre.org/ |
16 |
fwang |
187740 |
Source0: http://downloads.sourceforge.net/pcre/%{name}-%{version}.tar.bz2 |
17 |
|
|
Source1: http://downloads.sourceforge.net/pcre/%{name}-%{version}.tar.bz2.sig |
18 |
blino |
581 |
Requires: %{libname} = %{version}-%{release} |
19 |
|
|
BuildRequires: automake |
20 |
|
|
Patch1: pcre-0.6.5-fix-detect-into-kdelibs.patch |
21 |
|
|
Patch2: pcre-linkage_fix.diff |
22 |
|
|
Patch3: pcre-7.8-format_not_a_string_literal_and_no_format_arguments.diff |
23 |
|
|
# from debian: |
24 |
|
|
Patch4: pcre-pcreposix-glibc-conflict.patch |
25 |
|
|
|
26 |
|
|
%description |
27 |
|
|
PCRE has its own native API, but a set of "wrapper" functions that are based on |
28 |
|
|
the POSIX API are also supplied in the library libpcreposix. Note that this |
29 |
|
|
just provides a POSIX calling interface to PCRE: the regular expressions |
30 |
|
|
themselves still follow Perl syntax and semantics. |
31 |
|
|
This package contains a grep variant based on the PCRE library. |
32 |
|
|
|
33 |
|
|
%package -n %{libname} |
34 |
|
|
Group: System/Libraries |
35 |
|
|
Summary: Perl-compatible regular expression library |
36 |
colin |
273158 |
Requires(pre): filesystem >= 2.1.9-18 |
37 |
blino |
581 |
Provides: %{libname_orig} = %{version}-%{release} |
38 |
|
|
Conflicts: pcre <= 4.0 |
39 |
|
|
|
40 |
|
|
%description -n %{libname} |
41 |
|
|
PCRE has its own native API, but a set of "wrapper" functions that are based on |
42 |
|
|
the POSIX API are also supplied in the library libpcreposix. Note that this |
43 |
|
|
just provides a POSIX calling interface to PCRE: the regular expressions |
44 |
|
|
themselves still follow Perl syntax and semantics. The header file |
45 |
|
|
for the POSIX-style functions is called pcreposix.h. The official POSIX name is |
46 |
|
|
regex.h, but I didn't want to risk possible problems with existing files of |
47 |
|
|
that name by distributing it that way. To use it with an existing program that |
48 |
|
|
uses the POSIX API, it will have to be renamed or pointed at by a link. |
49 |
|
|
|
50 |
|
|
%package -n %{develname} |
51 |
|
|
Group: Development/C |
52 |
|
|
Summary: Headers and static lib for pcre development |
53 |
|
|
Requires: %{libname} = %{version}-%{release} |
54 |
|
|
Provides: %{libname_orig}-devel = %{version}-%{release} |
55 |
|
|
Provides: %{name}-devel = %{version}-%{release} |
56 |
|
|
Obsoletes: %mklibname pcre 0 -d |
57 |
|
|
Conflicts: pcre <= 4.0 |
58 |
|
|
|
59 |
|
|
%description -n %{develname} |
60 |
|
|
Install this package if you want do compile applications using the pcre |
61 |
|
|
library. |
62 |
|
|
|
63 |
|
|
%prep |
64 |
|
|
|
65 |
|
|
%setup -q |
66 |
|
|
%patch1 -p1 -b .detect_into_kdelibs |
67 |
|
|
%patch2 -p0 |
68 |
|
|
|
69 |
|
|
|
70 |
|
|
%if %{build_pcreposix_compat} |
71 |
|
|
# pcre-pcreposix-glibc-conflict patch below breaks compatibility, |
72 |
|
|
# create a libpcreposix.so.0 without the patch |
73 |
|
|
cp -a . ../pcre-with-pcreposix_compat && mv ../pcre-with-pcreposix_compat . |
74 |
|
|
%endif |
75 |
|
|
%patch4 -p1 -b .symbol-conflict |
76 |
|
|
|
77 |
|
|
%build |
78 |
|
|
%if %{build_pcreposix_compat} |
79 |
|
|
dirs="pcre-with-pcreposix_compat ." |
80 |
|
|
%else |
81 |
|
|
dirs="." |
82 |
|
|
%endif |
83 |
|
|
for i in $dirs; do |
84 |
|
|
cd $i |
85 |
|
|
mkdir -p m4 |
86 |
fwang |
134303 |
autoreconf -fi |
87 |
blino |
581 |
%configure2_5x --enable-utf8 --enable-unicode-properties |
88 |
|
|
%make |
89 |
|
|
cd - |
90 |
|
|
done |
91 |
|
|
|
92 |
|
|
%check |
93 |
|
|
export LC_ALL=C |
94 |
|
|
# Tests, patch out actual pcre_study_size in expected results |
95 |
|
|
#echo 'int main() { printf("%d", sizeof(pcre_study_data)); return 0; }' | \ |
96 |
|
|
#%{__cc} -xc - -include "pcre_internal.h" -I. -o study_size |
97 |
|
|
#STUDY_SIZE=`./study_size` |
98 |
|
|
#perl -pi -e "s,(Study size\s+=\s+)\d+,\${1}$STUDY_SIZE," testdata/testoutput* |
99 |
|
|
make check |
100 |
|
|
|
101 |
|
|
%install |
102 |
|
|
%if %{build_pcreposix_compat} |
103 |
|
|
%makeinstall_std -C pcre-with-pcreposix_compat |
104 |
|
|
%endif |
105 |
|
|
%makeinstall_std |
106 |
|
|
|
107 |
fwang |
170356 |
%multiarch_binaries %{buildroot}%{_bindir}/pcre-config |
108 |
blino |
581 |
|
109 |
|
|
# Remove unwanted files |
110 |
fwang |
170356 |
rm -f %{buildroot}/%_docdir/pcre/{AUTHORS,ChangeLog,COPYING,LICENCE,NEWS} |
111 |
|
|
rm -f %{buildroot}/%_docdir/pcre/{pcre-config.txt,pcre.txt,pcregrep.txt} |
112 |
|
|
rm -f %{buildroot}/%_docdir/pcre/{pcretest.txt,README} |
113 |
|
|
rm -rf %{buildroot}/%_docdir/pcre/html |
114 |
|
|
rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/*.a |
115 |
blino |
581 |
|
116 |
|
|
%files |
117 |
|
|
%_mandir/man1/pcregrep.1* |
118 |
|
|
%_mandir/man1/pcretest.1* |
119 |
|
|
%_bindir/pcregrep |
120 |
|
|
%_bindir/pcretest |
121 |
|
|
|
122 |
|
|
%files -n %{libname} |
123 |
|
|
%doc AUTHORS COPYING LICENCE NEWS README |
124 |
|
|
%_libdir/lib*.so.%{major}* |
125 |
|
|
%_libdir/libpcreposix.so.%{pcreposix_major}* |
126 |
|
|
|
127 |
|
|
%files -n %{develname} |
128 |
|
|
%doc doc/html |
129 |
|
|
%doc ChangeLog |
130 |
|
|
%_libdir/lib*.so |
131 |
|
|
%_includedir/*.h |
132 |
|
|
%_libdir/pkgconfig/libpcre.pc |
133 |
|
|
%_libdir/pkgconfig/libpcrecpp.pc |
134 |
|
|
%_libdir/pkgconfig/libpcreposix.pc |
135 |
|
|
%_bindir/pcre-config |
136 |
|
|
%multiarch %{multiarch_bindir}/pcre-config |
137 |
|
|
%_mandir/man1/pcre-config.1* |
138 |
|
|
%_mandir/man3/*.3* |