File xboard.spec of Package xboard

# spec file for package xboard
# Copyright (c) 2018 SUSE LINUX 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

Name:           xboard
Version:        4.9.1
Release:        0
Summary:        X Window System Interface for playing chess
License:        GPL-3.0+
Group:          Amusements/Games/Board/Chess
Source3:        xboard.keyring
# PATCH-FIX-OPENSUSE xboard-prefer-gnuchess.patch
Patch0:         xboard-prefer-gnuchess.patch
BuildRequires:  cairo-devel
BuildRequires:  gtk2-devel >= 2.20.0
BuildRequires:  librsvg-devel
BuildRequires:  pango-devel
BuildRequires:  pkgconfig
BuildRequires:  texinfo
BuildRequires:  texlive-latex
BuildRequires:  update-desktop-files
BuildRequires:  xdg-utils
BuildRequires:  xorg-x11-devel
BuildRequires:  xorg-x11-libXt-devel
%if %{?suse_version} < 1330
BuildRequires:  hicolor-icon-theme
BuildRequires:  shared-mime-info
Requires:       chess_backend
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Recommends:     gnuchess

XBoard is a graphical user interface for chess in all its major forms, including international chess, xiangqi (Chinese chess), shogi Japanese chess) and Makruk, in addition to many minor variants such as Losers Chess, Crazyhouse, Chess960 and Capabanca Chess. It displays a chessboard on the screen, accepts moves made with the mouse, and loads and saves games in Portable Game Notation (PGN). It serves as a front-end for many different chess services, including:

    * Chess engines that will run on your machine and play a game against you or help you analyze, such as GNU Chess, Crafty, or many others.

    * Chess servers on the Internet, where you can connect to play chess with people from all over the world, watch other users play, or just hang out and chat.

    * Correspondence chess played by electronic mail. The CMail program automates the tasks of parsing email from your opponent, playing his moves out on your board, and mailing your reply move after you have chosen it.

%setup -q
%patch0 -p1

%configure --disable-silent-rules --enable-zippy --disable-update-mimedb
make %{?_smp_mflags}

%find_lang %{name} %{name}.lang
mkdir -p  %{buildroot}/%{_datadir}/icons/hicolor/32x32/mimetypes
mkdir -p  %{buildroot}/%{_datadir}/icons/hicolor/48x48/mimetypes
mv %{buildroot}/%{_datadir}/games/xboard/pixmaps/textures/ini32.png %{buildroot}/%{_datadir}/icons/hicolor/32x32/mimetypes/application-x-chess-opt.png
mv %{buildroot}/%{_datadir}/games/xboard/pixmaps/textures/ini48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/mimetypes/application-x-xboard-opt.png
mv %{buildroot}/%{_datadir}/games/xboard/pixmaps/textures/board32.png %{buildroot}/%{_datadir}/icons/hicolor/32x32/mimetypes/application-x-chess-pgn.png
mv %{buildroot}/%{_datadir}/games/xboard/pixmaps/textures/cross32.png %{buildroot}/%{_datadir}/icons/hicolor/32x32/mimetypes/application-x-xboard-trn.png
mv %{buildroot}/%{_datadir}/games/xboard/pixmaps/textures/board48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/mimetypes/application-x-chess-pgn.png
mv %{buildroot}/%{_datadir}/games/xboard/pixmaps/textures/cross48.png %{buildroot}/%{_datadir}/icons/hicolor/48x48/mimetypes/application-x-xboard-trn.png
%suse_update_desktop_file -i %{name} Game BoardGame
%suse_update_desktop_file -i -u %{name}-tourney Game BoardGame
%suse_update_desktop_file -i -u %{name}-pgn-viewer Game BoardGame
%suse_update_desktop_file -i -u %{name}-fen-viewer Game BoardGame

%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%if %{?suse_version} < 1330

%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%if %{?suse_version} < 1330

%files -f %{name}.lang
%license COPYING
%doc AUTHORS ChangeLog COPYRIGHT FAQ.html DIFFSTAT SHORTLOG NEWS README TODO engine-intf.html ics-parsing.txt readme.htm zippy.README
%dir %{_datadir}/games/xboard
%dir %{_datadir}/games/xboard/sounds/
%dir %{_datadir}/games/xboard/themes
%dir %{_datadir}/games/xboard/themes/conf/
%dir %{_datadir}/games/xboard/themes/default/
%dir %{_datadir}/games/xboard/themes/shogi/
%dir %{_datadir}/games/xboard/themes/xiangqi/
%dir %{_datadir}/games/xboard/themes/textures/
%config %{_sysconfdir}/%{name}.conf