File springlobby.spec of Package springlobby

#
# spec file for package springlobby
#
# Copyright (c) 2024 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.66.0
Name:           springlobby
Version:        0.274
Release:        0
Summary:        Lobby client for the Spring RTS project
# GPL-2.0 for springlobby and GPL-3.0+ for settings++.
License:        GPL-2.0-only AND GPL-3.0-or-later
Group:          Amusements/Games/Strategy/Real Time
URL:            https://springlobby.springrts.com/
Source:         https://springlobby.springrts.com/dl/stable/%{name}-%{version}.tar.bz2
BuildRequires:  cmake
BuildRequires:  doxygen
BuildRequires:  gettext-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  rsvg-convert
BuildRequires:  update-desktop-files
BuildRequires:  wxWidgets-3_0-devel >= 3.0.0
BuildRequires:  pkgconfig(alure)
BuildRequires:  pkgconfig(jsoncpp)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libmpg123)
BuildRequires:  pkgconfig(libnotify)
BuildRequires:  pkgconfig(libtorrent-rasterbar)
BuildRequires:  pkgconfig(minizip)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(vorbis)
# Fix for conflict for providers of libboost_headers1_75_0-devel needed by libtorrent-rasterbar-devel for openSUSE Leap 15.6
%if 0%{?sle_version} >= 150600 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
BuildRequires:  libboost_system1_75_0-devel
BuildRequires:  libboost_thread1_75_0-devel
%else
BuildRequires:  libboost_system-devel >= %{boost_version}
BuildRequires:  libboost_thread-devel >= %{boost_version}
%endif
%if 0%{?sle_version} >= 150500 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
BuildRequires:  gcc11
BuildRequires:  gcc11-c++
%else
BuildRequires:  gcc-c++
%endif
Recommends:     fluidsynth
# for compatibility with Fedora's spring package
Provides:       spring-lobby = %{version}

%description
SpringLobby is a lobby client for the Spring RTS project.
It will also download maps and mods for you.

%lang_package

%prep
%setup -q

%build
%if 0%{?sle_version} >= 150500 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
export CC="gcc-11"
export CXX="g++-11"
%endif

%cmake -DSPRINGLOBBY_UPDATER:BOOL=OFF
%make_build

%install
%cmake_install

# Fix doc and license packaging
rm -rf %{buildroot}%{_datadir}/doc/%{name}
rm -rf %{buildroot}%{_docdir}/%{name}/COPYING

# Generate Icons
pushd %{buildroot}%{_datadir}/icons/hicolor
for i in 16 24 32 48 64 96 128 256; do
    mkdir -pv ${i}x${i}/apps/
    rsvg-convert -h $i -w $i scalable/apps/%{name}.svg -o ${i}x${i}/apps/%{name}.png
done
popd

# Fix desktopfile
sed -i "s/Icon\=springlobby.svg/Icon\=springlobby/" %{buildroot}%{_datadir}/applications/%{name}.desktop

%find_lang %{name} %{no_lang_C}

%files -f %{name}.lang
%license COPYING
%doc ABOUT-NLS AUTHORS NEWS README README-Settings++ THANKS ChangeLog
%{_bindir}/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/metainfo/springlobby.appdata.xml

%changelog
openSUSE Build Service is sponsored by