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.2
Release:        0
Summary:        GNU Chess Program
License:        GPL-2.0+
Group:          Amusements/Games/Board/Chess
Url:            http://www.gnu.org/software/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.02.pgn.bz2
#Source2:        book.dat.bz2
Source3:        genbook.sh
Source4:        gnuchess.6
Source5:        xgnuchess
BuildRequires:  bison
BuildRequires:  expect
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  readline-devel
Requires(post): info
Requires(preun):info
Provides:       chess_backend
Provides:       gchess
Recommends:     xboard
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

%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
%if 0%{?suse_version} > 1110
%make_install
%else
%makeinstall
%endif
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
openSUSE Build Service is sponsored by