%define name cxhextris %define version 1.0 %define release %mkrel 35 %define Summary An X Window System color version of xhextris %define mdkversion %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1$2".($3||0)' /etc/mandrake-release) %if %mdkversion >= 200700 %define x11prefix %{_prefix} %else %define x11prefix %{_prefix}/X11R6 %endif Summary: %{Summary} Name: %{name} Icon: %{name}.xpm Version: %{version} Release: %{release} License: GPL Group: Games/Arcade Source0: ftp://sunsite.unc.edu/pub/Linux/games/arcade/tetris/cxhextris.tar.bz2 Source11: %{name}_16x16.png Source12: %{name}_32x32.png Source13: %{name}_48x48.png Patch0: cxhextris-config.patch.bz2 Patch1: cxhextris-axp.patch.bz2 Patch2: cxhextris-security.patch.bz2 Requires(post): %{x11prefix}/bin/mkfontdir Requires(postun):%{x11prefix}/bin/mkfontdir BuildRequires: XFree86-devel XFree86 gcc BuildRequires: rman %if %mdkversion >= 200700 BuildRequires: imake %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description CXHextris is a color version of the popular xhextris game, which is a Tetris-like game that uses hexagon shapes instead of square shapes. CXHextris runs within the X Window System. Install cxhextris if you enjoy playing Tetris or Tetris-like games and you'd like to play one on your system. You'll need to have X installed in order to play CXHextris. %prep %setup -q -n cxhextris %patch -p1 %patch1 -p1 %patch2 -p1 %build xmkmf #fixes for modular xorg %if %mdkversion >= 200700 perl -pi -e "s#/X11R6##g" Makefile %endif %make CDEBUGFLAGS="$RPM_OPT_FLAGS" CXXDEBUGFLAGS="$RPM_OPT_FLAGS" %install rm -rf $RPM_BUILD_ROOT %{makeinstall_std} install.man MANPATH=%{_datadir} MANSUFFIX=6 \ MANDIR=%{_mandir}/man6 BINDIR=%{_gamesbindir} mkdir -p $RPM_BUILD_ROOT%{x11prefix}/%{_lib}/X11/fonts/misc make FONTDIR=$RPM_BUILD_ROOT%{x11prefix}/%{_lib}/X11/fonts install.font # icons install -m644 %{SOURCE11} -D $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png install -m644 %{SOURCE12} -D $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png install -m644 %{SOURCE13} -D $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png # (fg) Menu entry mkdir -p $RPM_BUILD_ROOT%{_menudir} cat >$RPM_BUILD_ROOT%{_menudir}/%{name} <<EOF ?package(%{name}):\ command="%{_gamesbindir}/xhextris"\ needs="X11"\ icon="%{name}.png"\ section="More Applications/Games/Arcade"\ title="Cxhextris"\ longtitle="Cxhextris: %{Summary}"\ xdg="true" EOF #XDG Menu mkdir $RPM_BUILD_ROOT%{_datadir}/applications cat > $RPM_BUILD_ROOT%{_datadir}/applications/mandriva-%{name}.desktop << EOF [Desktop Entry] Encoding=UTF-8 Name=Cxhextris Comment=Cxhextris: %{Summary} Exec=%{_gamesbindir}/xhextris Icon=%{name} Terminal=false Type=Application StartupNotify=false Categories=Game;ArcadeGame;X-Mandrakelinux-MoreApplications-Games-Arcade; EOF rm -f $RPM_BUILD_ROOT%{x11prefix}/%{_lib}/X11/fonts/misc/fonts.dir rm -rf $RPM_BUILD_ROOT%{x11prefix}/%{_lib}/X11/doc/ %clean rm -rf $RPM_BUILD_ROOT %post (cd %{x11prefix}/%{_lib}/X11/fonts/misc; %{x11prefix}/bin/mkfontdir) ## add menu entry %update_menus %postun (cd %{x11prefix}/%{_lib}/X11/fonts/misc; %{x11prefix}/bin/mkfontdir) ## remove menu entry %clean_menus %files %defattr(644,root,root,755) %doc README README.Linux xhextris.6.html %attr(2755,games,games) %{_gamesbindir}/xhextris %{x11prefix}/%{_lib}/X11/fonts/misc/hex20.pcf %attr(664,games,games) %{_localstatedir}/games/xhextris-scores %{_datadir}/applications/mandriva-%{name}.desktop %{_menudir}/%{name} %{_miconsdir}/%{name}.png %{_iconsdir}/%{name}.png %{_liconsdir}/%{name}.png %{_mandir}/man6/xhextris.6* %changelog * Sat Jul 08 2006 Christiaan Welvaart <cjw@daneel.dyndns.org> 1.0-35 - add BuildRequires: rman * Wed May 31 2006 Guillaume Bedot <littletux@mandriva.org> 1.0-34mdv2007.0 - Fix old menu and add XDG menu - Fix binary, doc and man paths - Build requires imake * Wed May 31 2006 Guillaume Bedot <littletux@mandriva.org> 1.0-33mdv2007.0 - Fix path with modular xorg * Sat Dec 31 2005 Mandriva Linux Team <http://www.mandrivaexpert.com/> 1.0-32mdk - Rebuild * Thu Aug 11 2005 Nicolas Lécureuil <neoclust@mandriva.org> 1.0-31mdk - reallu fix requires * Thu Aug 11 2005 Nicolas Lécureuil <neoclust@mandriva.org> 1.0-30mdk - fix rpmlint errors (PreReq) * Sat Dec 25 2004 Per Ãyvind Karlsen <peroyvind@linux-mandrake.com> 1.0-29mdk - fix unpackaged files - add large icon - fix summary-ended-with-dot - cosmetics * Sun Jul 13 2003 Per Øyvind Karlsen <peroyvind@sintrax.net> 1.0-28mdk - macroize - fix unpackaged files * Sat Feb 16 2002 Stefan van der Eijk <stefan@eijk.nu> 1.0-27mdk - BuildRequires * Thu Jan 31 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.0-26mdk - score file must not be conffile - hardcoded path in menu icon - capitalize title - fix sources permissions - xpm -> png icons * Tue May 01 2001 David BAUDENS <baudens@mandrakesoft.com> 1.0-25mdk - Use %%_tmppath for BuildRoot * Mon Aug 07 2000 Frederic Lepied <flepied@mandrakesoft.com> 1.0-24mdk - automatically added BuildRequires * Wed Mar 29 2000 Denis Havlik <denis@mandrakesoft.com> 1.0-23mdk - fixed section ( != group :-(( ) * Wed Mar 29 2000 Denis Havlik <denis@mandrakesoft.com> 1.0-22mdk - replaced .wmconfig with new menu entry (need better icons!!!) - new Group (Games/Arcade) * Thu Dec 30 1999 Florent Villard <warly@mandrakesoft.com> 1.0-21mdk - remove suid for /usr/X11/bin/xhextrix - change 666 mode of /var/lib/games/xhextris-scores * Tue Nov 02 1999 Pablo Saratxaga <pablo@mandrakesoft.com> - rebuild for new environmint * Fri Oct 15 1999 - David BAUDENS <baudens@mandrakesoft.com> - Fix incorrect Path in patch #2 (cxhextris-security.patch.bz2) * Wed Jun 23 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Merging with red-hat : - mark scores as %config(noreplace) (#2882) * Tue May 11 1999 Bernhard Rosenkänzer <bero@mandrakesoft.com> - handle RPM_OPT_FLAGS - Mandrake adaptions * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> - auto rebuild in the new build environment (release 15) * Wed Feb 24 1999 Preston Brown <pbrown@redhat.com> - Injected new description and group. * Tue Aug 4 1998 Jeff Johnson <jbj@redhat.com> - build root * Wed Jun 10 1998 Prospector System <bugs@redhat.com> - translations modified for de, fr * Tue Jun 09 1998 Mike Wangsmo <wanger@redhat.com> - fixed the wmconfig entry * Sat May 2 1998 Alan Cox <alan@redhat.com> - buffer overrun fixed. General restructure to avoid running setuid except during the first moments of initialisation. * Mon Apr 27 1998 Prospector System <bugs@redhat.com> - translations modified for de, fr, tr * Tue Oct 21 1997 Otto Hammersmith <otto@redhat.com> - fixed src url - added wmconfig entries * Thu Jul 10 1997 Erik Troan <ewt@redhat.com> - built against glibc