fheroes2/fheroes2.spec

102 lines
3 KiB
RPMSpec
Raw Normal View History

2022-10-10 21:25:42 +03:00
%global optflags %(echo %{optflags} | sed -e 's/-ffat-lto-objects//g' -e 's/-fvar-tracking-assignments//g' -e 's/-Wa,--compress-debug-sections//g' )
2024-07-13 14:02:58 +00:00
%define llvmver llvm17
%define _llvmdir /opt/%{llvmver}
2022-06-12 19:26:58 +03:00
2012-02-02 02:15:30 +04:00
Summary: Free implementation of Heroes of the Might and Magic II engine
Name: fheroes2
Epoch: 1
2024-10-23 08:35:38 +00:00
Version: 1.1.3
2023-02-09 22:25:34 +00:00
Release: 1
License: GPLv2+
2012-02-02 02:15:30 +04:00
Group: Games/Strategy
2024-07-13 14:02:58 +00:00
URL: https://ihhub.github.io/fheroes2
Source0: https://github.com/ihhub/fheroes2/archive/%{version}.tar.gz?/%{name}-%{version}.tar.gz
2022-04-09 22:48:35 +03:00
Source1000: %{name}.rpmlintrc
Source2: fheroes2.sh
Source3: fheroes2.png
Source4: fheroes2.desktop
Source5: fheroes2.cfg
2012-10-24 20:31:19 +11:00
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)
2023-09-20 23:47:13 +00:00
BuildRequires: pkgconfig(dbus-1)
2024-07-13 14:02:58 +00:00
BuildRequires: %{llvmver}
2022-07-12 09:52:58 +03:00
BuildRequires: cmake >= 3.20
2022-12-22 10:13:00 +03:00
BuildRequires: stdc++-gcc10-devel
2012-02-02 02:15:30 +04:00
%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.
2022-12-22 10:13:00 +03:00
%files
%doc changelog.txt LICENSE README.md
2022-12-22 10:13:00 +03:00
%{_bindir}/%{name}
%{_datadir}/%{name}
2023-11-18 18:33:40 +00:00
%{_datadir}/metainfo/%{name}*.xml
2022-12-22 10:13:00 +03:00
%{_iconsdir}/hicolor/*/apps/%{name}.png
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
#----------------------------------------------------------------------------
2012-02-02 02:15:30 +04:00
%prep
%setup -q
2012-02-02 02:15:30 +04:00
%build
2024-07-13 14:21:49 +00:00
#export CC=%{_llvmdir}/bin/clang
#export CXX=%{_llvmdir}/bin/clang++
#export AR=%{_llvmdir}/bin/llvm-ar
#export NM=%{_llvmdir}/bin/llvm-nm
2024-07-13 14:09:38 +00:00
export LLD=%{_llvmdir}/bin/lld
2022-12-22 10:13:00 +03:00
export READELF=readelf
export LDFLAGS="-lstdc++-gcc10"
export CXXFLAGS="$CFLAGS"
%setup_compile_flags
2022-05-11 22:26:39 +03:00
#cmake
2024-07-13 14:09:38 +00:00
#clang_gcc_wrapper
2022-11-13 11:08:28 +03:00
2022-12-22 10:13:00 +03:00
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_SDL_VERSION=SDL2 \
-DENABLE_IMAGE=ON \
-DGET_HOMM2_DEMO=ON \
2024-07-13 14:21:49 +00:00
-DCMAKE_C_COMPILER=%{_llvmdir}/bin/clang \
-DCMAKE_CXX_COMPILER=%{_llvmdir}/bin/clang++ \
2022-12-22 10:13:00 +03:00
-DCMAKE_CXX_FLAGS="-std=c++17" \
-DCMAKE_CXX_FLAGS="-nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host} -Wc++11-narrowing " \
-DCMAKE_C_FLAGS="-nostdinc++ -I/usr/include/libstdc++-gcc10 -I/usr/include/libstdc++-gcc10/%{_host} -Wc++11-narrowing " \
-DCMAKE_INSTALL_PREFIX=%{buildroot}%{_prefix}
2022-10-10 21:25:42 +03:00
%make \
WITH_AI=simple \
2022-12-22 10:13:00 +03:00
WITH_SDL2="ON"
CONFIGURE_FHEROES2_DATA="%{_datadir}/%{name}/"
2012-02-02 02:15:30 +04:00
2012-02-02 02:15:30 +04:00
%install
2022-12-22 10:13:00 +03:00
%makeinstall -C build
# No automated install:
# 1) Create directory structure
2022-12-22 10:13:00 +03:00
#mkdir -p %{buildroot}%{_gamesbindir}
mkdir -p %{buildroot}%{_gamesdatadir}/%{name}/{data,maps}
2012-10-24 20:31:19 +11:00
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/pixmaps
2012-02-02 02:15:30 +04:00
2021-05-20 14:49:09 +02:00
# 2) install what we need where we need it
2022-12-22 10:13:00 +03:00
install -pm 644 src/resources/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
2012-10-24 20:31:19 +11:00
install -pm 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
2012-08-02 19:04:47 +00:00