File gods-deluxe.spec of Package gods-deluxe

#
# spec file for package gods-deluxe
#
# Copyright (c) 2025, 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:           gods-deluxe
Version:        0.10.0
Release:        0
Summary:        A remake of the game Gods Deluxe
License:        MIT
Group:          Amusements/Games/Action/Arcade
URL:            https://github.com/jotd666/gods-deluxe
Source:         https://github.com/jotd666/gods-deluxe/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# see README.SUSE-maven-deps on how to create the maven offline repo tarball
Source1:        maven_offline_repo.tar.gz
Source2:        %{name}-wrapper.sh
Patch0:         gods-deluxe-fix-desktop-files.patch
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  java-devel >= 11
BuildRequires:  javapackages-filesystem
BuildRequires:  jpackage-utils
BuildRequires:  maven
Requires:       java
BuildArch:      noarch

%description
Gods Deluxe is a remake of the excellent Bitmap Brothers platform game.
All classic levels are complete and working, and there are 4 extra full
levels from the author.

%prep
%autosetup -p1
tar xvf %{SOURCE1}

%build
mvn package -o -Dmaven.repo.local=./maven_offline_repo

%install

install -Dm 0755 %{SOURCE2} %{buildroot}/%{_bindir}/%{name}
install -Dm 0644 target/gods-deluxe-%{version}-jar-with-dependencies.jar %{buildroot}/%{_javadir}/%{name}/%{name}.jar

install -d %{buildroot}/%{_datadir}/%{name}
for d in fonts icons images levels locale music sound tiles; do
  cp -Rv "$d" %{buildroot}/%{_datadir}/%{name}
done

install -Dm 0644 distro/metadata/gods-deluxe.desktop %{buildroot}/%{_datadir}/applications/%{name}.desktop
install -Dm 0644 distro/metadata/gods-deluxe.128x128.png %{buildroot}/%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
install -Dm 0644 distro/metadata/gods-deluxe.metainfo.xml %{buildroot}/%{_datadir}/metainfo/%{name}.metainfo.xml

%fdupes %{buildroot}/%{_datadir}/%{name}

%files
%license LICENSE
%doc README.md
%doc doc/*
%{_bindir}/%{name}
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/%{name}.jar
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{_datadir}/metainfo/%{name}.metainfo.xml

%changelog
openSUSE Build Service is sponsored by