File CubaLetra.spec of Package CubaLetra
#
# spec file for package CubaLetra
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2014 B1 Systems GmbH, Vohburg, Germany.
#
# 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: CubaLetra
Version: 1.0
Release: 0
Summary: Cuba Letra is a new type of word game
License: GPL-3.0-only AND CC-BY-SA-3.0
Group: Amusements/Games/Board/Other
URL: https://tweeler.com/index.php?PAGE=cubaletra_linux
# Downloaded from http://www.tweeler.com/CubaLetra_1.0_src.tar.gz
# Repacked as .tar.bz2 with proper directory name
Source: %{name}-%{version}.tar.bz2
Source1: %{name}.desktop
# PATCH-FIX-UPSTREAM CubaLetra-fix-unneded-libs.patch -- Fix linker command for libtuxcap and remove unneeded libs
Patch0: CubaLetra-fix-unneded-libs.patch
# PATCH-FIX-UPSTREAM CubaLetra-CMakeLists-fix.patch -- Do proper lookup of tuxcap devel dependencies which uses SDL2 now
Patch1: CubaLetra-CMakeLists-fix.patch
BuildRequires: cmake
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libtuxcap-devel
BuildRequires: python-rpm-macros
BuildRequires: python3-devel
%description
Cuba Letra is a new type of word game with a fun and funky Latin American theme!
It combines mental and physical dexterity to challenge players ability to make words against the clock.
It’s great fun for all ages with an easy mode that children can play or a harder mode that will challenge even the most literate adults.
%prep
%autosetup -p1
sed -i -e "s|SetAppResourceFolder.*|app.SetAppResourceFolder(\"%{_datadir}/%{name}\");|g" src/main.cpp
# fix end-of-line
find -name "*.txt" -o -name "*,fif" -exec dos2unix "{}" "+"
dos2unix README
# remove useless executable bits on data files
find data -type f -exec chmod 0644 "{}" "+"
%build
%cmake
%make_build
cd ..
%{py3_compile src}
%install
install -s -D -m 0755 build/%{name} %{buildroot}%{_bindir}/%{name}
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -a data/* %{buildroot}%{_datadir}/%{name}
cp -a src/__pycache__ %{buildroot}%{_datadir}/%{name}
install -D %{SOURCE1} %{buildroot}/%{_datadir}/applications/%{name}.desktop
install -d -D %{buildroot}/%{_datadir}/pixmaps/
ln -s %{_datadir}/%{name}/res/werdzIcon.png %{buildroot}/%{_datadir}/pixmaps/%{name}.png
%fdupes %{buildroot}%{_datadir}/%{name}
%files
%license license
%doc README other_licenses/
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%changelog