fheroes2/fheroes2.spec
2022-06-12 18:47:45 +03:00

69 lines
2.1 KiB
RPMSpec

Summary: Free implementation of Heroes of the Might and Magic II engine
Name: fheroes2
Epoch: 1
Version: 0.9.16
Release: 1
License: GPLv2+
Group: Games/Strategy
URL: https://ihhub.github.io/fheroes2/
Source0: https://github.com/ihhub/fheroes2/archive/refs/tags/%{version}.tar.gz?/%{name}-%{version}.tar.gz
Source1000: %{name}.rpmlintrc
Source2: fheroes2.sh
Source3: fheroes2.png
Source4: fheroes2.desktop
Source5: fheroes2.cfg
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(SDL2_image)
BuildRequires: pkgconfig(SDL2_mixer)
BuildRequires: pkgconfig(SDL2_net)
BuildRequires: pkgconfig(SDL2_ttf)
BuildRequires: pkgconfig(zlib)
BuildRequires: clang
BuildRequires: cmake
%description
Free implementation of Heroes of the Might and Magic II engine.
You need to copy files from data and maps directories from original game
into your /usr/share/games/fheroes2/{maps,data} directories respectively.
%files
%doc changelog.txt LICENSE README.md
%{_gamesbindir}/*
%{_gamesdatadir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
#----------------------------------------------------------------------------
%prep
%setup -q
%build
%setup_compile_flags
#cmake
export CXX=clang++
export CC=clang
%make \
WITH_AI=simple \
WITH_SDL2="ON" \
CONFIGURE_FHEROES2_DATA="%{_gamesdatadir}/%{name}/"
%install
# No automated install:
# 1) Create directory structure
mkdir -p %{buildroot}%{_gamesbindir}
mkdir -p %{buildroot}%{_gamesdatadir}/%{name}/{data,maps}
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/pixmaps
# 2) install what we need where we need it
install -pm 755 src/dist/%{name} %{buildroot}%{_gamesbindir}/%{name}.bin
install -pm 755 %{SOURCE2} %{buildroot}%{_gamesbindir}/%{name}
#install -pm 644 %{name}.key %{buildroot}%{_gamesdatadir}/%{name}/
install -pm 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -pm 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
install -pm 644 %{SOURCE5} %{buildroot}%{_gamesdatadir}/%{name}/