File smokin-guns.spec of Package smokin-guns
#
# spec file for package smokin-guns
#
# 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: smokin-guns
Version: 1.1
Release: 0
Summary: Western style shooter based on the Quake 3 Engine
License: GPL-2.0-only
Group: Amusements/Games/3D/Shoot
URL: http://www.smokin-guns.org
Source0: SmokinGuns-%{version}.tar.bz2
Source1: sg_48.png
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0: smokin-guns-1.1-no_date.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1: smokin-guns-1.1-x86_64.patch
Patch2: pointer-types.patch
BuildRequires: dos2unix
BuildRequires: hicolor-icon-theme
BuildRequires: libjpeg8-devel
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(sdl)
BuildRequires: pkgconfig(speex)
BuildRequires: pkgconfig(speexdsp)
BuildRequires: pkgconfig(zlib)
Requires: smokin-guns-data = %{version}
%description
Smokin' Guns is intended to be a recreation of the "Old West's" great atmosphere. It is being developed on IoQ3's implementation of Id Softwares IdTECH3 engine. This Total Conversion of Q3 includes weapons created with historically correct information about damage, rate of fire, reload time, etc. It also includes gametypes and maps inspired mostly from western styled movies. And to increase the feeling of a "Gunslingers Atmosphere" music tracks and sounds have been adapted to the simulated times. The Smokin' Guns game started its life under the name of Western Quake³.
%prep
%setup -q -n SmokinGuns-%{version}
%patch -P 0
%ifarch x86_64
%patch -P 1
rm code/asm/ftola.s
rm code/asm/snapvectora.s
%endif
%patch -P 2 -p1
sed -i 's/^copyfiles: release$/copyfiles:/' Makefile
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" code/game/g_main.c code/sys/sys_main.c code/qcommon/common.c
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M:%%S')
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/" code/game/g_main.c code/sys/sys_main.c code/cgame/cg_main.c code/ui/ui_main.c
dos2unix README.txt
%build
CFLAGS="${CFLAGS:-%{optflags}}"; export CFLAGS
CXXFLAGS="${CXXFLAGS:-%{optflags}}"; export CXXFLAGS
TOOLS_CFLAGS="-std=gnu11" ; export TOOLS_CFLAGS
make %{?_smp_mflags} \
USE_OPENAL_DLOPEN=0 \
USE_CURL_DLOPEN=0 \
USE_INTERNAL_SPEEX=0 \
USE_INTERNAL_ZLIB=0 \
USE_INTERNAL_JPEG=0 \
USE_LOCAL_HEADERS=0 \
DEFAULT_BASEDIR=%{_datadir}/smokin-guns \
V=1
%install
# Such a nice build system...
mkdir -p %{buildroot}%{_bindir}
make copyfiles COPYBINDIR=%{buildroot}%{_bindir} COPYDIR=%{buildroot}%{_datadir} NO_STRIP=1
mv %{buildroot}%{_bindir}/smokinguns.* %{buildroot}%{_bindir}/smokinguns
mv %{buildroot}%{_bindir}/smokinguns_dedicated.* %{buildroot}%{_bindir}/smokinguns_dedicated
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
cp -p %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/smokinguns.png
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/
cp -p misc/smokinguns.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/smokinguns.png
mkdir -p %{buildroot}%{_datadir}/applications/
cat >> %{buildroot}%{_datadir}/applications/smokinguns.desktop <<EOF
[Desktop Entry]
Categories=Game;ActionGame;
Name=Smokin Guns
GenericName=Western FPS
Type=Application
Exec=smokinguns
Icon=smokinguns
EOF
%post
%icon_theme_cache_post
%postun
%icon_theme_cache_postun
%files
%defattr(-,root,root,-)
%doc BUGS ChangeLog COPYING.txt id-readme.txt NOTTODO README README.txt SG_TODO TODO Unlagged.txt voip-readme.txt
%{_bindir}/*
%{_datadir}/smokinguns/
%{_datadir}/icons/hicolor/*/apps/smokinguns.png
%{_datadir}/applications/smokinguns.desktop
%changelog