File 2h4u.spec of Package 2h4u
#
# spec file for package 2h4u
#
# Copyright (c) 2025 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/
#
Name: 2h4u
Version: 1.3
Release: 0
Summary: Too Hard For You - a mix between a Tetris-like game and a wall breaker
License: GPL-2.0-or-later
Group: Amusements/Games/Other
URL: https://sourceforge.net/projects/toohardforyou
Source: https://downloads.sourceforge.net/toohardforyou/%{name}-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE -- and PATCH-FEATURE-UPSTREAM Use system data dir (/usr/share...). Reported Upstream (E-Mail)
Patch0: %{name}-1.3-datadir.patch
# PATCH-FEATURE-UPSTREAM better-makefile.patch -- Better Makefile with install target. Reported Upstream (E-Mail)
Patch1: better-makefile.patch
# PATCH-FEATURE-UPSTREAM appdata-and-desktop.patch -- Install appdata and desktop file. Reported Upstream (E-Mail)
Patch2: appdata-and-desktop.patch
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(SDL_image)
BuildRequires: pkgconfig(SDL_mixer)
BuildRequires: pkgconfig(SDL_ttf)
BuildRequires: pkgconfig(sdl)
%description
2H4U, which stands for Too Hard For You, is an open source game, and a mix between
a Tetris-like game and a wall breaker. It requires good reflexes, coordination,
and ambidexters should have some advantages. Will 2H4U be too hard for you?
%prep
%setup -q -n 2H4U
%patch -P 0 -p1
%patch -P 1 -p1
%patch -P 2 -p1
dos2unix COPYING.txt README.txt
%build
cd scripts
%make_build CXXFLAGS="%{optflags}" PREFIX=%{_prefix} DATADIR=%{_datadir}/%{name}
%install
pushd scripts
make %{?_smp_mflags} install PREFIX=%{_prefix} DATADIR=%{_datadir}/%{name} DESTDIR=%{buildroot}
popd
# Install documentation
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -Rt %{buildroot}%{_docdir}/%{name} aide help README.txt
%fdupes %{buildroot}%{_datadir}
%files
%license COPYING.txt
%{_bindir}/2H4U
%{_datadir}/2h4u
%{_datadir}/pixmaps/*.png
%{_datadir}/applications/2H4U.desktop
%{_datadir}/appdata/2H4U.appdata.xml
%lang(en) %doc %{_docdir}/%{name}/help
%lang(en) %doc %{_docdir}/%{name}/README.txt
%lang(fr) %doc %{_docdir}/%{name}/aide
%dir %doc %{_docdir}/%{name}
%dir %{_datadir}/appdata
%changelog