Blame freecell-solver.spec

92cf925
%global major 0
92cf925
%global libname lib%{name}
92cf925
%global develname lib%{name}-devel
92cf925
92cf925
Name: freecell-solver
92cf925
Version: 5.0.0
92cf925
Release: 1%{?dist}
92cf925
License: MIT
92cf925
Source0: http://fc-solve.shlomifish.org/downloads/fc-solve/%{name}-%{version}.tar.xz
92cf925
Patch1: freecell-solver-no-rpath.diff
92cf925
URL: http://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(lib)
92cf925
BuildRequires: perl(Carp)
92cf925
BuildRequires: perl(Cwd)
92cf925
BuildRequires: perl(Data::Dumper)
92cf925
BuildRequires: perl(Digest::SHA)
92cf925
BuildRequires: perl(File::Path)
92cf925
BuildRequires: perl(File::Spec)
92cf925
BuildRequires: perl(lib)
92cf925
BuildRequires: perl(List::MoreUtils)
92cf925
BuildRequires: perl(parent)
92cf925
BuildRequires: perl(Path::Tiny)
92cf925
BuildRequires: perl(strict)
92cf925
BuildRequires: perl(Template)
92cf925
BuildRequires: perl(warnings)
92cf925
BuildRequires: perl-devel
92cf925
BuildRequires: python3-random2
92cf925
BuildRequires: python3-rpm-macros
92cf925
BuildRequires: python3dist(six)
92cf925
Requires: %{libname}%{?_isa} = %{version}-%{release}
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
%patch1 -p1 -b .rem-rpath
92cf925
92cf925
%build
92cf925
# The game limit flags are recommended by the PySolFC README.
92cf925
%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 -DFCS_WITH_TEST_SUITE=OFF
92cf925
%make_build
92cf925
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
c708c35
* Fri Oct 19 2018 Shlomi Fish <shlomif@shlomifish.org> - 5.0.0-1
92cf925
- Adapted from the Mageia .spec.