File supertux2.spec of Package supertux2

Name:           supertux2
Version:        0.7.0
Release:        0
Summary:        Classic 2D jump'n run sidescroller game
License:        GPL-3.0-or-later
Group:          Amusements/Games/Action/Arcade
URL:            https://www.supertux.org/
Source:         https://github.com/SuperTux/supertux/releases/download/v%{version}/SuperTux-v%{version}-Source.tar.gz
Requires:       libSDL2_ttf-2_0-0
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(SDL2_image)
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(SDL2_ttf)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(glew)
BuildRequires:  boost-devel
BuildRequires:  pkgconfig(physfs)
BuildRequires:  pkgconfig(fmt)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(glm)
BuildRequires:   pkgconfig(freetype2)
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(SDL2_image)
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(SDL2_ttf)
BuildRequires:  pkgconfig(physfs)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(glew)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(ogg)
BuildRequires:  pkgconfig(fmt)
BuildRequires:  boost-devel
BuildRequires:  pkgconfig(openal)
BuildRequires:  update-desktop-files
BuildRequires:  hicolor-icon-theme
%description
SuperTux is a classic 2D jump'n run sidescroller game in a style similar to the original Super Mario games.

%prep
%setup -q -n SuperTux-v%{version}-Source
# Forzar a CMake a buscar la versión específica de la librería en openSUSE
%build
%cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DINSTALL_SUBDIR_BIN=bin \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DINSTALL_SUBDIR_SHARE=share/supertux2
%cmake_build

%install
%cmake_install

# EL ARREGLO MAESTRO:
# Si el binario quedó en /usr/games, lo movemos a /usr/bin de verdad.
# Si ya está en /usr/bin, el comando fallará silenciosamente o no hará nada.
mkdir -p %{buildroot}%{_bindir}
if [ -f %{buildroot}/usr/games/supertux2 ]; then
    mv %{buildroot}/usr/games/supertux2 %{buildroot}%{_bindir}/supertux2
fi

# Borramos cualquier intento de enlace simbólico manual que de error
# El binario ya estará físicamente en /usr/bin
%files
%license LICENSE.txt
# El binario ahora vive aquí:
%{_bindir}/supertux2

# Los datos (niveles, música, etc.) ahora están aquí:
%{_datadir}/supertux2/
%{_libdir}/libsimplesquirrel.so
# El resto de integraciones:
%{_datadir}/applications/supertux2.desktop
%{_datadir}/metainfo/org.supertuxproject.SuperTux.metainfo.xml
%{_datadir}/icons/hicolor/scalable/apps/supertux2.svg
%{_datadir}/pixmaps/supertux.png
%{_datadir}/pixmaps/supertux.xpm

# Si CMake generó docs, déjalos, si no, puedes comentar esta línea
%doc %{_datadir}/doc/supertux2/
%changelog
openSUSE Build Service is sponsored by