File asc.spec of Package asc
#
# spec file for package asc
#
# 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/
#
Name: asc
Version: 2.8.1.0+git.20220116
Release: 0
Summary: Advanced Strategic Command--Turn-Based Strategy Game
License: GPL-2.0-or-later
Group: Amusements/Games/Strategy/Turn Based
URL: http://asc-hq.org/
Source: %{name}-%{version}.tar.xz
Source1: %{name}.desktop
Source10: https://www.asc-hq.org/music/frontiers.ogg
Source11: https://www.asc-hq.org/music/time_to_strike.ogg
Source12: https://www.asc-hq.org/music/machine_wars.ogg
# PATCH-FIX-OPENSUSE asc-datadir.patch
Patch0: %{name}-datadir.patch
BuildRequires: SDL-devel
BuildRequires: SDL_image-devel
BuildRequires: SDL_mixer-devel
BuildRequires: SDL_sound-devel
BuildRequires: SDLmm-devel
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: libboost_headers-devel
BuildRequires: libboost_regex-devel
BuildRequires: libbz2-devel
BuildRequires: libexpat-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: lua-devel
BuildRequires: physfs-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: wxWidgets-devel
BuildRequires: zip
BuildRequires: pkgconfig(sigc++-2.0)
# Fix for: Failed loading SDL2 library on openSUSE Leap
%if 0%{?suse_version} <= 1500
BuildRequires: pkgconfig(sdl2)
%endif
%description
ASC is a free, turn-based strategy game in the tradition of Battle
Isle. It features both single player game play against an AI as well as
extensive play-by-e-mail multiplayer functionality.
%package music
Summary: Music for Advanced Strategic Command--Turn-Based Strategy Game
Group: Amusements/Games/Strategy/Turn Based
Requires: %{name}
BuildArch: noarch
%description music
ASC is a free, turn-based strategy game in the tradition of Battle
Isle. It features both single player game play against an AI as well as
extensive play-by-e-mail multiplayer functionality.
%prep
%autosetup -p1
%build
export PATH=$PATH:.
# _ISOC99_SOURCE is defined for log2. It compiles without it, but does not work
export CFLAGS="%{optflags} -DUSE_HOME_DIRECTORY=1 -D_ISOC99_SOURCE -D_GNU_SOURCE"
export CXXFLAGS="$CFLAGS -std=c++11 -fpermissive"
%configure \
--disable-sdltest \
--disable-vorbistest
%make_build
%install
%make_install
install -vdm755 %{buildroot}%{_datadir}/asc/music/
install -vm644 %{SOURCE10} %{SOURCE11} %{SOURCE12} %{buildroot}%{_datadir}/asc/music/
%suse_update_desktop_file -i %{name} Game StrategyGame
%files
%doc AUTHORS ChangeLog README TODO
%license COPYING
%{_bindir}/asc*
%{_datadir}/asc
%exclude %{_datadir}/asc/music
%{_mandir}/man6/asc*.6%{?ext_man}
%{_datadir}/appdata/asc.appdata.xml
%{_datadir}/applications/asc.desktop
%files music
%{_datadir}/asc/music/
%changelog