File alienarena.spec of Package alienarena

#
# spec file for package alienarena
#
# Copyright (c) 2025 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:           alienarena
%define namedash alien-arena
Version:        7.71.7
Release:        0
Summary:        3D Deathmatch game
License:        GPL-2.0-or-later
Group:          Amusements/Games/3D/Shoot
URL:            https://icculus.org/alienarena/rpa/
# use alienarena-create-tarball.sh to create tarball
Source0:        %{name}-%{version}.tar.xz
Source1:        GPL.acebot.txt
Source2:        %{name}-create-tarball.sh
Source99:       %{name}.changes
Patch0:         fix-gcc15.patch
# PATCH-FIX-SUSE fix-desktop.patch -- Install and fix provided desktop file
Patch1:         fix-desktop.patch
BuildRequires:  Mesa-devel
BuildRequires:  SDL-devel
BuildRequires:  automake
BuildRequires:  curl-devel
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libvorbis-devel
BuildRequires:  openal-soft-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(x11)
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-libXext-devel
Requires:       %{name}-data = %{version}
Suggests:       %{name}-server

%description
Alien Arena 2011 is an online deathmatch game with over 30 levels, seven modes
of play, loads of mutators, built-in bots, 11 player characters, and 9 weapons
(with alt-fire modes).

%package server
Summary:        Dedicated server for alienarena, the FPS game
Group:          Amusements/Games/3D/Shoot
Requires:       %{name}-data = %{version}

%description server
Alien Arena 2011 is an online deathmatch game with over 30 levels, seven modes
of play, loads of mutators, built-in bots, 11 player characters, and 9 weapons
(with alt-fire modes).

This is the dedicated server.

%prep
%autosetup -p1

# Copy license clarification for acebot
cp -p %{SOURCE1} .

modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
find .  -name '*.[ch]' -o -name '*.cpp' | xargs sed -i "s/__DATE__/${DATE}/g"

%build
autoreconf -fiv
%if 0%{?suse_version} > 1500 
export CFLAGS="-fcommon %{optflags}"
%endif
%configure --docdir=%{_docdir}/%{name} --without-data1pkg --program-transform-name='s/crx/alienarena/'
%make_build

%install
%make_install
rm -v %{buildroot}%{_docdir}/%{name}/INSTALL

%suse_update_desktop_file -r %{namedash} Game ActionGame

%fdupes %{buildroot}%{datadir}

%files
%license GPL.acebot.txt
%doc %{_docdir}/%{name}
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{namedash}.desktop
%{_datadir}/pixmaps/%{namedash}.png

%files server
%license GPL.acebot.txt
%{_bindir}/%{name}-ded

%changelog
openSUSE Build Service is sponsored by