92cf925
%global major 0
92cf925
%global libname lib%{name}
92cf925
%global develname lib%{name}-devel
92cf925
92cf925
Name: freecell-solver
867fbe0
Version: 5.12.0
867fbe0
Release: 1%{?dist}
92cf925
License: MIT
70ff5d8
Source0: https://fc-solve.shlomifish.org/downloads/fc-solve/%{name}-%{version}.tar.xz
70ff5d8
URL: https://fc-solve.shlomifish.org/
92cf925
Summary: The Freecell Solver Executable
92cf925
92cf925
BuildRequires: cmake
92cf925
BuildRequires: gcc
92cf925
BuildRequires: gcc-c++
92cf925
BuildRequires: gmp-devel
92cf925
BuildRequires: gperf
92cf925
BuildRequires: make
92cf925
BuildRequires: perl(autodie)
92cf925
BuildRequires: perl(Carp)
d6b21c2
BuildRequires: perl(CHI)
92cf925
BuildRequires: perl(Cwd)
92cf925
BuildRequires: perl(Data::Dumper)
92cf925
BuildRequires: perl(Digest::SHA)
f23db9d
BuildRequires: perl(Env::Path)
92cf925
BuildRequires: perl(File::Path)
d6b21c2
BuildRequires: perl(lib)
92cf925
BuildRequires: perl(File::Spec)
f23db9d
BuildRequires: perl(File::Which)
f23db9d
BuildRequires: perl(Games::Solitaire::Verify)
f23db9d
BuildRequires: perl(Games::Solitaire::Verify::Solution)
f23db9d
BuildRequires: perl(Inline)
f23db9d
BuildRequires: perl(Inline::C)
f23db9d
BuildRequires: perl(IPC::Open2)
92cf925
BuildRequires: perl(lib)
92cf925
BuildRequires: perl(List::MoreUtils)
f23db9d
BuildRequires: perl(Moo)
f23db9d
BuildRequires: perl(MooX)
f23db9d
BuildRequires: perl(MooX::late)
92cf925
BuildRequires: perl(parent)
92cf925
BuildRequires: perl(Path::Tiny)
f23db9d
BuildRequires: perl(Storable)
92cf925
BuildRequires: perl(strict)
f23db9d
BuildRequires: perl(String::ShellQuote)
f23db9d
# BuildRequires: perl(Task::FreecellSolver::Testing)
92cf925
BuildRequires: perl(Template)
f23db9d
BuildRequires: perl(Test::Data::Split)
f23db9d
BuildRequires: perl(Test::Data::Split::Backend::Hash)
f23db9d
BuildRequires: perl(Test::Data::Split::Backend::ValidateHash)
f23db9d
BuildRequires: perl(Test::Differences)
f23db9d
BuildRequires: perl(Test::More)
f23db9d
BuildRequires: perl(Test::RunValgrind)
f23db9d
BuildRequires: perl(Test::TrailingSpace)
f23db9d
BuildRequires: perl(Test::Trap)
92cf925
BuildRequires: perl(warnings)
f23db9d
BuildRequires: perl(YAML::XS)
92cf925
BuildRequires: perl-devel
2f7e130
BuildRequires: pkgconfig(cmocka)
f23db9d
BuildRequires: python3-cffi
867fbe0
BuildRequires: python3-freecell_solver
92590a7
BuildRequires: python3-pysol-cards
92cf925
BuildRequires: python3-random2
92cf925
BuildRequires: python3-rpm-macros
92cf925
BuildRequires: python3dist(six)
f23db9d
BuildRequires: python3dist(pycotap)
92cf925
Requires: %{libname}%{?_isa} = %{version}-%{release}
f23db9d
# BuildRequires: tap-devel
f23db9d
BuildRequires: the_silver_searcher
f23db9d
BuildRequires: valgrind
92cf925
92cf925
%description
92cf925
The Freecell Solver package contains the fc-solve executable which is
92cf925
a command-line program that can be used to solve games of Freecell and
92cf925
similar card solitaire variants.
92cf925
92cf925
This package also contains command line executables to generate the initial
92cf925
boards of several popular Freecell implementations.
92cf925
92cf925
%files
92cf925
%{_bindir}/fc-solve
92cf925
%{_bindir}/find-freecell-deal-index.py
92cf925
%{_bindir}/freecell-solver-fc-pro-range-solve
92cf925
%{_bindir}/freecell-solver-multi-thread-solve
92cf925
%{_bindir}/freecell-solver-range-parallel-solve
92cf925
%{_bindir}/gen-multiple-pysol-layouts
92cf925
%{_bindir}/make_pysol_freecell_board.py
92cf925
%{_bindir}/pi-make-microsoft-freecell-board
92cf925
%{_bindir}/transpose-freecell-board.py
92cf925
%{_mandir}/*/*
92cf925
%{_docdir}/*
92cf925
92cf925
#--------------------------------------------------------------------
92cf925
92cf925
%package -n %{libname}
92cf925
Summary: The Freecell Solver dynamic libraries for solving Freecell games
92cf925
Requires: %{name}-data = %{version}-%{release}
92cf925
92cf925
%description -n %{libname}
92cf925
Contains the Freecell Solver libraries that are used by some programs to solve
92cf925
games of Freecell and similar variants of card solitaire.
92cf925
92cf925
This package is mandatory for the Freecell Solver executable too.
92cf925
92cf925
%files -n %{libname}
92cf925
%doc COPYING.asciidoc
92cf925
%{_libdir}/libfreecell-solver.so.%{major}{,.*}
92cf925
92cf925
#--------------------------------------------------------------------
92cf925
92cf925
%package -n %{name}-data
92cf925
Summary: The Freecell Solver data files
92cf925
BuildArch: noarch
92cf925
%description -n %{name}-data
92cf925
These are the presets for Freecell Solver
92cf925
92cf925
%files -n %{name}-data
92cf925
%{_datadir}/freecell-solver/
92cf925
%{python3_sitelib}/fc_solve_find_index_s2ints{.py,.pyc,.pyo}
92cf925
%{python3_sitelib}/__pycache__/*
92cf925
92cf925
#--------------------------------------------------------------------
92cf925
92cf925
%package -n %{develname}
92cf925
Summary: The Freecell Solver development tools for solving Freecell games
92cf925
Requires: %{libname}%{?_isa} = %{version}-%{release}
92cf925
Provides: %{name}-devel = %{version}-%{release}
92cf925
Provides: %{name}-devel%{?_isa} = %{version}-%{release}
92cf925
92cf925
%description -n %{develname}
92cf925
Freecell Solver is a library for automatically solving boards of Freecell and
92cf925
similar variants of card Solitaire. This package contains the header files and
92cf925
static libraries necessary for developing programs using Freecell Solver.
92cf925
92cf925
You should install it if you are a game developer who would like to use
92cf925
Freecell Solver from within your programs.
92cf925
92cf925
%files -n %{develname}
92cf925
%{_includedir}/freecell-solver/
92cf925
%{_includedir}/freecell-solver/*.h
92cf925
%{_libdir}/pkgconfig/*.pc
92cf925
%{_libdir}/libfreecell-solver.so
92cf925
92cf925
#--------------------------------------------------------------------
92cf925
92cf925
%prep
92cf925
%setup -q
92cf925
92cf925
%build
92cf925
# The game limit flags are recommended by the PySolFC README.
867fbe0
%cmake -DLOCALE_INSTALL_DIR=%{_datadir}/locale -DLIB_INSTALL_DIR=%{_libdir} -DMAX_NUM_FREECELLS=8 -DMAX_NUM_STACKS=20 -DMAX_NUM_INITIAL_CARDS_IN_A_STACK=60 -DDISABLE_APPLYING_RPATH=TRUE
92cf925
%make_build
92cf925
f23db9d
%check
f23db9d
%__rm -f t/t/tidyall.t
f23db9d
perl ./run-tests.pl
f23db9d
92cf925
%install
92cf925
%make_install
92cf925
bn="fc_solve_find_index_s2ints.py"
92cf925
dest="%{buildroot}/%{python3_sitelib}"
92cf925
src="%{buildroot}/%{_bindir}/$bn"
92cf925
mkdir -p "$dest"
92cf925
%__perl -0777 -p -e 's=\A#!/usr/bin/env python3\r?\n==' < "$src" > "$dest"/"$bn"
92cf925
rm -f "$src"
92cf925
chmod a-x "$dest/$bn"
92cf925
92cf925
# Delete static libraries
92cf925
find %{buildroot} -name *.a -delete
92cf925
92cf925
%changelog
3a3f069
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.10.0-2
3a3f069
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
3a3f069
0959519
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-2
0959519
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0959519
c708c35
* Fri Oct 19 2018 Shlomi Fish <shlomif@shlomifish.org> - 5.0.0-1
92cf925
- Adapted from the Mageia .spec.