From b34ee3f4aa570588b0f10fbcd35fde8545a0d7a8 Mon Sep 17 00:00:00 2001 From: Petr Šabata Date: Feb 10 2012 12:40:43 +0000 Subject: Unbundle pcre-2.08 (duh) and patch for 8.30 --- diff --git a/tf-50b8.pcre.patch b/tf-50b8.pcre.patch new file mode 100644 index 0000000..c0d9a66 --- /dev/null +++ b/tf-50b8.pcre.patch @@ -0,0 +1,40 @@ +diff --git a/src/macro.c b/src/macro.c +index ac28fc9..b847d09 100644 +--- a/src/macro.c ++++ b/src/macro.c +@@ -893,7 +893,8 @@ static int complete_macro(Macro *spec, unsigned int hash, int num, + } + spec->attr &= ~F_NONE; + if (spec->nsubattr) { +- int n = pcre_info(spec->trig.ri->re, NULL, NULL); ++ int n; ++ pcre_fullinfo(spec->trig.ri->re, NULL, PCRE_INFO_CAPTURECOUNT, &n); + for (i = 0; i < spec->nsubattr; i++) { + spec->subattr[i].attr &= ~F_NONE; + if (spec->subattr[i].subexp > n) { +diff --git a/src/pattern.c b/src/pattern.c +index 047a44a..f1b22ed 100644 +--- a/src/pattern.c ++++ b/src/pattern.c +@@ -151,7 +151,7 @@ static RegInfo *tf_reg_compile_fl(const char *pattern, int optimize, + emsg ? emsg : "unknown error"); + goto tf_reg_compile_error; + } +- n = pcre_info(ri->re, NULL, NULL); ++ pcre_fullinfo(ri->re, NULL, PCRE_INFO_CAPTURECOUNT, &n); + if (n < 0) goto tf_reg_compile_error; + ri->ovecsize = 3 * (n + 1); + ri->ovector = dmalloc(NULL, sizeof(int) * ri->ovecsize, file, line); +diff --git a/src/pattern.h b/src/pattern.h +index 1eec0f9..cbe9af9 100644 +--- a/src/pattern.h ++++ b/src/pattern.h +@@ -10,7 +10,7 @@ + #ifndef PATTERN_H + #define PATTERN_H + +-#include "pcre-2.08/pcre.h" ++#include + + typedef struct RegInfo { + pcre *re; diff --git a/tinyfugue.spec b/tinyfugue.spec index 46a7d01..680c317 100644 --- a/tinyfugue.spec +++ b/tinyfugue.spec @@ -10,6 +10,7 @@ URL: http://tinyfugue.sourceforge.net/ Source: http://downloads.sourceforge.net/tinyfugue/tf-%{packageversion}.tar.gz Patch0: tf-50b7.build.patch Patch1: tf-50b8.x86_64.patch +Patch2: tf-50b8.pcre.patch BuildRequires: ncurses-devel BuildRequires: pcre-devel BuildRequires: openssl-devel @@ -25,6 +26,9 @@ macros, and create hooks and triggers for automated responses to game messages. %patch0 -p1 # x86_64 fix (#743468) %patch1 -p1 +# Unbundle the old PCRE and update to 8.30 +%patch2 -p1 +rm -rf src/pcre-2.08 %build %configure --enable-core @@ -42,8 +46,8 @@ install -D -p -m 644 src/tf.1.nroffman %{buildroot}%{_mandir}/man1/tf.1 %{_mandir}/man1/tf.1* %changelog -* Fri Feb 10 2012 Petr Pisar - 5.0-0.17.b8 -- Rebuild against PCRE 8.30 +* Fri Feb 10 2012 Petr Šabata - 5.0-0.17.b8 +- Unbundle pcre-2.08 (duh) and patch for 8.30 * Sat Jan 14 2012 Fedora Release Engineering - 5.0-0.16.b8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild