File bitfighter.spec of Package bitfighter
#
# spec file for package bitfighter
#
# 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: bitfighter
Version: 022
Release: 0
Summary: A 2-D multi-player space combat game
License: GPL-2.0-only
Group: Amusements/Games/Action/Arcade
URL: https://bitfighter.org/
Source: %{name}-%{version}.tar.gz
Source99: %{name}.changes
BuildRequires: alure-devel
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libmodplug-devel
BuildRequires: libmysqlclient-devel
BuildRequires: libpng-devel
BuildRequires: libvorbis-devel
BuildRequires: openal-soft-devel
BuildRequires: pkgconfig
BuildRequires: speex-devel
BuildRequires: sqlite3-devel
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(sdl2)
BuildRequires: libtomcrypt-devel
# Use internal LuaJIT for tumbleweed
%if 0%{?suse_version} >= 1600
%else
BuildRequires: lua51-luajit-devel
%endif
%description
Bitfighter is a free 2-D multi-player space combat game. It's a team-based strategy game
featuring retro vector graphics and customizable ships. It's fast, fun, and frenetic.
%prep
%setup -q
# Fix __DATE__ and __TIME__ usage
modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
TIME="\"$(date -d "${modified}" "+%%R")\""
sed -i "s/__DATE__/${DATE}/g;s/__TIME__/${TIME}/g" zap/UIDiagnostics.cpp tomcrypt/src/misc/crypt/crypt.c
%build
%ifarch ppc64
%cmake -DMASTER_MINIMAL=1 -DLUAJIT_DISABLE_JIT=1 -DBUILD_SHARED_LIBS=0
%else
%cmake -DMASTER_MINIMAL=1 -DBUILD_SHARED_LIBS=0
%endif
%make_build bitfighter
%install
%cmake_install
# Clean up old python bitfighter_notifier
rm %{buildroot}%{_bindir}/bitfighter_notifier
%suse_update_desktop_file %{name}
%fdupes %{buildroot}%{_datadir}/%{name}
%files
%license LICENSE.txt
%doc doc/README.txt
%{_mandir}/man6/%{name}.6%{?ext_man}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_bindir}/%{name}
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%changelog