summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-libs/libpcre
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-libs/libpcre')
-rw-r--r--dev-libs/libpcre/Manifest4
-rw-r--r--dev-libs/libpcre/files/libpcre-7.9-pkg-config.patch48
-rw-r--r--dev-libs/libpcre/files/libpcre-8.37-CVE-2015-3210.patch91
-rw-r--r--dev-libs/libpcre/files/libpcre-8.37-CVE-2015-5073.patch72
-rw-r--r--dev-libs/libpcre/libpcre-7.9-r1.ebuild62
-rw-r--r--dev-libs/libpcre/libpcre-8.35.ebuild96
-rw-r--r--dev-libs/libpcre/libpcre-8.36.ebuild96
-rw-r--r--dev-libs/libpcre/libpcre-8.37-r1.ebuild92
-rw-r--r--dev-libs/libpcre/libpcre-8.37-r2.ebuild94
-rw-r--r--dev-libs/libpcre/libpcre-8.37.ebuild96
-rw-r--r--dev-libs/libpcre/metadata.xml33
11 files changed, 784 insertions, 0 deletions
diff --git a/dev-libs/libpcre/Manifest b/dev-libs/libpcre/Manifest
new file mode 100644
index 000000000000..a4bcd7b39cfb
--- /dev/null
+++ b/dev-libs/libpcre/Manifest
@@ -0,0 +1,4 @@
+DIST pcre-7.9.tar.bz2 861580 SHA256 40a13a9759f1de5b16bc2f0d47b6aa5f0ec010325646922f54b013c040dcd740 SHA512 b4c47a9b196750d4bead9e3904702fc793d282a22af1b34e24081077b4c167ec787cf7dec9a565fa9df4dafb5927b7accdd49568f5c2f8733842cbbec5d4d25c WHIRLPOOL 412cf0a128861cbb991a0424e9f4ba551093b7853465776e17465f9c2b4222002a8b26d7a234b91a49e055a04ae840ad5d6c1613615c98db3d44413a723a6152
+DIST pcre-8.35.tar.bz2 1522220 SHA256 a961c1c78befef263cc130756eeca7b674b4e73a81533293df44e4265236865b SHA512 e94c652b40de60b391e28afbddc67b5a034650f6f62027e52f2d7aef53caf5f0da9f2d4f6872d1558f965dd9d4d696e5e23d2a50f20a4fbc9f0a707fb6f55fae WHIRLPOOL 677dd9673299438c4d76c68947124069b9c2b88ac837e59d00fc4e92113498357041f173ec4ae1cd61e760debad0a2392710f986794796678e596b9a22ba62a2
+DIST pcre-8.36.tar.bz2 1533818 SHA256 ef833457de0c40e82f573e34528f43a751ff20257ad0e86d272ed5637eb845bb SHA512 acd2bc6911be7b518ad4aca3c3ccbe98bdbeabf0e77d6b04009838c7825b563a001377f8c3a6a8a0583ec32ee9fefe05e3c1a69f272fe5084469a6b6c2148fbf WHIRLPOOL 4c144e3c468a76d8bac3d8a0d4642f7b2e2bd03f84ca915d51a81af7128d7d9c6ed7272bf25e2b9c5eb435037b77ffc41b871bd7257efde0a14a20f5fb4b8432
+DIST pcre-8.37.tar.bz2 1557603 SHA256 51679ea8006ce31379fb0860e46dd86665d864b5020fc9cd19e71260eef4789d SHA512 19344c9add2ebbd26c528505d07d3b028d79bc3e6103d51453a449cebd76bc76f5bc7ddd9ef0de41f98c50be74a2d9a65db539ed60f1add1086d99bde8a81466 WHIRLPOOL 43f723a9107fd6d78a88d4682502d79d5b9b0df90a579667a80b9862611a1c7bee25a1d5a1f9facec7c077f89605d7d96e3843d4aa5b94113b49b06a974331e5
diff --git a/dev-libs/libpcre/files/libpcre-7.9-pkg-config.patch b/dev-libs/libpcre/files/libpcre-7.9-pkg-config.patch
new file mode 100644
index 000000000000..3015d78b86f8
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-7.9-pkg-config.patch
@@ -0,0 +1,48 @@
+diff -NrU5 pcre-7.9.orig/configure.ac pcre-7.9/configure.ac
+--- pcre-7.9.orig/configure.ac 2009-04-11 16:09:54.000000000 +0200
++++ pcre-7.9/configure.ac 2009-04-18 22:40:50.000000000 +0200
+@@ -598,10 +598,11 @@
+
+ # Produce these files, in addition to config.h.
+ AC_CONFIG_FILES(
+ Makefile
+ libpcre.pc
++ libpcreposix.pc
+ libpcrecpp.pc
+ pcre-config
+ pcre.h
+ pcre_stringpiece.h
+ pcrecpparg.h
+diff -NrU5 pcre-7.9.orig/libpcreposix.pc.in pcre-7.9/libpcreposix.pc.in
+--- pcre-7.9.orig/libpcreposix.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ pcre-7.9/libpcreposix.pc.in 2009-04-18 22:38:02.000000000 +0200
+@@ -0,0 +1,13 @@
++# Package Information for pkg-config
++
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: libpcreposix
++Description: PCREPosix - Posix compatible regular expressions C library
++Version: @PACKAGE_VERSION@
++Libs: -L${libdir} -lpcreposix
++Cflags: -I${includedir}
++Requires.private: libpcre
+diff -NrU5 pcre-7.9.orig/Makefile.am pcre-7.9/Makefile.am
+--- pcre-7.9.orig/Makefile.am 2009-02-27 17:02:49.000000000 +0100
++++ pcre-7.9/Makefile.am 2009-04-18 22:40:00.000000000 +0200
+@@ -325,11 +325,11 @@
+ $(CC) -shared -o pcre.dll -Wl,"--strip-all" -Wl,"--export-all-symbols" $(DLL_OBJS)
+
+
+ # We have .pc files for pkg-config users.
+ pkgconfigdir = $(libdir)/pkgconfig
+-pkgconfig_DATA = libpcre.pc
++pkgconfig_DATA = libpcre.pc libpcreposix.pc
+ if WITH_PCRE_CPP
+ pkgconfig_DATA += libpcrecpp.pc
+ endif
+
+ dist_man_MANS = \
diff --git a/dev-libs/libpcre/files/libpcre-8.37-CVE-2015-3210.patch b/dev-libs/libpcre/files/libpcre-8.37-CVE-2015-3210.patch
new file mode 100644
index 000000000000..8199b0838d8f
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.37-CVE-2015-3210.patch
@@ -0,0 +1,91 @@
+https://bugs.exim.org/show_bug.cgi?id=1636
+https://bugs.gentoo.org/551240
+https://bugzilla.redhat.com/1236659
+
+From 68ff1beb43bb3d4d8838f3285c97023d1e50513a Mon Sep 17 00:00:00 2001
+From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
+Date: Fri, 15 May 2015 17:17:03 +0000
+Subject: [PATCH] Fix buffer overflow for named recursive back reference when
+ the name is duplicated.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream commit ported to pcre-8.37:
+
+commit 4b79af6b4cbeb5326ae5e4d83f3e935e00286c19
+Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
+Date: Fri May 15 17:17:03 2015 +0000
+
+ Fix buffer overflow for named recursive back reference when the name is
+ duplicated.
+
+ git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1558 2f5784b3-3f2a-0410-8824-cb99058d5e15
+
+This fixes CVE-2015-3210.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ pcre_compile.c | 16 ++++++++++++++--
+ testdata/testinput2 | 2 ++
+ testdata/testoutput2 | 2 ++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/pcre_compile.c b/pcre_compile.c
+index 0efad26..6f06912 100644
+--- a/pcre_compile.c
++++ b/pcre_compile.c
+@@ -7173,14 +7173,26 @@ for (;; ptr++)
+ number. If the name is not found, set the value to 0 for a forward
+ reference. */
+
++ recno = 0;
+ ng = cd->named_groups;
+ for (i = 0; i < cd->names_found; i++, ng++)
+ {
+ if (namelen == ng->length &&
+ STRNCMP_UC_UC(name, ng->name, namelen) == 0)
+- break;
++ {
++ open_capitem *oc;
++ recno = ng->number;
++ if (is_recurse) break;
++ for (oc = cd->open_caps; oc != NULL; oc = oc->next)
++ {
++ if (oc->number == recno)
++ {
++ oc->flag = TRUE;
++ break;
++ }
++ }
++ }
+ }
+- recno = (i < cd->names_found)? ng->number : 0;
+
+ /* Count named back references. */
+
+diff --git a/testdata/testinput2 b/testdata/testinput2
+index 58fe53b..83bb471 100644
+--- a/testdata/testinput2
++++ b/testdata/testinput2
+@@ -4152,4 +4152,6 @@ backtracking verbs. --/
+
+ /((?2){73}(?2))((?1))/
+
++"(?J)(?'d'(?'d'\g{d}))"
++
+ /-- End of testinput2 --/
+diff --git a/testdata/testoutput2 b/testdata/testoutput2
+index b718df0..7dff52a 100644
+--- a/testdata/testoutput2
++++ b/testdata/testoutput2
+@@ -14423,4 +14423,6 @@ Failed: lookbehind assertion is not fixed length at offset 17
+
+ /((?2){73}(?2))((?1))/
+
++"(?J)(?'d'(?'d'\g{d}))"
++
+ /-- End of testinput2 --/
+--
+2.4.3
+
diff --git a/dev-libs/libpcre/files/libpcre-8.37-CVE-2015-5073.patch b/dev-libs/libpcre/files/libpcre-8.37-CVE-2015-5073.patch
new file mode 100644
index 000000000000..a97ea392fab4
--- /dev/null
+++ b/dev-libs/libpcre/files/libpcre-8.37-CVE-2015-5073.patch
@@ -0,0 +1,72 @@
+https://bugs.exim.org/show_bug.cgi?id=1651
+https://bugs.gentoo.org/553300
+https://bugzilla.redhat.com/1237224
+
+From 354e1f8e921dcb9cf2f3a5eac93cd826d01a7d8a Mon Sep 17 00:00:00 2001
+From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
+Date: Tue, 23 Jun 2015 16:34:53 +0000
+Subject: [PATCH] Fix buffer overflow for forward reference within backward
+ assertion with excess closing parenthesis. Bugzilla 1651.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is upstream commit ported to 8.37:
+
+commit 764692f9aea9eab50fdba6cb537441d8b34c6c37
+Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
+Date: Tue Jun 23 16:34:53 2015 +0000
+
+ Fix buffer overflow for forward reference within backward assertion with excess
+ closing parenthesis. Bugzilla 1651.
+
+ git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1571 2f5784b3-3f2a-0410-8824-cb99058d5e15
+
+It fixes CVE-2015-5073.
+
+Signed-off-by: Petr Písař <ppisar@redhat.com>
+---
+ pcre_compile.c | 2 +-
+ testdata/testinput2 | 2 ++
+ testdata/testoutput2 | 3 +++
+ 3 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/pcre_compile.c b/pcre_compile.c
+index 6f06912..b66b1f6 100644
+--- a/pcre_compile.c
++++ b/pcre_compile.c
+@@ -9392,7 +9392,7 @@ OP_RECURSE that are not fixed length get a diagnosic with a useful offset. The
+ exceptional ones forgo this. We scan the pattern to check that they are fixed
+ length, and set their lengths. */
+
+-if (cd->check_lookbehind)
++if (errorcode == 0 && cd->check_lookbehind)
+ {
+ pcre_uchar *cc = (pcre_uchar *)codestart;
+
+diff --git a/testdata/testinput2 b/testdata/testinput2
+index 83bb471..5cc9ce6 100644
+--- a/testdata/testinput2
++++ b/testdata/testinput2
+@@ -4154,4 +4154,6 @@ backtracking verbs. --/
+
+ "(?J)(?'d'(?'d'\g{d}))"
+
++/(?=di(?<=(?1))|(?=(.))))/
++
+ /-- End of testinput2 --/
+diff --git a/testdata/testoutput2 b/testdata/testoutput2
+index 7dff52a..4decb8d 100644
+--- a/testdata/testoutput2
++++ b/testdata/testoutput2
+@@ -14425,4 +14425,7 @@ Failed: lookbehind assertion is not fixed length at offset 17
+
+ "(?J)(?'d'(?'d'\g{d}))"
+
++/(?=di(?<=(?1))|(?=(.))))/
++Failed: unmatched parentheses at offset 23
++
+ /-- End of testinput2 --/
+--
+2.4.3
+
diff --git a/dev-libs/libpcre/libpcre-7.9-r1.ebuild b/dev-libs/libpcre/libpcre-7.9-r1.ebuild
new file mode 100644
index 000000000000..0217102fbd1d
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-7.9-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+
+inherit libtool eutils toolchain-funcs autotools multilib
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+if [[ ${PV} == ${PV/_rc} ]]
+then
+ MY_P="pcre-${PV}"
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ MY_P="pcre-${PV/_rc/-RC}"
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+IUSE="bzip2 +cxx doc unicode zlib static-libs"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ sed -i -e "s:libdir=@libdir@:libdir=/$(get_libdir):" libpcre.pc.in || die "Fixing libpcre pkgconfig files failed"
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die "Fixing libpcrecpp pkgconfig files failed"
+ echo "Requires: libpcre = @PACKAGE_VERSION@" >> libpcrecpp.pc.in
+ epatch "${FILESDIR}"/libpcre-7.9-pkg-config.patch
+ eautoreconf
+ elibtoolize
+}
+
+src_configure() {
+ econf --with-match-limit-recursion=8192 \
+ $(use_enable unicode utf8) $(use_enable unicode unicode-properties) \
+ $(use_enable cxx cpp) \
+ $(use_enable zlib pcregrep-libz) \
+ $(use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable static-libs static) \
+ --enable-shared \
+ --htmldir=/usr/share/doc/${PF}/html \
+ --docdir=/usr/share/doc/${PF} \
+ || die "econf failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ gen_usr_ldscript -a pcre
+
+ dodoc doc/*.txt AUTHORS
+ use doc && dohtml doc/html/*
+ find "${D}" -type f -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed"
+}
diff --git a/dev-libs/libpcre/libpcre-8.35.ebuild b/dev-libs/libpcre/libpcre-8.35.ebuild
new file mode 100644
index 000000000000..6c7bc8a55aa5
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.35.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+src_prepare() {
+ local pc
+ for pc in *.pc.in ; do
+ echo "Libs.private: @PTHREAD_CFLAGS@" >> ${pc} #454478
+ done
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT) \
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable cxx cpp) \
+ $(use_enable jit) $(use_enable jit pcregrep-jit) \
+ $(use_enable pcre16) \
+ $(use_enable pcre32) \
+ $(multilib_native_use_enable libedit pcretest-libedit) \
+ $(multilib_native_use_enable readline pcretest-libreadline) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties) \
+ $(multilib_native_use_enable zlib pcregrep-libz) \
+ --enable-pcre8 \
+ --enable-shared \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ multilib_is_native_abi && gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/libpcre-8.36.ebuild b/dev-libs/libpcre/libpcre-8.36.ebuild
new file mode 100644
index 000000000000..42f41ec75cfe
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.36.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+src_prepare() {
+ local pc
+ for pc in *.pc.in ; do
+ echo "Libs.private: @PTHREAD_CFLAGS@" >> ${pc} #454478
+ done
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT) \
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable cxx cpp) \
+ $(use_enable jit) $(use_enable jit pcregrep-jit) \
+ $(use_enable pcre16) \
+ $(use_enable pcre32) \
+ $(multilib_native_use_enable libedit pcretest-libedit) \
+ $(multilib_native_use_enable readline pcretest-libreadline) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties) \
+ $(multilib_native_use_enable zlib pcregrep-libz) \
+ --enable-pcre8 \
+ --enable-shared \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ multilib_is_native_abi && gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/libpcre-8.37-r1.ebuild b/dev-libs/libpcre/libpcre-8.37-r1.ebuild
new file mode 100644
index 000000000000..f1689c796fb9
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.37-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+src_prepare() {
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT) \
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable cxx cpp) \
+ $(use_enable jit) $(use_enable jit pcregrep-jit) \
+ $(use_enable pcre16) \
+ $(use_enable pcre32) \
+ $(multilib_native_use_enable libedit pcretest-libedit) \
+ $(multilib_native_use_enable readline pcretest-libreadline) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties) \
+ $(multilib_native_use_enable zlib pcregrep-libz) \
+ --enable-pcre8 \
+ --enable-shared \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ multilib_is_native_abi && gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/libpcre-8.37-r2.ebuild b/dev-libs/libpcre/libpcre-8.37-r2.ebuild
new file mode 100644
index 000000000000..3037707549c4
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.37-r2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline:0= )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-CVE-2015-3210.patch #551240
+ epatch "${FILESDIR}"/${P}-CVE-2015-5073.patch #553300
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT) \
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable cxx cpp) \
+ $(use_enable jit) $(use_enable jit pcregrep-jit) \
+ $(use_enable pcre16) \
+ $(use_enable pcre32) \
+ $(multilib_native_use_enable libedit pcretest-libedit) \
+ $(multilib_native_use_enable readline pcretest-libreadline) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties) \
+ $(multilib_native_use_enable zlib pcregrep-libz) \
+ --enable-pcre8 \
+ --enable-shared \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ multilib_is_native_abi && gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/libpcre-8.37.ebuild b/dev-libs/libpcre/libpcre-8.37.ebuild
new file mode 100644
index 000000000000..1d284f51964b
--- /dev/null
+++ b/dev-libs/libpcre/libpcre-8.37.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils multilib libtool flag-o-matic toolchain-funcs multilib-minimal
+
+DESCRIPTION="Perl-compatible regular expression library"
+HOMEPAGE="http://www.pcre.org/"
+MY_P="pcre-${PV/_rc/-RC}"
+if [[ ${PV} != *_rc* ]] ; then
+ # Only the final releases are available here.
+ SRC_URI="mirror://sourceforge/pcre/${MY_P}.tar.bz2
+ ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${MY_P}.tar.bz2"
+else
+ SRC_URI="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/${MY_P}.tar.bz2"
+fi
+
+LICENSE="BSD"
+SLOT="3"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 +cxx +jit libedit pcre16 pcre32 +readline +recursion-limit static-libs unicode zlib"
+REQUIRED_USE="readline? ( !libedit )
+ libedit? ( !readline )"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ libedit? ( dev-libs/libedit )
+ readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ userland_GNU? ( >=sys-apps/findutils-4.4.0 )"
+RDEPEND="${RDEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/pcre-config
+)
+
+src_prepare() {
+ local pc
+ for pc in *.pc.in ; do
+ echo "Libs.private: @PTHREAD_CFLAGS@" >> ${pc} #454478
+ done
+ sed -i -e "s:-lpcre ::" libpcrecpp.pc.in || die
+ elibtoolize
+}
+
+multilib_src_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-match-limit-recursion=$(usex recursion-limit 8192 MATCH_LIMIT) \
+ $(multilib_native_use_enable bzip2 pcregrep-libbz2) \
+ $(use_enable cxx cpp) \
+ $(use_enable jit) $(use_enable jit pcregrep-jit) \
+ $(use_enable pcre16) \
+ $(use_enable pcre32) \
+ $(multilib_native_use_enable libedit pcretest-libedit) \
+ $(multilib_native_use_enable readline pcretest-libreadline) \
+ $(use_enable static-libs static) \
+ $(use_enable unicode utf) $(use_enable unicode unicode-properties) \
+ $(multilib_native_use_enable zlib pcregrep-libz) \
+ --enable-pcre8 \
+ --enable-shared \
+ --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
+ --docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+multilib_src_compile() {
+ emake V=1 $(multilib_is_native_abi || echo "bin_PROGRAMS=")
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ $(multilib_is_native_abi || echo "bin_PROGRAMS= dist_html_DATA=") \
+ install
+ multilib_is_native_abi && gen_usr_ldscript -a pcre
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libpcre.so.0
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libpcre.so.0
+}
diff --git a/dev-libs/libpcre/metadata.xml b/dev-libs/libpcre/metadata.xml
new file mode 100644
index 000000000000..083d23b785d1
--- /dev/null
+++ b/dev-libs/libpcre/metadata.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <use>
+ <flag name="bzip2">
+ Add support for pcregrep command to search within
+ bzip2-compressed files, through <pkg>sys-libs/zlib</pkg>.
+ </flag>
+ <flag name="pcre16">
+ Build 16 bit PCRE library.
+ </flag>
+ <flag name="pcre32">
+ Build 32 bit PCRE library.
+ </flag>
+ <flag name="readline">
+ Add support for command line editing to pcretest, through
+ <pkg>sys-libs/readline</pkg>.
+ </flag>
+ <flag name="recursion-limit">
+ Limit match recursion to 8192; if disabled, the default limit is
+ used, which is the same as the match limit.
+ </flag>
+ <flag name="zlib">
+ Add support for pcregrep command to search within
+ gzip-compressed files, through <pkg>app-arch/gzip</pkg>.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:pcre:pcre</remote-id>
+ <remote-id type="sourceforge">pcre</remote-id>
+ </upstream>
+</pkgmetadata>