File worldofpadman.spec of Package worldofpadman

#
# spec file for package worldofpadman
#
# 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:           worldofpadman
Version:        1.7.0
Release:        0
Summary:        A colorful, cartoon-esque shooter based on the fictional universe of Padman
License:        GPL-2.0-only
Group:          Amusements/Games/3D/Shoot
URL:            https://worldofpadman.net
Source:         https://github.com/PadWorld-Entertainment/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        %{name}.sh
Source2:        %{name}.desktop
Source3:        https://github.com/PadWorld-Entertainment/worldofpadman/releases/download/v%{version}/wop-%{version}-unified.zip
BuildRequires:  Mesa-devel
BuildRequires:  bsdtar
BuildRequires:  cmake >= 3.24
BuildRequires:  curl-devel
BuildRequires:  dos2unix
BuildRequires:  gcc-c++
BuildRequires:  ninja
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(openal)
BuildRequires:  pkgconfig(sdl2)
Requires:       %{name}-data = %{version}
ExcludeArch:    i586 aarch64

%description
World of Padman (also known as WoP) is a colorful, cartoon-esque shooter based on the fictional universe of Padman, available in both English and German.

%package data
Summary:        A colorful, cartoon-esque shooter based on the fictional universe of Padman
License:        CC-BY-NC-ND-3.0
Group:          Amusements/Games/3D/Shoot
Requires:       %{name} = %{version}
BuildArch:      noarch

%description data
World of Padman (also known as WoP) is a colorful, cartoon-esque shooter based on the fictional universe of Padman, available in both English and German.

%prep
%setup -q

mkdir %{name}-data
cd %{name}-data
bsdtar -xvf %{SOURCE3}
cd ..
find . -type f -iname "*.txt" -o -iname "*.css" -o -iname "*.html" | xargs dos2unix

%build
%cmake \
   -DUSE_INTERNAL_LIBS=OFF \
   -DBUILD_RENDERER_VULKAN=ON \
%if 0%{?sle_version} >= 150600 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
   -DBUILD_RENDERER_OPENGL2=ON
%else
   -DBUILD_RENDERER_OPENGL2=OFF
%endif

%cmake_build

%install
wopdir=%{buildroot}%{_prefix}/lib/%{name}
install -d 0755 $wopdir/wop/vm
install -d 0755 %{buildroot}%{_bindir}
install -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
install -d 0755 %{buildroot}%{_datadir}/applications
install -m 0755 %{SOURCE2} %{buildroot}%{_datadir}/applications/%{name}.desktop
install -m 0755 wopded.* $wopdir/
install -m 0755 wop.* $wopdir/
install -m 0755 renderer_opengl1_*.so $wopdir/
install -m 0755 renderer_opengl2_*.so $wopdir/
%ifarch x86_64
install -m 0755 renderer_vulkan_*.so $wopdir/
%endif

%ifarch x86_64
install -m 0644 wop/vm/* $wopdir/wop/vm/
%endif

install -d 0755 %{buildroot}%{_datadir}/icons/hicolor/scalable/apps
install -m 0644 %{name}-data/XTRAS/wop.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
install -m 0644 %{name}-data/wop/*.cfg $wopdir/wop/
install -m 0644 %{name}-data/wop/*.pk3 $wopdir/wop/

%files
%license COPYING.md GPL-2.0.md LICENSES.md
%doc CHANGELOG.md README.md SECURITY.md
%{_bindir}/*
%dir %{_prefix}/lib/%{name}
%dir %{_prefix}/lib/%{name}/wop
%{_prefix}/lib/%{name}/renderer*
%{_prefix}/lib/%{name}/wop.*
%{_prefix}/lib/%{name}/wopded.*
%{_prefix}/lib/%{name}/wop/vm
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/scalable
%dir %{_datadir}/icons/hicolor/scalable/apps
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}.desktop

%files data
%{_prefix}/lib/%{name}/wop/*.cfg
%{_prefix}/lib/%{name}/wop/*.pk3

%changelog
openSUSE Build Service is sponsored by