File warsow.spec of Package warsow

#
# spec file for package warsow
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


Name:           warsow
Version:        2.1
Release:        0
Summary:        A fast-paced first-person-shooter game
License:        GPL-2.0
Group:          Amusements/Games/3D/Shoot
Url:            http://www.warsow.gg/
Source0:        http://update.warsow.gg/mirror/warsow_21_sdk.tar.gz
Source1:        warsow.desktop
Source99:       warsow.changes
Source100:      warsow.appdata.xml
# PATCH-FIX-UPSTREAM fix-cmake.patch -- Fix Cmake files so we can use our cmake macro
Patch0:         fix-cmake.patch
# PATCH-FEATURE-OPENSUSE system-libraries.patch -- Use libraries from system instead of bundled ones
Patch1:         system-libraries.patch
BuildRequires:  ImageMagick
BuildRequires:  cmake >= 2.8.12
BuildRequires:  dos2unix
BuildRequires:  hicolor-icon-theme
BuildRequires:  libjpeg-devel
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(theora)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(xcb-xinerama)
BuildRequires:  pkgconfig(xf86dgaproto)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xxf86dga)
BuildRequires:  pkgconfig(xxf86vm)
BuildRequires:  pkgconfig(zlib)
Requires:       warsow-data = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++

%description
Warsow is a free standalone first person shooter game based on the Qfusion 3D
engine (a modification of the Quake 2 GPL engine), and aimed on the competitive
scene, or the e-sports community.

The base gameplay is focused around the art of movement; speed and tricks play
a big part in the gameplay. Besides this, mapcontrol, aim, teamplay and
fragging skills play their role too.

Another twist in gameplay is the weapon system. Warsow has two firing
modes for each weapon; by picking up a weapon, you will be equipped with the
standard (weak) ammo for the weapon, but when you pick up an ammo pack, you
will equip your weapon with special (strong) ammo. Weapons may have different
damage or slightly different behaviour depending on which ammo you use.

To keep the focus on competitive gaming, visibility is important in Warsow.
Cel-shaded, cartoon-like styles on the maps, textures, and models combine for
good visibility, suitable for competitive gameplay.

%prep
%setup -q -n warsow_21_sdk
%patch0 -p1
%patch1 -p1

%build
rm -rf source/source/win32/ mapping/lin32/ mapping/win32/

sed -e "/fs_basepath =/ s:\.:%{_datadir}/%{name}:" \
    -i source/source/qcommon/files.c

# don't compile in DATE and TIME
BUILDTIME=$(LC_ALL=C date -ur %{SOURCE99} +'%%H:%%M')
BUILDDATE=$(LC_ALL=C date -ur %{SOURCE99} +'%%b %%d %%Y')
sed -e "s/__TIME__/\"$BUILDTIME\"/" \
    -e "s/__DATE__/\"$BUILDDATE\"/" \
    -i $(grep -rl '__TIME__\|__DATE__')

dos2unix docs/license.txt docs/sourcecode_quickstart.txt \
	docs/OLD_player_models_guide.doc

cd source/source
%cmake \
    -DQFUSION_GAME=Warsow \
    -DUSE_SDL2=ON \
    -DSYSTEM_ANGELSCRIPT=OFF
make %{?_smp_mflags}

%install
cd source/source/build

install -d %{buildroot}%{_datadir}/%{name}

install -d %{buildroot}%{_bindir}
install -m 755 warsow.* %{buildroot}%{_bindir}/%{name}
install -m 755 wsw_server.* %{buildroot}%{_bindir}/%{name}-server
install -m 755 wswtv_server.* %{buildroot}%{_bindir}/%{name}-tv-server

install -d %{buildroot}%{_libdir}/%{name}/libs
install -m 755 libs/*.so %{buildroot}%{_libdir}/%{name}/libs
ln -s %{_libdir}/%{name}/libs %{buildroot}%{_datadir}/%{name}/libs

convert -strip ../../icons/warsow256x256.xpm warsow.png
for res in 256 192 128 96 64 32 24; do
    install -d "%{buildroot}%{_datadir}/icons/hicolor/$res"x"$res/apps/"
    convert -strip warsow.png -resize "$res"x"$res" "%{buildroot}%{_datadir}/icons/hicolor/$res"x"$res/apps/warsow.png"
done

install -D -p -m 644 %{SOURCE100}  %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
install -d %{buildroot}%{_datadir}/applications
%suse_update_desktop_file -i %{name} Game ActionGame

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc docs/*
%{_bindir}/%{name}
%{_bindir}/%{name}-server
%{_bindir}/%{name}-tv-server
%{_datadir}/%{name}
%{_datadir}/appdata/%{name}.appdata.xml
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_libdir}/%{name}

%changelog
openSUSE Build Service is sponsored by