From 7bf6b3d358c8bda84f1864637c82b26b01f99b20a9cb4621c422489967d0b411 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 15 Apr 2011 12:14:20 +0000 Subject: [PATCH 1/3] - 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 - 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 OBS-URL: https://build.opensuse.org/package/show/games/gnuchess?expand=0&rev=5 --- book.dat.bz2 | 4 +- gnuchess-5.07.94.1b.tar.bz2 | 3 + gnuchess-add_new_bookpath.diff | 10 ++ gnuchess-fix-missing-fclose.diff | 17 ++++ gnuchess-getline.diff | 14 +-- ...issing-includes_implicit-fortify-decl.diff | 10 ++ gnuchess-no-return-in-nonvoid-function.diff | 21 +++++ gnuchess-nonstatic.diff | 8 +- gnuchess.changes | 18 ++++ gnuchess.spec | 92 ++++++++----------- xgnuchess | 28 ++++++ 11 files changed, 160 insertions(+), 65 deletions(-) create mode 100644 gnuchess-5.07.94.1b.tar.bz2 create mode 100644 gnuchess-add_new_bookpath.diff create mode 100644 gnuchess-fix-missing-fclose.diff create mode 100644 gnuchess-missing-includes_implicit-fortify-decl.diff create mode 100644 gnuchess-no-return-in-nonvoid-function.diff create mode 100644 xgnuchess diff --git a/book.dat.bz2 b/book.dat.bz2 index e4d302d..2c5cc4e 100644 --- a/book.dat.bz2 +++ b/book.dat.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9f62afd86117da524883b505a29f4a0a0c9ea40797ef2952fb22e990644421cf -size 2536707 +oid sha256:19a3b1d0411de6fe81596a24f206dab4f46541e9d776c74738d07a179e98180a +size 2536941 diff --git a/gnuchess-5.07.94.1b.tar.bz2 b/gnuchess-5.07.94.1b.tar.bz2 new file mode 100644 index 0000000..aad914e --- /dev/null +++ b/gnuchess-5.07.94.1b.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:433bd983dff7ff9cdd0fcaf9ebd5dd815badac611feaa2c0928b0ca4dd9efd03 +size 263250 diff --git a/gnuchess-add_new_bookpath.diff b/gnuchess-add_new_bookpath.diff new file mode 100644 index 0000000..e0e4e8a --- /dev/null +++ b/gnuchess-add_new_bookpath.diff @@ -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 diff --git a/gnuchess-fix-missing-fclose.diff b/gnuchess-fix-missing-fclose.diff new file mode 100644 index 0000000..791c1d3 --- /dev/null +++ b/gnuchess-fix-missing-fclose.diff @@ -0,0 +1,17 @@ +Index: src/book.c +=================================================================== +--- src/book.c.orig ++++ src/book.c +@@ -343,9 +343,11 @@ int BookBuilderOpen(void) + } + digest_bits = MAX_DIGEST_BITS; + /* We use read_book() here only to allocate memory */ +- if (read_book(wfp) == BOOK_ENOMEM) { ++ if (read_book(rfp) == BOOK_ENOMEM) { ++ fclose(rfp); + return BOOK_ENOMEM; + } ++ fclose(rfp); + } + return BOOK_SUCCESS; + } diff --git a/gnuchess-getline.diff b/gnuchess-getline.diff index f9bbad8..17b4db0 100644 --- a/gnuchess-getline.diff +++ b/gnuchess-getline.diff @@ -1,6 +1,6 @@ ---- src/common.h -+++ src/common.h -@@ -745,7 +745,7 @@ +--- src/common.h.orig 2009-10-26 09:54:40.000000000 +0100 ++++ src/common.h 2010-01-11 19:58:43.000000000 +0100 +@@ -752,7 +752,7 @@ * Input routine, initialized to one of the specific * input routines. The given argument is the prompt. */ @@ -9,9 +9,9 @@ #define MAXSTR 128 extern char inputstr[MAXSTR]; ---- src/input.c -+++ src/input.c -@@ -127,7 +127,7 @@ +--- src/input.c.orig 2009-09-28 15:39:17.000000000 +0200 ++++ src/input.c 2010-01-11 19:58:43.000000000 +0100 +@@ -136,7 +136,7 @@ (RealGameCnt+1)/2 + 1 ); } pthread_mutex_lock(&input_mutex); @@ -20,7 +20,7 @@ input_status = INPUT_AVAILABLE; pthread_cond_signal(&input_cond); pthread_mutex_unlock(&input_mutex); -@@ -173,13 +173,13 @@ +@@ -182,13 +182,13 @@ { #ifdef HAVE_LIBREADLINE if (isatty(STDIN_FILENO)) { diff --git a/gnuchess-missing-includes_implicit-fortify-decl.diff b/gnuchess-missing-includes_implicit-fortify-decl.diff new file mode 100644 index 0000000..83e45a8 --- /dev/null +++ b/gnuchess-missing-includes_implicit-fortify-decl.diff @@ -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 ++#include + + #include "common.h" + #include "game.h" diff --git a/gnuchess-no-return-in-nonvoid-function.diff b/gnuchess-no-return-in-nonvoid-function.diff new file mode 100644 index 0000000..eccfdbb --- /dev/null +++ b/gnuchess-no-return-in-nonvoid-function.diff @@ -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; + } + + diff --git a/gnuchess-nonstatic.diff b/gnuchess-nonstatic.diff index b2276c5..de5a97e 100644 --- a/gnuchess-nonstatic.diff +++ b/gnuchess-nonstatic.diff @@ -1,7 +1,7 @@ ---- src/input.c -+++ src/input.c -@@ -92,7 +92,7 @@ - fgets(inputstr, MAXSTR, stdin); +--- src/input.c.orig 2009-09-28 15:39:17.000000000 +0200 ++++ src/input.c 2010-01-11 19:57:34.000000000 +0100 +@@ -99,7 +99,7 @@ + } } -static pthread_t input_thread; diff --git a/gnuchess.changes b/gnuchess.changes index 0142fc1..31f5323 100644 --- a/gnuchess.changes +++ b/gnuchess.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +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 diff --git a/gnuchess.spec b/gnuchess.spec index 931cbdd..dd8da79 100644 --- a/gnuchess.spec +++ b/gnuchess.spec @@ -1,74 +1,60 @@ # -# spec file for package gnuchess (Version 5.07) -# -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - - Name: gnuchess -BuildRequires: bison flex readline-devel -Url: http://www.gnu.org/software/chess/chess.html +Version: 5.07.94.1b +Release: 1 License: GPLv2+ +Summary: GNU Chess Program (enhanced version) +Url: http://alpha.uhasselt.be/Research/Algebra/Toga/gnuchess-release/ Group: Amusements/Games/Board/Chess -Provides: chess_backend -Provides: gchess -AutoReqProv: on -Version: 5.07 -Release: 145 -Summary: GNU Chess Program -Source: %{name}-%{version}.tar.bz2 +Source0: %{name}-%{version}.tar.bz2 # WARNING: Don't forget to re-generate book.dat manually before submit! # Simply remove the source and build, updated book will be generated. Source1: book_1.01.pgn.bz2 Source2: book.dat.bz2 Source3: genbook.sh Source4: gnuchess.6 +Source5: xgnuchess Patch0: gnuchess-nonstatic.diff -Patch1: gnuchess-getline.diff -# PATCH-FIX-OPENSUSE gnuchess-5.07-fix-missing-fclose.patch bnc#534576 -Patch2: gnuchess-5.07-fix-missing-fclose.patch +Patch1: gnuchess-no-return-in-nonvoid-function.diff +Patch2: gnuchess-missing-includes_implicit-fortify-decl.diff +Patch3: gnuchess-add_new_bookpath.diff +Patch4: gnuchess-getline.diff +Patch5: gnuchess-fix-missing-fclose.diff +BuildRequires: bison +BuildRequires: flex +BuildRequires: readline-devel +Provides: chess_backend +Provides: gchess BuildRoot: %{_tmppath}/%{name}-%{version}-build %description A worthy chess opponent that runs in text mode. Find an X11 interface in the xboard package. +This version includes some enhancements be Michel Vandenbergh, it is not an official release +from the GNU project. +Development on the official version seems to have stalled for several years now and this version also contains a few bug fixes. - -Authors: --------- - Hans Eric Sandstrom - Stuart Cracraft - Mike McGann - Philippe Schnoebelen - Tim Mann +See http://alpha.uhasselt.be/Research/Algebra/Toga/ for more information. %prep -%setup -%patch0 -%patch1 +%setup -q +%patch0 -p0 +%patch1 -p0 +%patch2 -p0 +%patch3 -p0 +%patch4 -p0 +%patch5 -p0 %build -CFLAGS="$RPM_OPT_FLAGS" -./configure --prefix=%{_prefix} \ - --mandir=%{_mandir} \ - --datadir=%{_datadir} +export CFLAGS="%{optflags} -pthread" +%configure sed '/\/usr\/lib\/games\/gnuchess\/book\.dat/d;s:/usr/share/games:%{_datadir}:' src/book.h~ mv src/book.h~ src/book.h -make +make CFLAGS="%{optflags} -pthread" %install if [ -f %{SOURCE2} ] ; then @@ -77,20 +63,22 @@ else sh %{SOURCE3} %{SOURCE1} fi 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 +%make_install +mkdir -p %{buildroot}%{_mandir}/man6 +cp %{SOURCE4} %{buildroot}%{_mandir}/man6 +mkdir -p %{buildroot}%{_datadir}/gnuchess +cp book.dat %{buildroot}%{_datadir}/gnuchess +# install xgnuchess +install -m 755 %{SOURCE5} %{buildroot}/%{_bindir} %clean -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} %files %defattr(-,root,root) -%{_prefix}/bin/* +%doc AUTHORS COPYING ChangeLog NEWS README TODO doc +%{_bindir}/* %{_mandir}/man*/* %{_datadir}/gnuchess -%doc AUTHORS COPYING ChangeLog NEWS README TODO doc %changelog diff --git a/xgnuchess b/xgnuchess new file mode 100644 index 0000000..be689df --- /dev/null +++ b/xgnuchess @@ -0,0 +1,28 @@ +#! /bin/sh +# +# Run xboard with gnuchess as chess program. +# +# modified from "xcrafty" originally from: +# +# Steffen Winterfeldt +# +# 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 "$@" & From 884267f62b109d428d1bb654de8d80aad7bbd399886d24e9cabb2605f077e79a Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Thu, 1 Dec 2011 07:36:10 +0000 Subject: [PATCH 2/3] Accepting request 94250 from home:jreidinger:branches:games - update gnuchess to official version 6.0.1 - clean up patches - change generation of recent book dat from source during build OBS-URL: https://build.opensuse.org/request/show/94250 OBS-URL: https://build.opensuse.org/package/show/games/gnuchess?expand=0&rev=6 --- book.dat.bz2 | 3 - book_1.01.pgn.bz2 | 3 - book_1.02.pgn.bz2 | 3 + genbook.sh | 9 ++- gnuchess-5.07.94.1b.tar.bz2 | 3 - gnuchess-6.0.1.tar.bz2 | 3 + gnuchess-add_new_bookpath.diff | 10 --- gnuchess-fix-missing-fclose.diff | 17 ----- gnuchess-getline.diff | 39 ---------- ...issing-includes_implicit-fortify-decl.diff | 10 --- gnuchess-no-return-in-nonvoid-function.diff | 21 ----- gnuchess-nonstatic.diff | 11 --- gnuchess-return-nonvoid.patch | 18 +++++ gnuchess.changes | 7 ++ gnuchess.spec | 76 ++++++++++--------- xgnuchess | 28 ------- 16 files changed, 76 insertions(+), 185 deletions(-) delete mode 100644 book.dat.bz2 delete mode 100644 book_1.01.pgn.bz2 create mode 100644 book_1.02.pgn.bz2 delete mode 100644 gnuchess-5.07.94.1b.tar.bz2 create mode 100644 gnuchess-6.0.1.tar.bz2 delete mode 100644 gnuchess-add_new_bookpath.diff delete mode 100644 gnuchess-fix-missing-fclose.diff delete mode 100644 gnuchess-getline.diff delete mode 100644 gnuchess-missing-includes_implicit-fortify-decl.diff delete mode 100644 gnuchess-no-return-in-nonvoid-function.diff delete mode 100644 gnuchess-nonstatic.diff create mode 100644 gnuchess-return-nonvoid.patch delete mode 100644 xgnuchess diff --git a/book.dat.bz2 b/book.dat.bz2 deleted file mode 100644 index 2c5cc4e..0000000 --- a/book.dat.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19a3b1d0411de6fe81596a24f206dab4f46541e9d776c74738d07a179e98180a -size 2536941 diff --git a/book_1.01.pgn.bz2 b/book_1.01.pgn.bz2 deleted file mode 100644 index 67d0453..0000000 --- a/book_1.01.pgn.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b34ad9074cd9f6e77d8e9d7e24f9eb143c0844d75f0f9fb2d16c757a8f6aeb32 -size 18117363 diff --git a/book_1.02.pgn.bz2 b/book_1.02.pgn.bz2 new file mode 100644 index 0000000..2dcdb1f --- /dev/null +++ b/book_1.02.pgn.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3b17d45d8d8296893fe00a7ef20557d1e70121abc6fccffac6ec9d53c74666e +size 18113255 diff --git a/genbook.sh b/genbook.sh index ccf674f..aebe465 100644 --- a/genbook.sh +++ b/genbook.sh @@ -14,10 +14,13 @@ echo -e "\nDone." #echo -e "\nDone.\n" echo -e "\nGenerating book...\n" -src/gnuchess < -+#include - - #include "common.h" - #include "game.h" diff --git a/gnuchess-no-return-in-nonvoid-function.diff b/gnuchess-no-return-in-nonvoid-function.diff deleted file mode 100644 index eccfdbb..0000000 --- a/gnuchess-no-return-in-nonvoid-function.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- 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; - } - - diff --git a/gnuchess-nonstatic.diff b/gnuchess-nonstatic.diff deleted file mode 100644 index de5a97e..0000000 --- a/gnuchess-nonstatic.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- src/input.c.orig 2009-09-28 15:39:17.000000000 +0200 -+++ src/input.c 2010-01-11 19:57:34.000000000 +0100 -@@ -99,7 +99,7 @@ - } - } - --static pthread_t input_thread; -+pthread_t input_thread; - - /* Mutex and condition variable for thread communication */ - diff --git a/gnuchess-return-nonvoid.patch b/gnuchess-return-nonvoid.patch new file mode 100644 index 0000000..ef59209 --- /dev/null +++ b/gnuchess-return-nonvoid.patch @@ -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; + } + + /* diff --git a/gnuchess.changes b/gnuchess.changes index 31f5323..72cd0f3 100644 --- a/gnuchess.changes +++ b/gnuchess.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +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 diff --git a/gnuchess.spec b/gnuchess.spec index dd8da79..c3fbe5f 100644 --- a/gnuchess.spec +++ b/gnuchess.spec @@ -1,31 +1,45 @@ # +# spec file for package gnuchess +# +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + + Name: gnuchess -Version: 5.07.94.1b +Version: 6.0.1 Release: 1 License: GPLv2+ -Summary: GNU Chess Program (enhanced version) +Summary: GNU Chess Program Url: http://alpha.uhasselt.be/Research/Algebra/Toga/gnuchess-release/ Group: Amusements/Games/Board/Chess Source0: %{name}-%{version}.tar.bz2 # WARNING: Don't forget to re-generate book.dat manually before submit! # Simply remove the source and build, updated book will be generated. -Source1: book_1.01.pgn.bz2 -Source2: book.dat.bz2 +Source1: book_1.02.pgn.bz2 +#Source2: book.dat.bz2 Source3: genbook.sh Source4: gnuchess.6 Source5: xgnuchess -Patch0: gnuchess-nonstatic.diff -Patch1: gnuchess-no-return-in-nonvoid-function.diff -Patch2: gnuchess-missing-includes_implicit-fortify-decl.diff -Patch3: gnuchess-add_new_bookpath.diff -Patch4: gnuchess-getline.diff -Patch5: gnuchess-fix-missing-fclose.diff +Patch0: gnuchess-return-nonvoid.patch BuildRequires: bison BuildRequires: flex BuildRequires: readline-devel +BuildRequires: gcc-c++ +BuildRequires: expect +Requires(post): info +Requires(preun):info Provides: chess_backend Provides: gchess BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -34,51 +48,39 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build A worthy chess opponent that runs in text mode. Find an X11 interface in the xboard package. -This version includes some enhancements be Michel Vandenbergh, it is not an official release -from the GNU project. -Development on the official version seems to have stalled for several years now and this version also contains a few bug fixes. - -See http://alpha.uhasselt.be/Research/Algebra/Toga/ for more information. - %prep %setup -q -%patch0 -p0 -%patch1 -p0 -%patch2 -p0 -%patch3 -p0 -%patch4 -p0 -%patch5 -p0 +%patch0 %build -export CFLAGS="%{optflags} -pthread" %configure -sed '/\/usr\/lib\/games\/gnuchess\/book\.dat/d;s:/usr/share/games:%{_datadir}:' src/book.h~ -mv src/book.h~ src/book.h -make CFLAGS="%{optflags} -pthread" +make %{?_smp_mflags} +sed -i 's/^Book[[:space:]]*=[[:space:]]*false/Book = true/;s/^OwnBook[[:space:]]=[[:space:]]*false/OwnBook = true/' src/gnuchess.ini +sh %{SOURCE3} %{SOURCE1} %install -if [ -f %{SOURCE2} ] ; then - bzcat %{SOURCE2} >book.dat -else - sh %{SOURCE3} %{SOURCE1} -fi -rm -rf doc/CVS %make_install mkdir -p %{buildroot}%{_mandir}/man6 cp %{SOURCE4} %{buildroot}%{_mandir}/man6 -mkdir -p %{buildroot}%{_datadir}/gnuchess -cp book.dat %{buildroot}%{_datadir}/gnuchess # install xgnuchess install -m 755 %{SOURCE5} %{buildroot}/%{_bindir} -%clean -rm -rf %{buildroot} +%post +%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 %defattr(-,root,root) -%doc AUTHORS COPYING ChangeLog NEWS README TODO doc +%doc AUTHORS COPYING ChangeLog NEWS README TODO %{_bindir}/* %{_mandir}/man*/* +%{_infodir}/gnuchess.info.gz %{_datadir}/gnuchess %changelog diff --git a/xgnuchess b/xgnuchess deleted file mode 100644 index be689df..0000000 --- a/xgnuchess +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/sh -# -# Run xboard with gnuchess as chess program. -# -# modified from "xcrafty" originally from: -# -# Steffen Winterfeldt -# -# 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 "$@" & From be778fa0039358e19a661992ef93e62b867fe597196bb42ea377bbda9c3e4e5f Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sat, 4 Feb 2012 14:48:05 +0000 Subject: [PATCH 3/3] format spec service ran OBS-URL: https://build.opensuse.org/package/show/games/gnuchess?expand=0&rev=7 --- gnuchess.spec | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gnuchess.spec b/gnuchess.spec index c3fbe5f..8ff8950 100644 --- a/gnuchess.spec +++ b/gnuchess.spec @@ -1,7 +1,7 @@ # # spec file for package gnuchess # -# Copyright (c) 2011 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 # remain the property of their copyright owners, unless otherwise agreed @@ -16,14 +16,13 @@ # - Name: gnuchess Version: 6.0.1 -Release: 1 -License: GPLv2+ +Release: 0 Summary: GNU Chess Program -Url: http://alpha.uhasselt.be/Research/Algebra/Toga/gnuchess-release/ +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! # Simply remove the source and build, updated book will be generated. @@ -34,10 +33,10 @@ Source4: gnuchess.6 Source5: xgnuchess Patch0: gnuchess-return-nonvoid.patch BuildRequires: bison -BuildRequires: flex -BuildRequires: readline-devel -BuildRequires: gcc-c++ BuildRequires: expect +BuildRequires: flex +BuildRequires: gcc-c++ +BuildRequires: readline-devel Requires(post): info Requires(preun):info Provides: chess_backend