File urbanterror.spec of Package urbanterror

#
# spec file for package urbanterror
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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:           urbanterror
Version:        4.3.4
Release:        0
Summary:        A team-based tactical shooter based on the Quake 3 Engine
License:        GPL-2.0-only
Group:          Amusements/Games/3D/Shoot
URL:            https://www.urbanterror.info/
Source0:        https://github.com/Barbatos/ioq3-for-UrbanTerror-4/archive/release-%{version}/ioq3-for-UrbanTerror-4-release-%{version}.tar.gz
Source1:        %{name}.png
Source2:        %{name}.desktop
# PATCH-FIX-OPENSUSE fix-i586.patch -- Fix build with i586, force msse and msse2 flags needed for asm
Patch0:         fix-i586.patch
BuildRequires:  ImageMagick
BuildRequires:  desktop-file-utils
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(sdl)
BuildRequires:  pkgconfig(xxf86vm)
Recommends:     urbanterror-data = %{version}

%description
Urban Terror can be described as a Hollywood tactical shooter;
somewhat realism based, but the motto is "fun over realism"
which results in a very unique, enjoyable and addictive game.

This package contains only the engine including the dedicated server.

%prep
%setup -q -n ioq3-for-UrbanTerror-4-release-%{version}
%patch -P 0 -p1

%build
# -fno-lto added to workaround a segfault
# https://bugzilla.opensuse.org/show_bug.cgi?id=1183253
# https://bugzilla.opensuse.org/show_bug.cgi?id=1183104
CFLAGS="${CFLAGS:-%{optflags} -fno-lto}"; export CFLAGS
CXXFLAGS="${CXXFLAGS:-%{optflags} -fno-lto}"; export CXXFLAGS
%make_build \
     USE_OPENAL_DLOPEN=0 \
     USE_CURL_DLOPEN=0 \
     USE_LOCAL_HEADERS=0 \
     DEFAULT_BASEDIR=%{_datadir}/urbanterror \
     V=1

%install
mkdir -p %{buildroot}%{_datadir}
make copyfiles COPYDIR=%{buildroot}%{_datadir} NO_STRIP=1
mkdir -p %{buildroot}%{_bindir}
mv %{buildroot}%{_datadir}/Quake3-UrT-Ded.* %{buildroot}%{_bindir}/urbanterror-server
mv %{buildroot}%{_datadir}/Quake3-UrT.* %{buildroot}%{_bindir}/urbanterror
install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/applications/urbanterror.desktop
install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/512x512/apps/%{name}.png
for size in 256 64 128 32; do
	mkdir -p %{buildroot}%{_datadir}/icons/hicolor/$size"x$size/apps"
	convert -strip %{SOURCE1} -resize "$size"x"$size" %{buildroot}%{_datadir}/icons/hicolor/$size"x$size/apps/%{name}.png"
done

%files
%license COPYING.txt
%doc ChangeLog README id-readme.txt ioUrbanTerror_README.txt md4-readme.txt
%{_bindir}/%{name}
%{_bindir}/%{name}-server
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by