File scid.spec of Package scid

#
# spec file for package scid
#
# Copyright (c) 2026 SUSE LLC and contributors
#
# 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 https://bugs.opensuse.org/
#


Name:           scid
Version:        5.1.202601
Release:        0
Summary:        A chess database application
License:        GPL-2.0-only
Group:          Amusements/Games/Board/Chess
URL:            http://scid.sourceforge.net/
Source:         %{name}-%{version}.tar.gz
Source1:        %{name}.png
Source2:        %{name}.desktop
Source3:        %{name}.6
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  tcl-devel
BuildRequires:  tk-devel
BuildRequires:  unzip
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(x11)
Requires:       bash
Requires:       python3
Requires:       tcl
Requires:       tk
Recommends:     snack
Provides:       scid = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Scid can perform many different searches, such as for particular
players, a certain opening position, material searches, and pattern
searches such as isolated pawns. It is very fast, because it uses its
own efficient format, but it can convert games to and from PGN, the
standard format for chess game files.

Scid can use a chess engine such as Crafty to analyze games and also
has a "tree" mode where it automatically shows all moves played from
the current position, their opening codes, success rates, etc.

%prep
%setup -q

%build
./configure
%make_build

%install
make SHAREDIR=%{buildroot}%{_libexecdir}/scid BINDIR=%{buildroot}%{_bindir} install
# A whole bunch of old scripts. Not necessary to run the application,
# and half of them require python 2, which we no longer supply. Remove all of it

# See https://github.com/benini/scid/issues/217
rm -r %{buildroot}%{_libexecdir}/scid/scripts/

chmod +x %{buildroot}%{_libexecdir}/scid/tcl/contrib/ezsmtp/install.tcl
chmod +x %{buildroot}%{_libexecdir}/scid/tcl/start.tcl

# # install sound files
install -m 644  sounds/* %{buildroot}%{_libexecdir}/scid/sounds/
# install desktop file & icon
install -D -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/scid.png
install -D -m 644 %{SOURCE2} %{buildroot}%{_datadir}/applications/scid.desktop
%suse_update_desktop_file -i "scid" Game BoardGame
# install man page
install -D -m 644 %{SOURCE3} %{buildroot}%{_mandir}/man6/scid.6
# Replace symlink with binary
rm %{buildroot}%{_bindir}/scid
# Redo the symlink
ln -s %{_libexecdir}/scid/scid  %{buildroot}%{_bindir}/scid

%files
%license COPYING
%doc ChangeLog
%{_libexecdir}/scid/
%{_datadir}/applications/scid.desktop
%{_datadir}/pixmaps/scid.png
%{_bindir}/*
%{_mandir}/man6/scid*

%changelog
openSUSE Build Service is sponsored by