File etlegacy.spec of Package etlegacy
#
# spec file for package etlegacy
#
# 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: etlegacy
Version: 2.83.2
Release: 0
Summary: Wolfenstein: Enemy Territory 2.60b compatible client/server
License: GPL-3.0-only
Group: Amusements/Games/3D/Shoot
URL: https://www.etlegacy.com
Source0: https://github.com/%{name}/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://mirror.etlegacy.com/omnibot/omnibot-linux-latest.tar.gz
Source2: https://mirror.etlegacy.com/geoip/GeoIP.dat.tar.gz
Source3: https://mirror.etlegacy.com/wolfadmin/wolfadmin.tar.gz
# PATCH-FIX-OPENSUSE etlegacy-cmake-install.patch - Fix install of some files, e.g. icons, manpage
Patch0: etlegacy-cmake-install.patch
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libjpeg8-devel
BuildRequires: pkgconfig
BuildRequires: shared-mime-info
BuildRequires: update-desktop-files
BuildRequires: zip
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(glew)
BuildRequires: pkgconfig(libcjson)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(lua) >= 5.4
BuildRequires: pkgconfig(minizip)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(theora)
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(x11)
Requires: enemy-territory-data = 2.60b
Recommends: etlegacy-mod
# Make it easier to find using the software.opensuse.org search:
Provides: enemy-territory-legacy
# You have to use the i586 package even on 64-bit system because of compatibility with W:ET 2.60b
ExclusiveArch: i586
# TODO: cross compile
%description
ET: Legacy is based on the source code of the Wolfenstein: Enemy Territory which was released under the GPLv3 license.
The main goal of this project is to fix bugs, remove old dependencies and make it playable on all major operating systems
while still remaining compatible with the ET 2.60b version and as many of its mods as possible.
This package contains only the engine including the dedicated server and not data files.
%package mod
Summary: Legacy Mod
Group: Amusements/Games/3D/Shoot
Requires: %{name} = %{version}
%description mod
ET: Legacy is based on the source code of the Wolfenstein: Enemy Territory which was released under the GPLv3 license.
The main goal of this project is to fix bugs, remove old dependencies and make it playable on all major operating systems
while still remaining compatible with the ET 2.60b version and as many of its mods as possible.
This package contains only the fixed legacy compatible mod files without game assets.
%prep
%autosetup -p1
%build
mkdir -p build/legacy
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} build/legacy
pushd build/legacy
tar -xzf %{SOURCE1}
tar -xzf %{SOURCE2}
tar -xzf %{SOURCE3}
popd
%cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DINSTALL_DEFAULT_BASEDIR=%{_prefix}/lib/enemy-territory \
-DINSTALL_DEFAULT_MODDIR=%{_prefix}/lib/enemy-territory \
-DBUILD_CLIENT=1 \
-DBUILD_SERVER=1 \
-DBUILD_MOD=1 \
-DBUILD_MOD_PK3=1 \
-DBUNDLED_LIBS=0 \
-DFEATURE_CURL=1 \
-DFEATURE_SSL=1 \
-DFEATURE_OGG_VORBIS=1 \
-DFEATURE_THEORA=1 \
-DFEATURE_OPENAL=1 \
-DFEATURE_FREETYPE=1 \
-DFEATURE_PNG=1 \
-DFEATURE_LUA=1 \
-DFEATURE_MULTIVIEW=1 \
-DFEATURE_EDV=1 \
-DFEATURE_ANTICHEAT=1 \
-DFEATURE_AUTOUPDATE=0 \
-DFEATURE_RENDERER2=0 \
-DFEATURE_RENDERER_GLES=0 \
-DFEATURE_IPV6=1 \
-DFEATURE_IRC_CLIENT=0 \
-DFEATURE_IRC_SERVER=0 \
-DRENDERER_DYNAMIC=1 \
-DFEATURE_WINDOWS_CONSOLE=0 \
-DFEATURE_GETTEXT=1 \
-DFEATURE_SERVERMDX=1 \
-DFEATURE_DBMS=1 \
-DFEATURE_PAKISOLATION=1 \
-DFORCE_DEBUG=0 \
-DFEATURE_OMNIBOT=1
%make_build
%install
%cmake_install
# fix permission for omni-bot and subdirectories
chmod -R +X %{buildroot}/%{_prefix}/lib/enemy-territory/legacy/omni-bot/
%fdupes %{buildroot}/%{_prefix}/lib/enemy-territory/
%post
echo 'copy pak[0-2].pk3 asset files to /usr/lib/enemy-territory/etmain'
%files
%license COPYING.txt
%doc doc/INSTALL.txt
%{_bindir}/*
%{_prefix}/lib/enemy-territory
%exclude %{_prefix}/lib/enemy-territory/legacy
%{_datadir}/icons/hicolor/scalable/apps/etl.svg
%{_datadir}/applications/com.etlegacy.ETLegacy.*.desktop
%{_datadir}/metainfo/com.etlegacy.ETLegacy.metainfo.xml
%{_datadir}/mime/packages/etlegacy.xml
%{_mandir}/*/*
%files mod
%{_prefix}/lib/enemy-territory/legacy
%exclude %{_prefix}/lib/enemy-territory/legacy/omni-bot/omnibot_et.dll
%exclude %{_prefix}/lib/enemy-territory/legacy/omni-bot/omnibot_et.x86_64.so
%changelog