%global optdir /opt/ Name: dwarffortress Version: 0.42.05 Release: 3%{?dist} Summary: A single-player procedurally generated fantasy game License: Dwarf Fortress URL: http://www.bay12games.com/dwarves/ Source0: http://www.bay12games.com/dwarves/df_42_05_linux.tar.bz2 Source1: https://github.com/svenstaro/dwarf_fortress_unfuck/archive/0.42.05.zip Source2: https://mars.arosser.com/fedora/rpmfusion/dwarffortress-launcher.tar.xz ExclusiveArch: i686 # BuildRequires from https://github.com/svenstaro/dwarf_fortress_unfuck/ BuildRequires: cmake, libpng-devel, gcc, gcc-c++, automake BuildRequires: libXext-devel, atk-devel, cairo-devel, gdk-pixbuf2-devel, BuildRequires: fontconfig-devel, openal-soft-devel, SDL_image-devel, SDL_ttf-devel, BuildRequires: freetype-devel, libX11-devel, libICE-devel, libSM-devel, mesa-libGL, BuildRequires: mesa-libGL-devel, glib2-devel, mesa-libGLU-devel, pango-devel, ncurses-devel, BuildRequires: libsndfile-devel, gtk2-devel, glew-devel, SDL-devel, glibc-devel # BuildRequires we need for the rest of the RPM. BuildRequires: desktop-file-utils, dos2unix, unzip # Explicitly require libpng-devel, rpm should be able to deal with the rest-- I hope. # So, testing suggests this isn't actually necessary anymore. # Requires: libpng-devel # This didn't get Requires'd correctly. Requires: alsa-plugins-pulseaudio %description Dwarf Fortress is a single-player fantasy game. You can control a dwarven outpost or an adventurer in a randomly generated, persistent world. Although Dwarf Fortress is still in a work in progress, many features have already been implemented. Dwarf Fortress is free to redistribute, but is not open source. %prep # Cleanup from previous build, if necessary. rm -rf df_linux/ rm -rf %{buildroot} # Extract the 'sources' into the build directory. tar xfj %SOURCE0 cd df_linux/ unzip %SOURCE1 tar xfJ %SOURCE2 # Fix some permissions. find -type d -exec chmod 755 {} + find -type f -exec chmod 644 {} + dos2unix *.txt %build cd df_linux/ cd dwarf_fortress_unfuck* mkdir build && cd build cmake .. make %{?_smp_mflags} %install cd df_linux/ mkdir -p %{buildroot}%{_datadir}/dwarffortress/ mkdir -p %{buildroot}%{_libexecdir}/dwarffortress/ cp -r data raw sdl %{buildroot}%{_datadir}/dwarffortress/ # Copy over the actual binary and compiled graphics library. install -Dm755 libs/Dwarf_Fortress %{buildroot}%{_libexecdir}/dwarffortress/Dwarf_Fortress install -Dm755 dwarf_fortress_unfuck*/build/libgraphics.so %{buildroot}%{_libexecdir}/dwarffortress/libgraphics.so # Link libpng, because apparently we have to do this. # Or... not. # ln -s %{_libdir}/libpng.so %{buildroot}%{optdir}/dwarffortress/libs/libpng.so.3 # Install .desktop file and launcher script from Arch Linux package. # Or, rather, the modified versions. sed 's|prefix=/usr|prefix=%{_prefix}|' -i dwarffortress-launcher/dwarffortress install -Dm755 dwarffortress-launcher/dwarffortress %{buildroot}%{_bindir}/dwarffortress install -Dm644 dwarffortress-launcher/dwarffortress.desktop %{buildroot}%{_datadir}/applications/dwarffortress.desktop install -Dm644 dwarffortress-launcher/dwarffortress.png %{buildroot}%{_datadir}/pixmaps/dwarffortress.png desktop-file-validate %{buildroot}%{_datadir}/applications/dwarffortress.desktop %files %doc df_linux/*.txt df_linux/README.linux %{_datadir}/dwarffortress %{_libexecdir}/dwarffortress %{_bindir}/dwarffortress %{_datadir}/applications/dwarffortress.desktop %{_datadir}/pixmaps/dwarffortress.png %changelog * Sat Jan 23 2016 Ben Rosser 0.42.05-3 - Split up dwarffortress rather than bundling it in /opt. - Dwarf_Fortress binary is in libexecdir, along with compiled libgraphics. - Data and raws have been moved into datadir. - The dwarffortress script has been updated to refer to these locations. - Added README.linux to documentation. * Mon Jan 18 2016 Ben Rosser 0.42.05-2 - Added explicit requires on alsa-plugins-pulseaudio that RPM failed to find. * Mon Jan 18 2016 Ben Rosser 0.42.05-1 - Upgraded to latest upstream release. * Fri Jan 1 2016 Ben Rosser 0.42.04-1 - Initial package, based heavily on the work done for Arch Linux.