File eduke32.spec of Package eduke32

#
# spec file for package eduke32
#
# 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:           eduke32
Version:        20230118.1a90b98
Release:        0
Summary:        Source port of Duke Nukem 3D
License:        GPL-2.0-only
Group:          Amusements/Games/3D/Shoot
URL:            https://www.eduke32.com/
Source0:        eduke32-%{version}.tar.xz
Source1:        %{name}_32x32.png
Source2:        %{name}_48x48.png
Source3:        %{name}_64x64.png
Source4:        %{name}_128x128.png
Source5:        %{name}.desktop
Source6:        %{name}-demo-install.sh
Source7:        %{name}-demo-install.1
# PATCH-FIX-UPSTREAM - eduke32-disable-rpath-linking.patch - fix binary-or-shlib-defines-rpath warning/badness
Patch0:         eduke32-disable-rpath-linking.patch
BuildRequires:  dos2unix
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(SDL2_mixer)
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(flac)
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(sdl2)
BuildRequires:  pkgconfig(vorbis)
BuildRequires:  pkgconfig(vpx)
Provides:       %{name}-gui = %{version}
Obsoletes:      %{name}-gui < %{version}
Provides:       %{name}-console = %{version}
Obsoletes:      %{name}-console < %{version}
Provides:       %{name}_engine = %{version}
Obsoletes:      %{name}_engine < %{version}
ExcludeArch:    i586

%description
EDuke32 is a source port of the classic PC first person shooter Duke Nukem 3D
to Windows, Linux and OS X, which adds a ton of awesome features and
upgrades for regular players and an arsenal of editing functions and
scripting extensions for mod authors and map makers.

Note: You need 'Duke Nukem 3D' data files to play.
You can put them under '%{_datadir}/games/eduke32/' for all users
or '~/.eduke32/' only for yourself.
You can also play the shareware version. Use 'eduke32-demo-install' to
install the shareware files.

%package mapeditor
Summary:        Eduke32 map editor
Group:          Amusements/Games/3D/Shoot

%description mapeditor
Eduke32 maps editor based on BUILD engine

%prep
%setup -q
%patch -P 0 -p1
cp %{SOURCE1} .
cp %{SOURCE2} .
cp %{SOURCE3} .
cp %{SOURCE4} .
cp %{SOURCE5} .
cp %{SOURCE6} .
cp %{SOURCE7} .

%build
export CFLAGS='%{optflags} -Wno-format'

%make_build PACKAGE_REPOSITORY=1 \
     PRETTY_OUTPUT=1 \
     RELEASE=1 \
     SDL_TARGET=2 \
     LTO=1 \
     VC_REV=%{version} \
     %{?_smp_mflags}

dos2unix source/build/buildlic.txt
gzip -9 %{name}-demo-install.1

%install
install -Dm 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -Dm 0755 mapster32 %{buildroot}%{_bindir}/mapster32

# shareware demo installer script and manpage for eduke32-demo-install
install -Dm 0755 %{name}-demo-install.sh %{buildroot}%{_bindir}/%{name}-demo-install
install -Dm 0644 %{name}-demo-install.1.gz %{buildroot}%{_mandir}/man1/%{name}-demo-install.1.gz

# data files and help files for editor
install -Dm 0644 package/sdk/SEHELP.HLP %{buildroot}%{_datadir}/games/%{name}/sehelp.hlp
install -Dm 0644 package/sdk/STHELP.HLP %{buildroot}%{_datadir}/games/%{name}/sthelp.hlp
install -Dm 0644 package/sdk/m32help.hlp %{buildroot}%{_datadir}/games/%{name}/m32help.hlp
install -Dm 0644 package/sdk/tiles.cfg %{buildroot}%{_datadir}/games/%{name}/tiles.cfg

# desktop file and icons
install -Dm 0644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm 0644 %{name}_32x32.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -Dm 0644 %{name}_48x48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
install -Dm 0644 %{name}_64x64.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
install -Dm 0644 %{name}_128x128.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png

%suse_update_desktop_file -r %{name} Game ArcadeGame

%files
%{_bindir}/%{name}
%{_bindir}/%{name}-demo-install
%dir %{_datadir}/games/%{name}/
%{_datadir}/games/%{name}/m32help.hlp
%{_datadir}/games/%{name}/sehelp.hlp
%{_datadir}/games/%{name}/sthelp.hlp
%{_datadir}/games/%{name}/tiles.cfg
%doc source/build/buildlic.txt
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/%{name}-demo-install.1%{?ext_man}

%files mapeditor
%{_bindir}/mapster32

%changelog
openSUSE Build Service is sponsored by