File vcmi.spec of Package VCMI

#
# spec file for package vcmi
#
# Copyright (c) 2023 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/
#


%define boost_version 1.85.0
Name:               vcmi
Version:            0.99
Release:            2%{?dist}
Summary:            Rewrite of the Heroes of Might and Magic 3 engine
License:            GPLv2+
													
								
Source:             https://github.com/vcmi/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
##aPatch0:             vcmi-0.99-boost_compatibility.patch
URL:                http://forum.vcmi.eu/portal.php

BuildRequires:  cmake >= 3.16.0
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  libboost_atomic-devel >= %{boost_version}
BuildRequires:  libboost_chrono-devel >= %{boost_version}
BuildRequires:  libboost_filesystem-devel >= %{boost_version}
BuildRequires:  libboost_locale-devel >= %{boost_version}
BuildRequires:  libboost_program_options-devel >= %{boost_version}
BuildRequires:  libboost_thread-devel >= %{boost_version}
BuildRequires:  libboost_iostreams-devel >= %{boost_version}
# fix building for Tumbleweed with gcc14
BuildRequires:  libquadmath-devel

BuildRequires:  libqt5-linguist-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(SDL2_image)
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(SDL2_ttf)
BuildRequires:  pkgconfig(fuzzylite) >= 6
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libswscale)
BuildRequires:  pkgconfig(minizip)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(tbb) >= 2021.8.0
BuildRequires:  pkgconfig(zlib)
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
BuildRequires:  gcc11
BuildRequires:  gcc11-c++
%else
BuildRequires:  gcc-c++
%endif
Recommends:     ffmpeg
Recommends:     innoextract

%description
The purpose of VCMI project is to rewrite entire HOMM 3: WoG engine from
scratch, giving it new and extended possibilities. It will help to support
mods and new towns already made by fans but abandoned because of game code
limitations.

In its current state it already supports maps of any sizes, higher
resolutions and extended engine limits.

%prep
%setup -q

dos2unix \
    ChangeLog.md \
    license.txt
find docs -type f -exec dos2unix {} +

%build
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
export CC="gcc-11"
export CXX="g++-11"
%endif
%cmake \
  -DCMAKE_INSTALL_PREFIX='/usr' \
  -DCMAKE_INSTALL_LIBDIR="%{_lib}" \
  -DENABLE_TEST=OFF #\
#  -DCMAKE_SKIP_RPATH='FALSE' \
#  -DFORCE_BUNDLED_FL=OFF \
#  -DCMAKE_BUILD_TYPE='RelWithDebInfo'
%cmake_build

%install
%cmake_install
# we disable rpath, so we need to put libvcmi.so in library path.
mv %{buildroot}%{_libdir}/%{name}/lib%{name}.so %{buildroot}%{_libdir}/
%fdupes %{buildroot}%{_datadir}

# drop fuzzylite artifacts
rm -fr %{buildroot}%{_includedir}
rm -f %{buildroot}%{_libdir}/*.a

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%license license.txt
%doc ChangeLog.md docs
%{_bindir}/vcmibuilder
%{_bindir}/vcmiclient
%{_bindir}/vcmieditor
%{_bindir}/vcmilauncher
%{_bindir}/vcmiserver
%{_libdir}/lib%{name}.so
%{_libdir}/%{name}/
%{_datadir}/%{name}/
%{_datadir}/applications/*
%{_datadir}/icons/*
%{_datadir}/metainfo/eu.vcmi.VCMI.metainfo.xml

%changelog
* Wed May 15 2024 - 
- Update spec file, update boost version and add iostream
- Update to 1.5.0+ git

* Wed Dec 13 2023 - 
- Update spec file to compile (from games repo)
- Update to 1.4.1 git

* Fri Feb 17 2017 - 0.99-2
- Common spec for openSUSE and Fedora

* Tue Nov 01 2016 VCMI - 0.99-1
- New upstream release

* Wed Apr 01 2015 VCMI - 0.98-1
- New upstream release

* Sun Nov 02 2014 VCMI - 0.97-1
- New upstream release

* Tue Jul 01 2014 VCMI - 0.96-1
- New upstream release

* Sat Mar 01 2014 VCMI - 0.95-1
- New upstream release

* Wed Oct 02 2013 VCMI - 0.94-1
- New upstream release

* Sun Jun 02 2013 VCMI - 0.93-1
- New upstream release

* Wed Mar 06 2013 VCMI - 0.92-1
- New upstream release

* Fri Feb 01 2013 VCMI - 0.91-2
- New upstream release

* Wed Jan 30 2013 VCMI - 0.91-1
- Development release

* Sun Oct 21 2012 VCMI - 0.90-2
- Second release of 0.90, Fixed battles crash

* Sat Oct 06 2012 VCMI - 0.90-1
- New upstream release

* Fri Jun 08 2012 VCMI - 0.89-1
- Initial version
openSUSE Build Service is sponsored by