File ufoai-maps.spec of Package ufoai

#
# spec file
#
# 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 need_build 1
%define build_tar_ball 1
%define game ufoai
Name:           %{game}-maps
Version:        2.5+git20230421.7c4ccd5f9d
Release:        0
Summary:        UFO:AI - maps pack
License:        GPL-2.0-or-later
Group:          Amusements/Games/Strategy/Turn Based
URL:            https://ufoai.org/
%if %{build_tar_ball}
Source0:        %{game}-%{version}.tar.bz2
%else
Source0:        _service
%endif
BuildRequires:  %{game}-devel
BuildArch:      noarch
%if !%{need_build}
BuildRequires:  do_not_build
%endif
BuildRequires:  zip

%description
UFO: ALIEN INVASION is a strategy game featuring tactical combat
against hostile alien forces which are about to infiltrate earth at
this very moment.
This is the maps for UFO:AI. It is mandatory to local play or server
installation.

%prep
%if %{build_tar_ball}
%setup -q -n %{game}-%{version}
%else
%setup -q -n %_sourcedir/%game-%version -T -D
%endif

%build
# not an autoconf-style configure
./configure --prefix=%{_prefix} \
            --bindir=%{_bindir} \
            --datadir=%{_datadir}/%{name} \
            --libdir=%{_libdir}/%{name} \
            --localedir=%{_datarootdir}/locale \
            --disable-uforadiant \
            --disable-testall \
%ifarch x86_64 i586
            --enable-sse \
%endif
            --enable-release
%make_build
%make_build maps
%make_build pk3 PAK_FILES="0maps.pk3"

%install
install -D -m 0664 -t %{buildroot}%{_datadir}/%{game}/base base/0maps.pk3

%files
%dir %{_datadir}/%{game}
%dir %{_datadir}/%{game}/base
%{_datadir}/%{game}/base/0maps.pk3

%changelog
openSUSE Build Service is sponsored by