File gnuchess.spec of Package gnuchess

#
# spec file for package gnuchess
#
# 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
# 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:        6.0.1
Release:        0
Summary:        GNU Chess Program
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.
Source1:        book_1.02.pgn.bz2
#Source2:        book.dat.bz2
Source3:        genbook.sh
Source4:        gnuchess.6
Source5:        xgnuchess
Patch0:         gnuchess-return-nonvoid.patch
BuildRequires:  bison
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

%description
A worthy chess opponent that runs in text mode. Find an X11 interface
in the xboard package.

%prep
%setup -q
%patch0

%build
%configure
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
%make_install
mkdir -p %{buildroot}%{_mandir}/man6
cp %{SOURCE4} %{buildroot}%{_mandir}/man6
# install xgnuchess
install -m 755 %{SOURCE5} %{buildroot}/%{_bindir}

%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
%{_bindir}/*
%{_mandir}/man*/*
%{_infodir}/gnuchess.info.gz
%{_datadir}/gnuchess

%changelog