1 |
%define basen black-hole-solver |
2 |
%define libname_orig lib%{basen} |
3 |
%define major 1 |
4 |
%define libname %mklibname %{basen} %{major} |
5 |
%define develname %mklibname %{basen} -d |
6 |
%define staticname %mklibname %{basen} -d -s |
7 |
|
8 |
Name: %{basen} |
9 |
Version: 0.20.0 |
10 |
Release: %mkrel 2 |
11 |
License: MIT |
12 |
Group: Games/Cards |
13 |
Source0: https://fc-solve.shlomifish.org/downloads/fc-solve/%{basen}-%{version}.tar.xz |
14 |
URL: https://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/ |
15 |
Requires: %{libname} = %version-%release |
16 |
Summary: The Black Hole Solitaire Solver Executable |
17 |
BuildRequires: ack |
18 |
BuildRequires: cmake |
19 |
BuildRequires: gmp-devel |
20 |
BuildRequires: perl(Carp) |
21 |
BuildRequires: perl(Cwd) |
22 |
BuildRequires: perl(Data::Dumper) |
23 |
BuildRequires: perl(Dir::Manifest) |
24 |
BuildRequires: perl(Env::Path) |
25 |
BuildRequires: perl(File::Path) |
26 |
BuildRequires: perl(File::Spec) |
27 |
BuildRequires: perl(Inline) |
28 |
BuildRequires: perl(Inline::C) |
29 |
BuildRequires: perl(List::MoreUtils) |
30 |
BuildRequires: perl(Path::Tiny) |
31 |
BuildRequires: perl(Test::Differences) |
32 |
BuildRequires: perl(Test::More) |
33 |
BuildRequires: perl(Test::RunValgrind) |
34 |
BuildRequires: perl(Test::Trap) |
35 |
BuildRequires: perl(base) |
36 |
BuildRequires: perl(lib) |
37 |
BuildRequires: perl(strict) |
38 |
BuildRequires: perl(warnings) |
39 |
BuildRequires: perl-devel |
40 |
BuildRequires: python3 |
41 |
BuildRequires: valgrind |
42 |
|
43 |
%description |
44 |
This is a solver, written in C, to solve the Solitaire variants “Golf”, |
45 |
“Black Hole” and “All in a Row”. It provides a portable C library, and |
46 |
a command line application that after being fed with a layout will emit the |
47 |
cards to move. |
48 |
|
49 |
%files |
50 |
%doc COPYING NEWS README.md TODO.quicktask |
51 |
%_bindir/black-hole-solve |
52 |
%{_mandir}/*/* |
53 |
|
54 |
#-------------------------------------------------------------------- |
55 |
|
56 |
%package -n %{libname} |
57 |
Summary: The Black Hole Solver dynamic libraries |
58 |
Group: Games/Cards |
59 |
|
60 |
%description -n %{libname} |
61 |
Contains the Black Hole Solver libraries that are used by some programs. |
62 |
|
63 |
This package is mandatory for the Black Hole Solver executable too. |
64 |
|
65 |
%files -n %{libname} |
66 |
%{_libdir}/libblack_hole_solver.so.%{major}{,.*} |
67 |
%{_libdir}/libblack_hole_solver.so.%{major} |
68 |
|
69 |
#-------------------------------------------------------------------- |
70 |
|
71 |
%package -n %{develname} |
72 |
Summary: The Black Hole Solitaire development tools |
73 |
Group: Games/Cards |
74 |
Requires: %{libname} = %version-%release |
75 |
Provides: %{name}-devel = %{version}-%{release} |
76 |
|
77 |
%description -n %{develname} |
78 |
Development tools for the Black Hole Solitaire Solver. |
79 |
|
80 |
%files -n %{develname} |
81 |
%_includedir/black-hole-solver/*.h |
82 |
%{_libdir}/pkgconfig/*.pc |
83 |
%{_libdir}/libblack_hole_solver.so |
84 |
|
85 |
#-------------------------------------------------------------------- |
86 |
|
87 |
%package -n %{staticname} |
88 |
Summary: The Freecell Solver static libraries |
89 |
Group: Games/Cards |
90 |
Requires: %{develname} = %version-%release |
91 |
|
92 |
%description -n %{staticname} |
93 |
Black Hole Solitaire Solver is a library for automatically solving boards of |
94 |
Golf, Black Hole, and All in a Row solitaires. This package contains the static |
95 |
libraries. |
96 |
|
97 |
It is not generally required. |
98 |
|
99 |
%files -n %{staticname} |
100 |
%{_libdir}/libblack_hole_solver.a |
101 |
|
102 |
#-------------------------------------------------------------------- |
103 |
|
104 |
%prep |
105 |
%setup -q |
106 |
%autopatch -p1 |
107 |
|
108 |
%build |
109 |
# The game limit flags are recommended by the PySolFC README. |
110 |
%cmake -DLOCALE_INSTALL_DIR=%{_datadir}/locale -DLIB_INSTALL_DIR=%{_libdir} |
111 |
%make_build |
112 |
|
113 |
%check |
114 |
%ifarch %arm |
115 |
# valgrind suppression not working without glibc-debuginfo breaks it |
116 |
rm -f t/valgrind.t |
117 |
%endif |
118 |
rm -f t/clang-format.t |
119 |
rm -f t/perltidy.t |
120 |
# fails due to build containing binaries |
121 |
rm -f t/style-trailing-space.t |
122 |
cd build |
123 |
# %%make_build test |
124 |
%__perl ../run-tests.pl |
125 |
|
126 |
%install |
127 |
%{make_install} -C build |