Sync from SUSE:SLFO:Main pcre revision 82d73ac474f0317b8a1ebf0fb761a7da

This commit is contained in:
Adrian Schröter 2024-05-03 17:45:14 +02:00
commit 0c546c4cb3
12 changed files with 1782 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

6
baselibs.conf Normal file
View File

@ -0,0 +1,6 @@
libpcre1
libpcre16-0
libpcreposix0
libpcrecpp0
provides "pcre-<targettype> = <version>"
obsoletes "pcre-<targettype> <= <version>"

37
pcre-8.21-multilib.patch Normal file
View File

@ -0,0 +1,37 @@
From 1d5ce3e2e6341b01609aefab20786a8638fee17a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 6 Dec 2011 18:44:11 +0100
Subject: [PATCH] Fix multilib
Do not set RPATH nor add explicit -L path to compiler.
---
pcre-config.in | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/pcre-config.in b/pcre-config.in
index ccbf210..aeee182 100644
--- a/pcre-config.in
+++ b/pcre-config.in
@@ -16,19 +16,7 @@ if test $# -eq 0; then
fi
libR=
-case `uname -s` in
- *SunOS*)
- libR=" -R@libdir@"
- ;;
- *BSD*)
- libR=" -Wl,-R@libdir@"
- ;;
-esac
-
libS=
-if test @libdir@ != /usr/lib ; then
- libS=-L@libdir@
-fi
while test $# -gt 0; do
case "$1" in
--
1.7.7.4

112
pcre-8.32-visibility.patch Normal file
View File

@ -0,0 +1,112 @@
From 1484e50a2818b2f207688765cef6cd2f5cc71520 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= <crrodriguez@opensuse.org>
Date: Mon, 22 Oct 2012 22:38:34 +0200
Subject: [PATCH] build: Use GCC visibility to hide private symbols
http://bugs.exim.org/show_bug.cgi?id=1173
--
--- /dev/null
+++ pcre-8.32/m4/visibility.m4
@@ -0,0 +1,89 @@
+# visibility.m4 serial 4 (gettext-0.18.2)
+dnl Copyright (C) 2005, 2008, 2010-2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+dnl Modified to fit with PCRE build environment by Cristian Rodríguez.
+
+AC_DEFUN([PCRE_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ CXXFLAG_INLINES_HIDDEN=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ dnl First, check whether -Werror can be added to the command line, or
+ dnl whether it leads to an error because of some other option that the
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
+ AC_MSG_CHECKING([whether the -Werror option is usable])
+ AC_CACHE_VAL([gl_cv_cc_vis_werror], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$gl_cv_cc_vis_werror])
+ dnl Now check whether visibility declarations are supported.
+ AC_MSG_CHECKING([for simple visibility declarations])
+ AC_CACHE_VAL([gl_cv_cc_visibility], [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $pcre_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [pcre_cv_cc_visibility=yes],
+ [pcre_cv_cc_visibility=no])
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$pcre_cv_cc_visibility])
+ if test $pcre_cv_cc_visibility = yes; then
+ VISIBILITY_CFLAGS="-fvisibility=hidden"
+ VISIBILITY_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden"
+ HAVE_VISIBILITY=1
+ AC_DEFINE(PCRE_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible])
+ AC_DEFINE(PCRE_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
+ AC_DEFINE(PCRE_EXP_DATA_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
+ AC_DEFINE(PCREPOSIX_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible])
+ AC_DEFINE(PCREPOSIX_EXP_DEFN, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible])
+ AC_DEFINE(PCRECPP_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible])
+ AC_DEFINE(PCRECPP_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
+ fi
+ fi
+ AC_SUBST([VISIBILITY_CFLAGS])
+ AC_SUBST([VISIBILITY_CXXFLAGS])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
--- pcre-8.32.orig/configure.ac
+++ pcre-8.32/configure.ac
@@ -46,7 +46,9 @@ AC_CONFIG_MACRO_DIR([m4])
remember_set_CFLAGS="$CFLAGS"
remember_set_CXXFLAGS="$CXXFLAGS"
-AC_PROG_CC
+AC_PROG_CC_STDC
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
AC_PROG_CXX
AM_PROG_CC_C_O

View File

@ -0,0 +1,18 @@
Index: pcre-8.39/pcre_exec.c
===================================================================
--- pcre-8.39.orig/pcre_exec.c
+++ pcre-8.39/pcre_exec.c
@@ -509,6 +509,12 @@ Returns: MATCH_MATCH if matched
(e.g. stopped by repeated call or recursion limit)
*/
+#ifdef __GNUC__
+static int
+match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
+ PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
+ unsigned int rdepth) __attribute__((noinline,noclone));
+#endif
static int
match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,

36
pcre-8.42-pcreposix.patch Normal file
View File

@ -0,0 +1,36 @@
From: Mark Baker <mark@mnb.org.uk>
Date: Wed, 13 Jul 2016 21:20:13 +0100
Subject: pcreposix
---
pcreposix.h | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/pcreposix.h b/pcreposix.h
index c77c0b0..4527f78 100644
--- a/pcreposix.h
+++ b/pcreposix.h
@@ -133,14 +133,19 @@ file. */
/* The functions */
-PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
-PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
+PCREPOSIX_EXP_DECL int pcreposix_regcomp(regex_t *, const char *, int);
+PCREPOSIX_EXP_DECL int pcreposix_regexec(const regex_t *, const char *, size_t,
regmatch_t *, int);
-PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
-PCREPOSIX_EXP_DECL void regfree(regex_t *);
+PCREPOSIX_EXP_DECL size_t pcreposix_regerror(int, const regex_t *, char *, size_t);
+PCREPOSIX_EXP_DECL void pcreposix_regfree(regex_t *);
#ifdef __cplusplus
} /* extern "C" */
#endif
+#define regcomp pcreposix_regcomp
+#define regexec pcreposix_regexec
+#define regerror pcreposix_regerror
+#define regfree pcreposix_regfree
+
#endif /* End of pcreposix.h */

View File

@ -0,0 +1,42 @@
diff --git a/ChangeLog b/ChangeLog
index 86acd7b..9afbb0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -145,6 +145,12 @@ crash. This issue was fixed for other kinds of repeat in release 8.37 by change
13. Fix misleading error message in configure.ac.
+23. Fixed a unicode properrty matching issue in JIT. The character was not
+fully read in caseless matching.
+
+23. Fixed a unicode properrty matching issue in JIT. The character was not
+fully read in caseless matching.
+
Version 8.41 05-July-2017
-------------------------
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
index 4dcf8fc..5ab5206 100644
--- a/pcre_jit_compile.c
+++ b/pcre_jit_compile.c
@@ -5679,7 +5679,7 @@ while (*cc != XCL_END)
{
SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP);
cc++;
- if (*cc == PT_CLIST)
+ if (*cc == PT_CLIST && cc[-1] == XCL_PROP)
{
other_cases = PRIV(ucd_caseless_sets) + cc[1];
while (*other_cases != NOTACHAR)
diff --git a/pcre_jit_test.c b/pcre_jit_test.c
index 034cb52..cd687c3 100644
--- a/pcre_jit_test.c
+++ b/pcre_jit_test.c
@@ -387,6 +387,7 @@ static struct regression_test_case regression_test_cases[] = {
{ MUAP, 0 | F_PROPERTY, "[\xc3\xa2-\xc3\xa6\xc3\x81-\xc3\x84\xe2\x80\xa8-\xe2\x80\xa9\xe6\x92\xad\\p{Zs}]{2,}", "\xe2\x80\xa7\xe2\x80\xa9\xe6\x92\xad \xe6\x92\xae" },
{ MUAP, 0 | F_PROPERTY, "[\\P{L&}]{2}[^\xc2\x85-\xc2\x89\\p{Ll}\\p{Lu}]{2}", "\xc3\xa9\xe6\x92\xad.a\xe6\x92\xad|\xc2\x8a#" },
{ PCRE_UCP, 0, "[a-b\\s]{2,5}[^a]", "AB baaa" },
+ { CMUAP, 0, "[^S]\\B", "\xe2\x80\x8a" },
/* Possible empty brackets. */
{ MUA, 0, "(?:|ab||bc|a)+d", "abcxabcabd" },

BIN
pcre-8.45.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
pcre-8.45.tar.bz2.sig Normal file

Binary file not shown.

1176
pcre.changes Normal file

File diff suppressed because it is too large Load Diff

51
pcre.keyring Normal file
View File

@ -0,0 +1,51 @@
pub 2048R/FB0F43D8 2002-10-21
uid Philip Hazel <ph10@hermes.cam.ac.uk>
uid Philip Hazel <ph10@cam.ac.uk>
uid Philip Hazel <ph10@cus.cam.ac.uk>
sub 2048R/ECFA4A69 2002-10-21
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.19 (GNU/Linux)
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
uIS9nkk2GrGx5+N6cYMy8JqG
=qlVT
-----END PGP PUBLIC KEY BLOCK-----

278
pcre.spec Normal file
View File

@ -0,0 +1,278 @@
#
# spec file for package pcre
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: pcre
Version: 8.45
Release: 0
Summary: A library for Perl-compatible regular expressions
License: BSD-3-Clause
Group: Development/Libraries/C and C++
URL: http://www.pcre.org/
#SVN-Clone: svn://vcs.exim.org/pcre/code/trunk
Source: https://ftp.pcre.org/pub/pcre/pcre-%{version}.tar.bz2
Source2: https://ftp.pcre.org/pub/pcre/pcre-%{version}.tar.bz2.sig
Source3: %{name}.keyring
Source4: baselibs.conf
#PATCH-FIX-UPSTREAM crrodriguez@opensuse.org http://bugs.exim.org/show_bug.cgi?id=1173
Patch0: pcre-8.32-visibility.patch
#PATCH-FIX-OPENSUSE tchvatal@suse.cz upstream thinks it is good idea to use rpath, taken from RH
Patch1: pcre-8.21-multilib.patch
#PATCH-FIX-OPENSUSE kstreitova@suse.com fix pcre stack frame size detection https://bugs.exim.org/show_bug.cgi?id=2173
Patch2: pcre-8.41-stack_frame_size_detection.patch
#Patch 3: see: https://sources.debian.net/patches/pcre3/2:8.39-2/pcreposix.patch/ and cyrus imapd issue #1731
Patch3: pcre-8.42-pcreposix.patch
Patch4: pcre-8.45-bsc1199232-unicode-property-matching.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: pkgconfig
%description
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
%package devel
Summary: A library for Perl-compatible regular expressions
Group: Development/Libraries/C and C++
Requires: libpcre1 = %{version}
Requires: libpcre16-0 = %{version}
Requires: libpcrecpp0 = %{version}
Requires: libpcreposix0 = %{version}
Requires: libstdc++-devel
%description devel
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
%package devel-static
Summary: A library for Perl-compatible regular expressions
Group: Development/Libraries/C and C++
Requires: pcre-devel = %{version}
%description devel-static
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
This package contains static versions of the PCRE libraries.
%package -n libpcre1
Summary: A library for Perl-compatible regular expressions
Group: System/Libraries
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
%description -n libpcre1
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
This PCRE library variant supports 8-bit and UTF-8 strings.
(See also libpcre16.)
%package -n libpcre16-0
Summary: A library for Perl-compatible regular expressions
Group: System/Libraries
%description -n libpcre16-0
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
libpcre16 supports 16-bit and UTF-16 strings.
%package -n libpcreposix0
Summary: A library for Perl-compatible regular expressions
Group: System/Libraries
%description -n libpcreposix0
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
pcreposix provides a POSIX-compatible API to the PCRE engine.
%package -n libpcrecpp0
Summary: A library for Perl-compatible regular expressions
Group: System/Libraries
%description -n libpcrecpp0
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
pcrecpp provides a C++ API to the PCRE engine.
%package doc
Summary: A library for Perl-compatible regular expressions
Group: Documentation/HTML
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
%description doc
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
%package testsuite
Summary: Tests for libpcre
Group: Development/Libraries/C and C++
%description testsuite
This package contains the testsuite part of the PCRE library.
%package tools
Summary: A library for Perl-compatible regular expressions
Group: Productivity/Text/Utilities
Recommends: %{name}-doc
%description tools
The PCRE library is a set of functions that implement regular
expression pattern matching using the same syntax and semantics
as Perl 5.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
# Available JIT archs see sljit/sljitConfig.h
%global jit_archs %{ix86} x86_64 %{arm} aarch64 ppc ppc64 ppc64le mips sparc
autoreconf -fiv
%configure \
%ifarch %{jit_archs}
--enable-jit \
%endif
--enable-static \
--with-link-size=2 \
--with-match-limit=10000000 \
--enable-newline-is-lf \
--enable-pcre16 \
--enable-utf8 \
--enable-unicode-properties
%if 0%{?do_profiling}
# RunTest test 2 needs lots of stack, if it ever segfaults
# try increasing this
ulimit -s $((16*1024))
%make_build CFLAGS="%{optflags} %{cflags_profile_generate}"
%make_build CFLAGS="%{optflags} %{cflags_profile_generate}" check
%make_build clean
%make_build CFLAGS="%{optflags} %{cflags_profile_feedback}"
%else
%make_build CFLAGS="%{optflags}"
%endif
%install
%make_install
mkdir -p %{buildroot}/%{_defaultdocdir}
mv %{buildroot}%{_datadir}/doc/pcre %{buildroot}/%{_defaultdocdir}/pcre-doc
#empty dependecy_libs
find %{buildroot} -type f -name "*.la" -delete -print
#testsuite files
%define testsuitedir %{buildroot}/%{_libexecdir}/%{name}/testsuite
mkdir -p %{testsuitedir}
cp Makefile %{testsuitedir}
cp -r testdata %{testsuitedir}
cp .libs/pcrecpp_unittest %{testsuitedir}
%ifarch %{jit_archs}
cp .libs/pcre_jit_test %{testsuitedir}
%endif
cp .libs/pcre_scanner_unittest %{testsuitedir}
cp .libs/pcre_stringpiece_unittest %{testsuitedir}
cp .libs/pcregrep %{testsuitedir}
cp .libs/pcretest %{testsuitedir}
cp RunTest %{testsuitedir}
cp RunGrepTest %{testsuitedir}
%check
# RunTest test 2 needs lots of stack, if it ever segfaults
# try increasing this
ulimit -s $((16*1024))
%make_build check
%post -n libpcre1 -p /sbin/ldconfig
%postun -n libpcre1 -p /sbin/ldconfig
%post -n libpcre16-0 -p /sbin/ldconfig
%postun -n libpcre16-0 -p /sbin/ldconfig
%post -n libpcrecpp0 -p /sbin/ldconfig
%postun -n libpcrecpp0 -p /sbin/ldconfig
%post -n libpcreposix0 -p /sbin/ldconfig
%postun -n libpcreposix0 -p /sbin/ldconfig
%preun testsuite
if [ "$1" = 0 ]; then
rm -f %{_libexecdir}/%{name}/testsuite/testNinputgrep
rm -f %{_libexecdir}/%{name}/testsuite/teststderrgrep
rm -f %{_libexecdir}/%{name}/testsuite/testtemp1grep
rm -f %{_libexecdir}/%{name}/testsuite/testtemp2grep
rm -f %{_libexecdir}/%{name}/testsuite/testtrygrep
fi
%files -n libpcre1
%license COPYING LICENCE
%doc AUTHORS ChangeLog NEWS README
%{_libdir}/libpcre.so.*
%files -n libpcre16-0
%{_libdir}/libpcre16.so.*
%files -n libpcrecpp0
%{_libdir}/libpcrecpp.so.*
%files -n libpcreposix0
%{_libdir}/libpcreposix.so.*
%files tools
%{_bindir}/pcregrep
%{_bindir}/pcretest
%{_mandir}/man1/pcregrep.1%{?ext_man}
%{_mandir}/man1/pcretest.1%{?ext_man}
%files doc
%license COPYING LICENCE
%doc AUTHORS ChangeLog NEWS README
%doc doc/html doc/*.txt
%doc %{_defaultdocdir}/pcre-doc
%files devel
%{_bindir}/pcre-config
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/libpcre.pc
%{_libdir}/pkgconfig/libpcre16.pc
%{_libdir}/pkgconfig/libpcrecpp.pc
%{_libdir}/pkgconfig/libpcreposix.pc
%{_mandir}/man1/pcre-config.1%{?ext_man}
%{_mandir}/man3/pcre*.3*%{ext_man}
%files devel-static
%{_libdir}/*.a
%files testsuite
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/testsuite
%changelog