Accepting request 102712 from games

sync factory with devel project; license tag was fixed by spec-formatter

OBS-URL: https://build.opensuse.org/request/show/102712
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gnuchess?expand=0&rev=10
This commit is contained in:
Stephan Kulow 2012-02-06 14:54:39 +00:00 committed by Git OBS Bridge
commit ef1289e04f
17 changed files with 170 additions and 116 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9f62afd86117da524883b505a29f4a0a0c9ea40797ef2952fb22e990644421cf
size 2536707

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b34ad9074cd9f6e77d8e9d7e24f9eb143c0844d75f0f9fb2d16c757a8f6aeb32
size 18117363

3
book_1.02.pgn.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3b17d45d8d8296893fe00a7ef20557d1e70121abc6fccffac6ec9d53c74666e
size 18113255

View File

@ -14,10 +14,13 @@ echo -e "\nDone."
#echo -e "\nDone.\n" #echo -e "\nDone.\n"
echo -e "\nGenerating book...\n" echo -e "\nGenerating book...\n"
src/gnuchess <<EOF expect <<EOF
book add book.pgn set timeout 360
quit spawn src/gnuchess
expect "White" { send "book add book.pgn\n" }
expect "all done!" { send "quit\n" }
EOF EOF
mv -v book.bin src/book.bin
echo -e "\nDone.\n" echo -e "\nDone.\n"
echo "Books are ready!" echo "Books are ready!"

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:433bd983dff7ff9cdd0fcaf9ebd5dd815badac611feaa2c0928b0ca4dd9efd03
size 263250

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c19282ab3f3658ebbfbd350e51c7f27f68f81aa21b586e7e671673d78a58a401
size 193507

3
gnuchess-6.0.1.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea72ed5d78a62c2c81e7c9235b4555f23253e4b3376b4d32ea18743b95004e30
size 444585

View File

@ -0,0 +1,10 @@
--- src/book.c.orig 2010-08-04 20:11:16.000000000 +0200
+++ src/book.c 2010-08-04 20:12:15.000000000 +0200
@@ -135,6 +135,7 @@
static char const * bookbin[] = {
"book.dat",
+ "/usr/share/gnuchess/book.dat",
"/usr/share/games/gnuchess/book.dat",
"/usr/lib/games/gnuchess/book.dat",
NULL

View File

@ -1,39 +0,0 @@
--- src/common.h
+++ src/common.h
@@ -745,7 +745,7 @@
* Input routine, initialized to one of the specific
* input routines. The given argument is the prompt.
*/
-void (*getline) (char *);
+void (*my_getline) (char *);
#define MAXSTR 128
extern char inputstr[MAXSTR];
--- src/input.c
+++ src/input.c
@@ -127,7 +127,7 @@
(RealGameCnt+1)/2 + 1 );
}
pthread_mutex_lock(&input_mutex);
- getline(prompt);
+ my_getline(prompt);
input_status = INPUT_AVAILABLE;
pthread_cond_signal(&input_cond);
pthread_mutex_unlock(&input_mutex);
@@ -173,13 +173,13 @@
{
#ifdef HAVE_LIBREADLINE
if (isatty(STDIN_FILENO)) {
- getline = getline_readline;
+ my_getline = getline_readline;
using_history();
} else {
- getline = getline_standard;
+ my_getline = getline_standard;
}
#else
- getline = getline_standard;
+ my_getline = getline_standard;
#endif
/* Start input thread */
pthread_create(&input_thread, NULL, input_func, NULL);

View File

@ -0,0 +1,10 @@
--- src/game.c.orig 2010-08-04 20:03:13.000000000 +0200
+++ src/game.c 2010-08-04 20:04:02.000000000 +0200
@@ -1,6 +1,7 @@
// includes
#include <string.h>
+#include <unistd.h>
#include "common.h"
#include "game.h"

View File

@ -0,0 +1,21 @@
--- src/book.c.orig 2010-08-04 19:58:11.000000000 +0200
+++ src/book.c 2010-08-04 19:59:08.000000000 +0200
@@ -560,7 +560,7 @@
static FILE* BookFileOpen(const char *file){
FILE* rfp;
rfp = fopen(file, "rb");
- if (rfp == NULL) return;
+ if (rfp == NULL) return 0;
OutputConsole("Read opening book (%s)...\n", file);
if (!check_magic(rfp)) {
Output( " File %s does not conform to the current format.\n"
--- src/timer.c.orig 2010-08-04 20:00:20.000000000 +0200
+++ src/timer.c 2010-08-04 20:00:54.000000000 +0200
@@ -5,6 +5,7 @@
TimerStart(timer__t *timer){
gettimeofday (timer, NULL);
+ return 0;
}

View File

@ -1,11 +0,0 @@
--- src/input.c
+++ src/input.c
@@ -92,7 +92,7 @@
fgets(inputstr, MAXSTR, stdin);
}
-static pthread_t input_thread;
+pthread_t input_thread;
/* Mutex and condition variable for thread communication */

View File

@ -0,0 +1,18 @@
--- src/components.cc.old 2011-11-29 09:48:53.000000000 +0000
+++ src/components.cc 2011-11-29 09:56:31.000000000 +0000
@@ -65,6 +65,7 @@
InitEngine();
/* Start adapter main loop */
adapter::main_adapter( 0, 0 );
+ return 0;
}
/*
@@ -100,6 +101,7 @@
{
/* Start engine main loop */
engine::main_engine( 0, 0 );
+ return 0;
}
/*

View File

@ -1,3 +1,28 @@
-------------------------------------------------------------------
Tue Nov 29 12:08:41 UTC 2011 - jreidinger@suse.com
- update gnuchess to official version 6.0.1
- clean up patches
- change generation of recent book dat from source during build
-------------------------------------------------------------------
Wed Aug 4 17:37:37 UTC 2010 - packman@links2linux.de
- updated gnuchess to (unofficial) version 5.07.94.1b
- updated to most recent book.dat
- removed obsolete getline patch
- added patches to fix a few rpmlint-warnings/errors
- added gnuchess-add_new_bookpath.diff so gnuchess finds the default
opening book in /usr/share/gnuchess
-------------------------------------------------------------------
Mon Jan 11 00:00:00 UTC 2010 - packman@links2linux.de
- updated to (unofficial) version 5.07.9b by M. Vandenbergh
- added script "xgnuchess" to start xboard with gnuchess
as first and second chess engine
- patches refreshed
- description updated
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 16 11:16:01 CEST 2009 - marek.belisko@open-nandra.com Fri Oct 16 11:16:01 CEST 2009 - marek.belisko@open-nandra.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package gnuchess (Version 5.07) # spec file for package gnuchess
# #
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -15,82 +15,71 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
# norootforbuild
Name: gnuchess Name: gnuchess
BuildRequires: bison flex readline-devel Version: 6.0.1
Url: http://www.gnu.org/software/chess/chess.html Release: 0
License: GPLv2+
Group: Amusements/Games/Board/Chess
Provides: chess_backend
Provides: gchess
AutoReqProv: on
Version: 5.07
Release: 145
Summary: GNU Chess Program Summary: GNU Chess Program
Source: %{name}-%{version}.tar.bz2 License: GPL-2.0+
Group: Amusements/Games/Board/Chess
Url: http://alpha.uhasselt.be/Research/Algebra/Toga/gnuchess-release/
Source0: %{name}-%{version}.tar.bz2
# WARNING: Don't forget to re-generate book.dat manually before submit! # WARNING: Don't forget to re-generate book.dat manually before submit!
# Simply remove the source and build, updated book will be generated. # Simply remove the source and build, updated book will be generated.
Source1: book_1.01.pgn.bz2 Source1: book_1.02.pgn.bz2
Source2: book.dat.bz2 #Source2: book.dat.bz2
Source3: genbook.sh Source3: genbook.sh
Source4: gnuchess.6 Source4: gnuchess.6
Patch0: gnuchess-nonstatic.diff Source5: xgnuchess
Patch1: gnuchess-getline.diff Patch0: gnuchess-return-nonvoid.patch
# PATCH-FIX-OPENSUSE gnuchess-5.07-fix-missing-fclose.patch bnc#534576 BuildRequires: bison
Patch2: gnuchess-5.07-fix-missing-fclose.patch BuildRequires: expect
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: readline-devel
Requires(post): info
Requires(preun):info
Provides: chess_backend
Provides: gchess
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
A worthy chess opponent that runs in text mode. Find an X11 interface A worthy chess opponent that runs in text mode. Find an X11 interface
in the xboard package. in the xboard package.
Authors:
--------
Hans Eric Sandstrom <hes@log-sv.se>
Stuart Cracraft <cracraft@rice-chex.ai.mit.edu>
Mike McGann <mwm@hslrswi.hasler.ascom.ch>
Philippe Schnoebelen <phs@lifia.imag.fr>
Tim Mann <mann@src.dec.com>
%prep %prep
%setup %setup -q
%patch0 %patch0
%patch1
%build %build
CFLAGS="$RPM_OPT_FLAGS" %configure
./configure --prefix=%{_prefix} \ make %{?_smp_mflags}
--mandir=%{_mandir} \ sed -i 's/^Book[[:space:]]*=[[:space:]]*false/Book = true/;s/^OwnBook[[:space:]]=[[:space:]]*false/OwnBook = true/' src/gnuchess.ini
--datadir=%{_datadir} sh %{SOURCE3} %{SOURCE1}
sed '/\/usr\/lib\/games\/gnuchess\/book\.dat/d;s:/usr/share/games:%{_datadir}:' <src/book.h >src/book.h~
mv src/book.h~ src/book.h
make
%install %install
if [ -f %{SOURCE2} ] ; then %make_install
bzcat %{SOURCE2} >book.dat mkdir -p %{buildroot}%{_mandir}/man6
else cp %{SOURCE4} %{buildroot}%{_mandir}/man6
sh %{SOURCE3} %{SOURCE1} # install xgnuchess
fi install -m 755 %{SOURCE5} %{buildroot}/%{_bindir}
rm -rf doc/CVS
make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man6
cp %{SOURCE4} $RPM_BUILD_ROOT%{_mandir}/man6
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gnuchess
cp book.dat $RPM_BUILD_ROOT%{_datadir}/gnuchess
%clean %post
rm -rf $RPM_BUILD_ROOT %install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%preun
if [ $1 = 0 ] ; then
if [ -f %{_infodir}/%{name}.info.gz ] ; then
%install_info --info-dir=%{_infodir} --delete %{_infodir}/%{name}.info.gz
fi
fi
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_prefix}/bin/* %doc AUTHORS COPYING ChangeLog NEWS README TODO
%{_bindir}/*
%{_mandir}/man*/* %{_mandir}/man*/*
%{_infodir}/gnuchess.info.gz
%{_datadir}/gnuchess %{_datadir}/gnuchess
%doc AUTHORS COPYING ChangeLog NEWS README TODO doc
%changelog %changelog

28
xgnuchess Normal file
View File

@ -0,0 +1,28 @@
#! /bin/sh
#
# Run xboard with gnuchess as chess program.
#
# modified from "xcrafty" originally from:
#
# Steffen Winterfeldt <wfeldt@suse.de>
#
# Copyright (c) 1999 SuSE GmbH Nuernberg, Germany. All rights reserved.
#
[ "$DISPLAY" ] || {
echo >&2 "This is not a text mode application!"
exit 63
}
emsg="You\'ll have to install package \'xboard\' first to run xgnuchess."
which xboard >/dev/null 2>&1 || {
if tty -s ; then
sh -c "echo >&2 $emsg"
else
xterm +sb -T "xgnuchess error" -bg white -fg red -e sh -c "echo $emsg ; read"
fi
exit 42
}
exec xboard -size bulky -fcp gnuchessx -scp gnuchessx "$@" &