Name: crawl Version: 0.5.2 Release: 1%{?dist} Summary: Dungeon Crawl Stone Soup - a rogue-like game of exploration Group: Amusements/Games License: NGPL URL: http://crawl.develz.org/ Source0: http://downloads.sourceforge.net/crawl-ref/stone_soup-%{version}-src.tbz2 Source1: %{name}.desktop Patch0: %{name}-configs.patch Patch1: %{name}-datafiles.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: lua-devel BuildRequires: sqlite-devel BuildRequires: flex BuildRequires: bison BuildRequires: ncurses-devel # For tiles version BuildRequires: desktop-file-utils BuildRequires: SDL-devel BuildRequires: SDL_image-devel BuildRequires: libpng-devel BuildRequires: freetype-devel Requires: lua Requires: sqlite %description Dungeon Crawl Stone Soup is a free rogue-like game of exploration and treasure-hunting in dungeons filled with dangerous and unfriendly monsters in a quest for the mystifyingly fabulous Orb of Zot. Stone Soup has diverse species and many different character backgrounds to choose from, deep tactical game-play, sophisticated magic, religion and skill systems, and a grand variety of monsters to fight and run from, making each game unique and challenging. %package -n %{name}-tiles Summary: Dungeon Crawl Stone Soup - graphical tiles version Group: Amusements/Games Requires: %{name} = %{version}-%{release} Requires: SDL %description -n %{name}-tiles The GUI tiles version of Dungeon Crawl Stone Soup. %prep %setup -q -n stone_soup-%{version}-src # a lot of makefile changes for paths, removal of bundled libs, flags etc. %patch0 -p1 -b .configs # patch to fix crawl looking for files in the wrong directory %patch1 -p1 -b .datafiles # executable changelog? %{__chmod} a-x docs/changelog.txt iconv --from=ISO-8859-1 --to=UTF-8 \ docs/obsolete/changes.400 > docs/obsolete/changes mv docs/obsolete/changes docs/obsolete/changes.400 %build cp -r source source-tiles pushd source/ make %{?_smp_mflags} \ EXTRA_FLAGS="%{optflags} `pkg-config --cflags lua sqlite3`" \ LDFLAGS="-rdynamic `pkg-config --libs lua sqlite3`" \ SAVEDIR="%{_localstatedir}/games/%{name}/" \ DATADIR="%{_datadir}/%{name}/" popd # source/makefile explicitly states not to use the smp_mflags flag # when compiling the tiles version pushd source-tiles/ make MAKEFILE=makefile_tiles.unix \ EXTRA_FLAGS="%{optflags} `pkg-config --cflags lua sqlite3`"\ SDL_LDFLAGS="`pkg-config --libs sdl`" \ LUASQL_DLIB="`pkg-config --libs lua sqlite3`" \ SAVEDIR="%{_localstatedir}/games/%{name}/" \ DATADIR="%{_datadir}/%{name}/" popd %install rm -rf %{buildroot} pushd source-tiles/ make MAKEFILE=makefile_tiles.unix install \ INSTALLDIR="%{buildroot}%{_datadir}/%{name}"\ SAVEDIR="%{buildroot}%{_localstatedir}/games/%{name}" \ DATADIR="%{buildroot}%{_datadir}/%{name}" popd # move the executable so it doesn't get overriden by the text version mkdir -p %{buildroot}%{_bindir} mv %{buildroot}%{_datadir}/%{name}/%{name} %{buildroot}%{_bindir}/%{name}-tiles pushd source/ make install INSTALLDIR="%{buildroot}%{_datadir}/%{name}" \ SAVEDIR="%{buildroot}%{_localstatedir}/games/%{name}" \ DATADIR="%{buildroot}%{_datadir}/%{name}" popd # move the executable to its proper place mv %{buildroot}%{_datadir}/%{name}/%{name} \ %{buildroot}%{_bindir}/%{name} # place the manpage in its proper place mkdir -p %{buildroot}%{_mandir}/man6/ mv docs/crawl.6 %{buildroot}%{_mandir}/man6/%{name}.6 # don't redistribute Bitstream Vera Sans fonts. Link to DejaVu instead rm -f %{buildroot}%{_datadir}/%{name}/dat/tiles/Vera.ttf rm -f %{buildroot}%{_datadir}/%{name}/dat/tiles/VeraMono.ttf ln -s %{_datadir}/fonts/dejavu/DejaVuSans.ttf \ %{buildroot}%{_datadir}/%{name}/dat/tiles/Vera.ttf ln -s %{_datadir}/fonts/dejavu/DejaVuSansMono.ttf \ %{buildroot}%{_datadir}/%{name}/dat/tiles/VeraMono.ttf # copy the icon; the game still looks for it in its $DATA_DIR mkdir -p %{buildroot}%{_datadir}/pixmaps/ cp %{buildroot}%{_datadir}/%{name}/dat/tiles/stone_soup_icon-32x32.png \ %{buildroot}%{_datadir}/pixmaps/%{name}.png desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE1} # create saves and morgue dirs mkdir %{buildroot}%{_localstatedir}/games/%{name}/morgue mkdir %{buildroot}%{_localstatedir}/games/%{name}/saves mkdir %{buildroot}%{_localstatedir}/games/%{name}/saves/des # create some files that the game will need (and try to create) # so we can list them as configs touch %{buildroot}%{_localstatedir}/games/%{name}/saves/scores touch %{buildroot}%{_localstatedir}/games/%{name}/saves/logfile %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc README.txt README.pdf licence.txt CREDITS.txt docs %{_datadir}/%{name} %exclude %{_datadir}/%{name}/dat/tiles %{_mandir}/man6/* %defattr(0664,root,games) %config %{_localstatedir}/games/%{name}/saves/scores %config %{_localstatedir}/games/%{name}/saves/logfile %attr(0775,root,games) %dir %{_localstatedir}/games/%{name} %attr(0775,root,games) %dir %{_localstatedir}/games/%{name}/saves %attr(0775,root,games) %dir %{_localstatedir}/games/%{name}/saves/des %attr(0775,root,games) %dir %{_localstatedir}/games/%{name}/morgue %attr(2755,root,games) %{_bindir}/%{name} %files -n %{name}-tiles %defattr(-,root,root,-) %attr(2755,root,games) %{_bindir}/%{name}-tiles %{_datadir}/%{name}/dat/tiles %{_datadir}/applications/* %{_datadir}/pixmaps/* %changelog * Tue Mar 2 2010 Ionuț C. Arțăriși - 0.5.2-1 - initial package