Name: puzzles Version: 8887 Release: 2%{?dist} Summary: A collection of one-player puzzle games Group: Amusements/Games License: MIT URL: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ Source0: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/puzzles-r%{version}.tar.gz Source1: template.desktop Patch0: 0001-Adds-lX11-and-lm-to-the-libraries.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gtk2-devel, perl, desktop-file-utils %description This is a collection of small desktop toys, little games that you can pop up in a window and play for two or three minutes while you take a break from whatever else you were doing. %prep %setup -q -n puzzles-r%{version} %patch0 -p1 # rebuilds the makefile with the patched mkfiles.pl ./mkfiles.pl # uses the fedora command line instead of the one hardcoded in the makefile # -g is the last option that is not application specific. # TODO: THIS IS UGLY, NEW VERSIONS COULD MAKE THIS STOP WORKING sed -e "s/CFLAGS = .*-g/CFLAGS = %{optflags}/" -i Makefile iconv -f ISO88591 -t UTF8< LICENCE > LICENSE %build CFLAGS="%{optflags}" make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{_bindir} mkdir -p $RPM_BUILD_ROOT/%{_datadir}/puzzles cp -a icons/*-32d24.png $RPM_BUILD_ROOT/%{_datadir}/puzzles make install prefix=%{_prefix} gamesdir=%{_bindir} bindir=%{_bindir} DESTDIR=$RPM_BUILD_ROOT # create all the desktop files needed. path=$RPM_BUILD_ROOT/%{_bindir} for i in $path/*; do base=`basename $i` name=`perl -e 'print ucfirst($ARGV[0])' "$base"` command=puzzle-$base mv $i $path/$command sed -e "s/<NAME>/$name/g;s!<EXEC>!%{_bindir}/$command!g;s!<ICON>!%{_datadir}/puzzles/$base-32d24.png!g" %{SOURCE1} > puzzle-$base.desktop desktop-file-install --vendor="fedora" \ --dir=${RPM_BUILD_ROOT}%{_datadir}/applications/ \ $command.desktop done %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc README HACKING LICENSE puzzles.txt %{_bindir}/* %{_datadir}/puzzles %{_datadir}/applications/* %changelog * Sat Mar 13 2010 Victor Bogado <victor@bogado.net> 8887-2 - Fixing cflags * Thu Mar 11 2010 Victor Bogado <victor@bogado.net> 8887-1 - Updating to a new upstream version - Fixing link DSO issue from bug #564620 * Mon Jun 22 2009 Victor Bogado <victor@bogado.net> 8596-1 - updating to a new upstream version *Thu Dec 11 2008 Victor Bogado <victor@bogado.net> 8365-1 - New updastream version *Mon Oct 27 2008 Victor Bogado <victor@bogado.net> 8200-3 - Build-Requires should have desktop-file-utils - Description should start with uppercase - iconv goes now in prep area - fixed mistakes in the versions of the change log - Names on the menu should start with an upper-case *Mon Oct 20 2008 Victor Bogado <victor@bogado.net> 8200-2 - Fixing problem with desktop files. *Mon Oct 20 2008 Victor Bogado <victor@bogado.net> 8200-1 - Suggestion made by reviewer Sergio Pascual <sergio.pasra@gmail.com>. - rename all the binaries. - rename desktop files to follow the binary name. - adding LICENCE (renamed to LICENSE) to docs. - sed "in place", better coding. - removing sed out of build-requires. - Updated to last upstream version. *Mon Sep 01 2008 Victor Bogado <victor@bogado.net> 8149-1 - initial spec