%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"] ')} Name: kaya Version: 0.3 Release: 2%{?dist} Summary: A board game suite for KDE Group: Amusements/Games License: GPLv2+ URL: http://pcapriotti.github.com/kaya/ Source0: http://cloud.github.com/downloads/pcapriotti/%{name}/%{name}-%{version}.tar.gz Patch0: %{name}-%{version}-ruby-1.8.6.patch BuildRequires: kdelibs-devel ruby ruby-devel BuildRequires: desktop-file-utils BuildRequires: gettext Requires: korundum Requires: rubygem-builder # Ruby is required by the dependency chain, but the guidelines insist on # explicit Requires (see http://fedoraproject.org/wiki/Packaging:Ruby) # note that 1.8.7 cannot be specified, hence the separate version requirement Requires: ruby(abi) = 1.8 # you need *some* backend engine to play locally # while you can use kaya without it as kaya can play other games like Shogi, # or connect to ICS, I consider requiring chess engine as a sane default # (note also that currently, as of 2010-05-20, we don't have any Shogi engine) Requires: chessprogram %description Kaya is a board game suite for KDE, containing games such as Chess and Shogi, and built upon a powerful plugin system which makes it easily extensible with new games, themes and behaviour. Note that Kaya is only a frontend, to play against computer you need also some CECP (XBoard) compatible backend. %prep %setup -q # put binaries into sitearchdir (http://fedoraproject.org/wiki/Packaging:Ruby) sed -i -e "s#\${DATA_INSTALL_DIR}#%{ruby_sitearch}#" lib/ext/CMakeLists.txt sed -i -e "s#ext/extensions#%{ruby_sitearch}/%{name}/lib/ext/extensions#" \ lib/ext/loader.rb %patch0 %build # from http://fedoraproject.org/wiki/Packaging:Ruby export CONFIGURE_ARGS="--with-cflags='%{optflags}'" %cmake . make VERBOSE=1 %{?_smp_mflags} %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} # copy icons for size in 16 22 32 48 64 128 ; do mkdir -p %{buildroot}/%{_datadir}/icons/hicolor/${size}x${size}/apps cp -p data/pics/hi${size}-app-kaya.png \ %{buildroot}/%{_datadir}/icons/hicolor/${size}x${size}/apps/%{name}.png done desktop-file-install --add-category="Game" --add-category="BoardGame" \ --delete-original \ --dir=%{buildroot}/%{_datadir}/applications/kde4 \ %{buildroot}/%{_datadir}/applications/kde4/%{name}.desktop %find_lang %{name} %clean rm -rf %{buildroot} %files -f %{name}.lang %defattr(-,root,root,-) %doc AUTHORS CHANGELOG COPYING %attr(755,root,root) %{_bindir}/%{name} %attr(755,root,root) %{_bindir}/%{name}-qt %{ruby_sitearch}/%{name} %{_datadir}/applications/kde4/%{name}.desktop %{_datadir}/icons/hicolor %{_datadir}/kde4/apps/%{name} %changelog * Thu Jul 01 2010 Karel Volný 0.3-2 - patch to work with ruby 1.8.6, dependency removed - fixed some rpmlint problems * Wed Jun 30 2010 Karel Volný 0.3-1 - Initial package version