2016-10-06 15:05:52 +04:00
|
|
|
%define major 0
|
2025-02-10 18:40:59 +00:00
|
|
|
%define posixmajor 3
|
2016-10-06 15:05:52 +04:00
|
|
|
%define libname8 %mklibname pcre2-8_ %{major}
|
|
|
|
%define libname16 %mklibname pcre2-16_ %{major}
|
|
|
|
%define libname32 %mklibname pcre2-32_ %{major}
|
|
|
|
%define libnameposix %mklibname pcre2posix %{posixmajor}
|
|
|
|
%define devname %mklibname %{name} -d
|
2023-03-25 16:58:03 +03:00
|
|
|
%define sdevname %mklibname %{name} -d -s
|
2016-10-06 15:05:52 +04:00
|
|
|
|
|
|
|
Summary: Perl-compatible regular expression library
|
|
|
|
Name: pcre2
|
2025-02-10 14:39:17 +00:00
|
|
|
Version: 10.45
|
|
|
|
Release: 1
|
2016-10-06 15:05:52 +04:00
|
|
|
License: BSD
|
|
|
|
Group: System/Libraries
|
2025-02-10 14:39:17 +00:00
|
|
|
URL: https://pcre2project.github.io/pcre2
|
2021-12-24 20:33:33 +00:00
|
|
|
Source0: https://github.com/PhilipHazel/pcre2/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
|
2016-10-06 15:05:52 +04:00
|
|
|
# Do no set RPATH if libdir is not /usr/lib
|
2020-03-06 14:55:00 +00:00
|
|
|
Patch0: pcre2-10.10-Fix-multilib.patch
|
2022-12-04 00:53:14 +00:00
|
|
|
# CVE-2022-1586 CVE-2022-1587
|
|
|
|
Patch1: pcre2_jit_compile.c.diff
|
|
|
|
Patch2: pcre2_jit_test.c.diff
|
2023-10-16 13:50:23 +03:00
|
|
|
Patch3: CVE-2022-41409.patch
|
2016-10-06 15:05:52 +04:00
|
|
|
BuildRequires: readline-devel
|
2025-02-10 14:39:17 +00:00
|
|
|
BuildRequires: bzip2
|
2016-10-06 15:05:52 +04:00
|
|
|
|
|
|
|
%description
|
|
|
|
PCRE2 is a re-working of the original PCRE (Perl-compatible regular
|
|
|
|
expression) library to provide an entirely new API.
|
|
|
|
|
|
|
|
PCRE2 is written in C, and it has its own API. There are three sets of
|
|
|
|
functions, one for the 8-bit library, which processes strings of bytes, one
|
|
|
|
for the 16-bit library, which processes strings of 16-bit values, and one for
|
|
|
|
the 32-bit library, which processes strings of 32-bit values. There are no C++
|
|
|
|
wrappers.
|
|
|
|
|
|
|
|
The distribution does contain a set of C wrapper functions for the 8-bit
|
|
|
|
library that are based on the POSIX regular expression API (see the pcre2posix
|
|
|
|
man page). These can be found in a library called libpcre2posix. Note that
|
|
|
|
this just provides a POSIX calling interface to PCRE2; the regular expressions
|
|
|
|
themselves still follow Perl syntax and semantics. The POSIX API is
|
|
|
|
restricted, and does not give full access to all of PCRE2's facilities.
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%package -n %{libname8}
|
|
|
|
Summary: Perl-compatible regular expression library
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n %{libname8}
|
|
|
|
PCRE2 is a re-working of the original PCRE (Perl-compatible regular
|
|
|
|
expression) library to provide an entirely new API.
|
|
|
|
|
|
|
|
%files -n %{libname8}
|
|
|
|
%{_libdir}/libpcre2-8.so.%{major}*
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%package -n %{libname16}
|
|
|
|
Summary: Perl-compatible regular expression library
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n %{libname16}
|
|
|
|
PCRE2 is a re-working of the original PCRE (Perl-compatible regular
|
|
|
|
expression) library to provide an entirely new API.
|
|
|
|
|
|
|
|
%files -n %{libname16}
|
|
|
|
%{_libdir}/libpcre2-16.so.%{major}*
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%package -n %{libname32}
|
|
|
|
Summary: Perl-compatible regular expression library
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n %{libname32}
|
|
|
|
PCRE2 is a re-working of the original PCRE (Perl-compatible regular
|
|
|
|
expression) library to provide an entirely new API.
|
|
|
|
|
|
|
|
%files -n %{libname32}
|
|
|
|
%{_libdir}/libpcre2-32.so.%{major}*
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%package -n %{libnameposix}
|
|
|
|
Summary: Perl-compatible regular expression library
|
|
|
|
Group: System/Libraries
|
|
|
|
|
|
|
|
%description -n %{libnameposix}
|
|
|
|
This package contains the shared library libpcre2-posix.
|
|
|
|
|
|
|
|
%files -n %{libnameposix}
|
|
|
|
%{_libdir}/libpcre2-posix.so.%{posixmajor}*
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%package -n %{devname}
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Group: Development/C
|
|
|
|
Requires: %{libname8} = %{EVRD}
|
|
|
|
Requires: %{libname16} = %{EVRD}
|
|
|
|
Requires: %{libname32} = %{EVRD}
|
|
|
|
Requires: %{libnameposix} = %{EVRD}
|
|
|
|
Provides: %{name}-devel = %{EVRD}
|
|
|
|
|
|
|
|
%description -n %{devname}
|
|
|
|
Development files (headers, libraries for dynamic linking, documentation)
|
|
|
|
for %{name}. The header file for the POSIX-style functions is called
|
|
|
|
pcre2posix.h.
|
|
|
|
|
|
|
|
%files -n %{devname}
|
|
|
|
%{_libdir}/*.so
|
|
|
|
%{_libdir}/pkgconfig/*
|
|
|
|
%{_includedir}/*.h
|
|
|
|
%{_mandir}/man1/pcre2-config.*
|
|
|
|
%{_mandir}/man3/*
|
|
|
|
%{_bindir}/pcre2-config
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
2023-03-25 16:58:03 +03:00
|
|
|
%package -n %{sdevname}
|
|
|
|
Summary: %{name} development files (static library)
|
|
|
|
Group: Development/Other
|
|
|
|
Requires: %{devname} = %{EVRD}
|
|
|
|
Provides: %{name}-static-devel = %{EVRD}
|
2016-10-06 15:05:52 +04:00
|
|
|
|
2023-03-25 16:58:03 +03:00
|
|
|
%description -n %{sdevname}
|
|
|
|
%{name} development files (static library).
|
|
|
|
|
|
|
|
%files -n %{sdevname}
|
|
|
|
%{_libdir}/*.a
|
|
|
|
|
|
|
|
#------------------------------------------------------------------
|
2016-10-06 15:05:52 +04:00
|
|
|
%package tools
|
|
|
|
Summary: Auxiliary utilities for %{name}
|
|
|
|
Group: Development/Tools
|
|
|
|
|
|
|
|
%description tools
|
|
|
|
Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test.
|
|
|
|
|
|
|
|
%files tools
|
|
|
|
%{_bindir}/pcre2grep
|
|
|
|
%{_bindir}/pcre2test
|
|
|
|
%{_mandir}/man1/pcre2grep.*
|
|
|
|
%{_mandir}/man1/pcre2test.*
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
%prep
|
2025-02-10 14:39:17 +00:00
|
|
|
%setup -q
|
2016-10-06 15:05:52 +04:00
|
|
|
|
|
|
|
%build
|
|
|
|
# Because of multilib patch
|
|
|
|
libtoolize --copy --force
|
|
|
|
autoreconf -vif
|
|
|
|
|
2020-01-04 05:14:50 +03:00
|
|
|
%configure \
|
2022-05-08 12:25:10 +00:00
|
|
|
%ifnarch %{e2k} %{riscv}
|
2016-10-06 15:05:52 +04:00
|
|
|
--enable-jit \
|
|
|
|
--enable-pcre2grep-jit \
|
2020-10-06 10:31:16 +00:00
|
|
|
%endif
|
2016-10-06 15:05:52 +04:00
|
|
|
--disable-bsr-anycrlf \
|
|
|
|
--disable-coverage \
|
|
|
|
--disable-ebcdic \
|
|
|
|
--disable-never-backslash-C \
|
|
|
|
--enable-newline-is-lf \
|
|
|
|
--enable-pcre2-8 \
|
|
|
|
--enable-pcre2-16 \
|
|
|
|
--enable-pcre2-32 \
|
|
|
|
--disable-pcre2test-libedit \
|
|
|
|
--enable-pcre2test-libreadline \
|
|
|
|
--disable-pcre2grep-libbz2 \
|
|
|
|
--disable-pcre2grep-libz \
|
|
|
|
--disable-rebuild-chartables \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-stack-for-recursion \
|
2023-03-25 16:58:03 +03:00
|
|
|
--enable-static \
|
2016-10-06 15:05:52 +04:00
|
|
|
--enable-unicode \
|
|
|
|
--disable-valgrind
|
2020-01-13 16:40:36 +03:00
|
|
|
%make
|
2016-10-06 15:05:52 +04:00
|
|
|
|
|
|
|
%install
|
2020-01-13 16:40:36 +03:00
|
|
|
%makeinstall_std
|
2016-10-06 15:05:52 +04:00
|
|
|
# These are handled by %%doc in %%files
|
|
|
|
rm -rf %{buildroot}%{_docdir}/pcre2
|
|
|
|
|
|
|
|
%check
|
|
|
|
make check VERBOSE=yes
|
2022-12-04 00:53:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
# CVE-2016-3191 CVE-2017-8399 CVE-2017-8786
|