Name: freecol Version: 1.2.0 Release: 1 Summary: Open version of the game Colonization License: GPLv2+ Group: Games/Strategy URL: https://www.freecol.org/ Source0: https://prdownloads.sourceforge.net/freecol/%{name}-%{version}-src.zip BuildRequires: ant BuildRequires: unzip Requires: java >= 1.6 Requires: desktop-file-utils BuildArch: noarch %description FreeCol is an open version of Colonization. It is a Civilization-like game in which the player has to conquer the new world. %prep %setup -q -n %{name} %build export JAVA_HOME=%_prefix/lib/jvm/java-openjdk export ANT_OPTS=-Dfile.encoding=UTF8 ant %install %__mkdir_p %{buildroot}%{_datadir}/games/%{name} cp FreeCol.jar %{buildroot}%{_datadir}/games/%{name} cp -a {data,jars} %{buildroot}%{_datadir}/games/%{name} %__mkdir_p %{buildroot}%{_bindir} %__cat > %{buildroot}%{_bindir}/%{name} << EOF #!/bin/sh java -Xmx2000M -jar %{_datadir}/games/freecol/FreeCol.jar --freecol-data %{_datadir}/games/%{name}/data EOF %__mkdir_p %{buildroot}%{_datadir}/pixmaps %__cp packaging/common/%{name}.xpm %{buildroot}%{_datadir}/pixmaps %__mkdir_p %{buildroot}%{_datadir}/applications %__cat > %{buildroot}%{_datadir}/applications/fedora-%{name}.desktop << EOF [Desktop Entry] Name=FreeCol Comment=%{summary} Exec=%{_bindir}/%{name} Icon=%{name} Terminal=false Type=Application Categories=Game;StrategyGame; EOF %files %defattr(0644,root,root,0755) %doc packaging/common/{COPYING,README} %attr(0755,root,root) %{_bindir}/%{name} %{_datadir}/applications/fedora-%{name}.desktop %dir %{_datadir}/games/%{name} %{_datadir}/games/%{name}/* %{_datadir}/pixmaps/%{name}.xpm