File stockfish_x86_64.spec of Package stockfish

#
# spec file for package stockfish
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#

%define nnuenet nn-5af11540bbfe.nnue
Name:           stockfish
Version:        15
Release:        0
Summary:        UCI chess engine
License:        GPL-3.0-or-later
URL:            https://stockfishchess.org
Source0:        %{name}-%{version}.tar.xz
Source1:        https://tests.stockfishchess.org/api/nn/%{nnuenet}
#Patch0:         date.patch
BuildRequires:  gcc-c++
BuildRequires:  curl
ExclusiveArch:  x86_64

%description
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-avx512
Summary:        UCI chess engine

%description -n stockfish-avx512
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-bmi2
Summary:        UCI chess engine

%description -n stockfish-bmi2
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-avx2
Summary:        UCI chess engine

%description -n stockfish-avx2
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-sse41-popcnt
Summary:        UCI chess engine

%description -n stockfish-sse41-popcnt
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-modern
Summary:        UCI chess engine

%description -n stockfish-modern
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-ssse3
Summary:        UCI chess engine

%description -n stockfish-ssse3
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%package -n stockfish-general
Summary:        UCI chess engine

%description -n stockfish-general
Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. 
Stockfish is not a complete chess program and requires a UCI-compatible graphical 
user interface (GUI) (e.g. XBoard with PolyGlot, Scid, Cute Chess, eboard, Arena, 
Sigma Chess, Shredder, Chess Partner or Fritz) in order to be used comfortably. 
Read the documentation for your GUI of choice for information about how to use 
Stockfish with it.

%prep
%autosetup -p1
cp %{SOURCE1} src/

%build
cd src/
make %{?_smp_mflags} profile-build ARCH=x86-64-avx512
mv stockfish stockfish-avx512
make clean
make %{?_smp_mflags} profile-build ARCH=x86-64-bmi2
mv stockfish stockfish-bmi2
make clean
make %{?_smp_mflags} profile-build ARCH=x86-64-avx2
mv stockfish stockfish-avx2
make clean
make %{?_smp_mflags} profile-build ARCH=x86-64-sse41-popcnt
mv stockfish stockfish-sse41-popcnt
make clean
make %{?_smp_mflags} profile-build ARCH=x86-64-modern
mv stockfish stockfish-modern
make clean
make %{?_smp_mflags} profile-build ARCH=x86-64-ssse3
mv stockfish stockfish-ssse3
make clean
make %{?_smp_mflags} profile-build ARCH=general-64
mv stockfish stockfish-general
make clean
make %{?_smp_mflags} profile-build ARCH=x86-64


%install
mkdir -p %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-avx512 %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-bmi2 %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-avx2 %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-sse41-popcnt %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-modern %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-ssse3 %{buildroot}%{_bindir}
install -m 755 -p src/%{name}-general %{buildroot}%{_bindir}
install -m 755 -p src/%{name} %{buildroot}%{_bindir}

%files
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}

%files -n stockfish-avx512
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-avx512

%files -n stockfish-bmi2
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-bmi2

%files -n stockfish-avx2
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-avx2

%files -n stockfish-sse41-popcnt
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-sse41-popcnt

%files -n stockfish-modern
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-modern

%files -n stockfish-ssse3
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-ssse3

%files -n stockfish-general
%license Copying.txt
%doc AUTHORS README.md
%{_bindir}/%{name}-general

%changelog
openSUSE Build Service is sponsored by