%define name mindustry %define version 144.1 %define release 1 %define buildroot %{_tmppath}/%{name}-%{version}-%{release}-root %define debug_package %{nil} Name: %{name} Version: %{version} Release: %{release} Summary: The automation tower defense RTS License: GPL-3.0 URL: https://github.com/Anuken/Mindustry Source0: https://github.com/Anuken/Mindustry/releases/download/v%{version}/Mindustry.jar Requires: java-17-openjdk BuildRoot: %{buildroot} BuildRequires: unzip %description Mindustry is a hybrid tower-defense sandbox factory game. Create elaborate supply chains of conveyor belts to feed ammo into your turrets, produce materials to use for building, and defend your structures from waves of enemies. Features include a map editor, 24 built-in maps, cross-platform multiplayer and large-scale PvP unit battles. %prep %setup -T -c %build %install install -Dm755 %{SOURCE0} "$RPM_BUILD_ROOT/opt/mindustry/Mindustry.jar" echo '#!/bin/bash'> mindustry echo java -jar /opt/mindustry/Mindustry.jar>> mindustry chmod +x mindustry install -Dm755 mindustry "$RPM_BUILD_ROOT/usr/bin/mindustry" rm -rf mindustry unzip -j %{SOURCE0} icons/icon_64.png install -Dm755 ./icon_64.png "$RPM_BUILD_ROOT/opt/mindustry/icon.png" echo [Desktop Entry]> mindustry.desktop echo Name=Mindustry>> mindustry.desktop echo Exec=/usr/bin/mindustry>> mindustry.desktop echo Icon=/opt/mindustry/icon.png>> mindustry.desktop echo Type=Application>> mindustry.desktop install -Dm755 ./mindustry.desktop "$RPM_BUILD_ROOT/usr/share/applications/mindustry.desktop" %post if command -v update-desktop-database >/dev/null 2>&1; then update-desktop-database -q /usr/share/applications 2>/dev/null ||: fi %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) /usr/bin/mindustry /opt/mindustry/Mindustry.jar /opt/mindustry/icon.png /usr/share/applications/mindustry.desktop