Merge branch 'master' into el6

This commit is contained in:
Petr Šabata 2014-10-24 17:22:21 +02:00
commit e455f751ba
3 changed files with 128 additions and 10 deletions

61
tf-50b8.pcre.patch Normal file
View File

@ -0,0 +1,61 @@
From f61b5859d69c2d99264182f60f5ae1e430812b59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20=C5=A0abata?= <contyk@redhat.com>
Date: Fri, 10 Feb 2012 13:55:46 +0100
Subject: [PATCH] Fix build with PCRE-8.30+
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This patch fixes build with the latest PCRE release which removes some
obsolete code tinyfugue still uses, namely pcre_info().
Signed-off-by: Petr Šabata <contyk@redhat.com>
---
src/macro.c | 3 ++-
src/pattern.c | 2 +-
src/pattern.h | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/macro.c b/src/macro.c
index ac28fc9..b492717 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..a7228ff 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 <pcre.h>
typedef struct RegInfo {
pcre *re;
--
1.7.7.6

30
tf-50b8.x86_64.patch Normal file
View File

@ -0,0 +1,30 @@
diff -U5 -r tf-50b8.orig/src/tfio.c tf-50b8/src/tfio.c
--- tf-50b8.orig/src/tfio.c 2007-01-13 18:12:39.000000000 -0500
+++ tf-50b8/src/tfio.c 2007-02-02 16:50:12.000000000 -0500
@@ -495,10 +495,11 @@
const char *q, *sval;
char *specptr, quote;
const conString *Sval;
int len, min, max, leftjust, stars;
attr_t attrs = buf->attrs;
+ va_list aq;
if (!(flags & SP_APPEND) && buf->data) Stringtrunc(buf, 0);
while (*fmt) {
if (*fmt != '%' || *++fmt == '%') {
for (q = fmt + 1; *q && *q != '%'; q++);
@@ -520,11 +521,13 @@
switch (*fmt) {
case 'd': case 'i':
case 'x': case 'X': case 'u': case 'o':
case 'f': case 'e': case 'E': case 'g': case 'G':
case 'p':
- vsprintf(tempbuf, spec, ap);
+ va_copy(aq, ap);
+ vsprintf(tempbuf, spec, aq);
+ va_end(aq);
Stringcat(buf, tempbuf);
/* eat the arguments used by vsprintf() */
while (stars--) (void)va_arg(ap, int);
switch (*fmt) {
case 'd': case 'i':

View File

@ -1,17 +1,17 @@
%define packageversion 50b8
%global packageversion 50b8
Name: tinyfugue
Version: 5.0
Release: 0.13.b8%{?dist}
Release: 0.22.b8%{?dist}
Summary: A MU* client
Group: Applications/Internet
License: GPLv2+
URL: http://tinyfugue.sourceforge.net/
Source: http://downloads.sourceforge.net/tinyfugue/tf-%{packageversion}.tar.gz
Patch0: tf-50b7.build.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch1: tf-50b8.x86_64.patch
# https://sourceforge.net/tracker/?func=detail&aid=3486514&group_id=186112&atid=915972
Patch2: tf-50b8.pcre.patch
BuildRequires: ncurses-devel
BuildRequires: pcre-devel
BuildRequires: openssl-devel
@ -25,28 +25,55 @@ macros, and create hooks and triggers for automated responses to game messages.
%setup -q -n tf-%{packageversion}
# TinyFugue's build system is abysmal. Kluge it to honor $DESTDIR
%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
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_prefix}
make install DESTDIR=%{buildroot}
install -D -p -m 644 src/tf.1.nroffman %{buildroot}%{_mandir}/man1/tf.1
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc CHANGES COPYING CREDITS README
%{_bindir}/tf
%{_datadir}/tf-lib/
%{_mandir}/man1/tf.1*
%changelog
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.22.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.21.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.20.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.19.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.18.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Feb 10 2012 Petr Šabata <contyk@redhat.com> - 5.0-0.17.b8
- Unbundle pcre-2.08 (duh) and patch for 8.30
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.16.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Oct 12 2011 Petr Sabata <contyk@redhat.com> - 5.0-0.15.b8
- Don't crash on /ps @ x86_64 (#743468)
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0-0.14.b8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 5.0-0.13.b8
- rebuilt with new openssl