File iortcw.spec of Package iortcw

#
# spec file for package iortcw
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018, Martin Hauke <mardnh@gmx.de>
#
# 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:           iortcw
Version:        1.51c.0
Release:        0
Summary:        Game engine for Return to Castle Wolfenstein
License:        GPL-3.0-only
Group:          Amusements/Games/3D/Shoot
URL:            https://github.com/iortcw/iortcw
Source:         %{name}-%{version}.tar.xz
Source1:        rtcw-sp.desktop
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(opus)
BuildRequires:  pkgconfig(opusfile)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(vorbis)

%description
Return to Castle Wolfenstein is a military- and occult-themed first-person
shooter game in a Second World War setting, originally released in 2001.
It is a sequel to Wolfenstein 3D.

%prep
%setup -q

%build
make -C SP/ \
    %{?_smp_mflags} \
    VERSION='%{version}' \
    CFLAGS='%{optflags}' \
    V=1 \
    USE_CODEC_OPUS=1 \
    USE_CODEC_VORBIS=1 \
    USE_CURL=1 \
    USE_CURL_DLOPEN=0 \
    USE_INTERNAL_LIBS=0 \
    USE_LOCAL_HEADERS=0 \
    USE_OPENAL=1 \
    USE_OPENAL_DLOPEN=0 \
    USE_VOIP=1 \
    BUILD_GAME_QVM=0 \
    NO_STRIP=1 \
    OPTIMIZE=''

%install
rtcwdir="%{buildroot}%{_libexecdir}/rtcw"
install -d %{buildroot}%{_bindir}
install -d $rtcwdir
install -d $rtcwdir/main/
install -m 755 SP/build/release-linux-*/iowolfsp.* $rtcwdir/rtcw-sp
install -m 644 SP/build/release-linux-*/renderer_*.so $rtcwdir/
install -m 644 SP/build/release-linux-*/main/cgame.sp.*.so $rtcwdir/main/
install -m 644 SP/build/release-linux-*/main/qagame.sp.*.so $rtcwdir/main/
install -m 644 SP/build/release-linux-*/main/ui.sp.*.so $rtcwdir/main/

echo -e "#!/bin/sh\nexec %{_prefix}/lib/rtcw/rtcw-sp \"\$@\"" > %{buildroot}%{_bindir}/rtcw-sp
chmod 755 %{buildroot}%{_bindir}/rtcw-sp

install -Dm 644 SP/misc/wolf.svg %{buildroot}%{_datadir}/pixmaps/rtcw-sp.svg
%suse_update_desktop_file -i rtcw-sp

%post
%desktop_database_post

%postun
%desktop_database_postun

%files
%doc iortcw-command-changes.txt iortcw-cvars-new.txt iortcw-cvars-removed.txt README.md rend2-cvars.txt rend2-readme.md voip-readme.txt voip-readme.txt
%{_bindir}/rtcw-sp
%dir %{_libexecdir}/rtcw
%{_libexecdir}/rtcw/rtcw-sp
%{_libexecdir}/rtcw/renderer_*.so
%dir %{_libexecdir}/rtcw/main
%{_libexecdir}/rtcw/main/cgame.sp.*.so
%{_libexecdir}/rtcw/main/qagame.sp.*.so
%{_libexecdir}/rtcw/main/qagame.sp.*.so
%{_libexecdir}/rtcw/main/ui.sp.*.so
%{_datadir}/pixmaps/rtcw-sp.svg
%{_datadir}/applications/rtcw-sp.desktop

%changelog
openSUSE Build Service is sponsored by