%define name nexuiz %define version 2.3 %define rel 1 %define release %mkrel %{rel} Name: %{name} Summary: An open source first-person shooter Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.bz2 # Fixes compiling Patch0: nexuiz-1.0-compile.patch URL: http://www.nexuiz.com/ Group: Games/Other BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot License: GPL BuildRequires: SDL-devel GL-devel libxxf86dga-devel %description Nexuiz is a multiplayer 3D first-person shooter based upon a heavily modified Quake 1 engine. WARNING: This game contains violence that is not suitable for children. %package glx Group: Games/Other Summary: GLX client for the open source first-person shooter Nexuiz Provides: nexuiz = %{version}-%{release} Requires: nexuiz-data = %{version} %description glx Nexuiz is a multiplayer 3D first-person shooter based upon a heavily modified Quake 1 engine. This package contains the glx client. It is known to be unstable on some systems, if you experience problems please try the nexuiz-sdl package instead. WARNING: This game contains violence that is not suitable for children. %package sdl Group: Games/Other Summary: SDL client for the open source first-person shooter Nexuiz Provides: nexuiz = %{version}-%{release} Requires: nexuiz-data = %{version} %description sdl Nexuiz is a multiplayer 3D first-person shooter based upon a heavily modified Quake 1 engine. This package contains the SDL client. WARNING: This game contains violence that is not suitable for children. %package dedicated Group: Games/Other Summary: Dedicated server for Nexuiz Requires: nexuiz-data = %{version} %description dedicated Nexuiz is a multiplayer 3D first-person shooter based upon a heavily modified Quake 1 engine. This packages contains the dedicated server. WARNING: This game contains violence that is not suitable for children. %prep %setup -q %patch0 -p0 %build # Create main launch script VARIANTS="sdl glx" for TYPE in $VARIANTS; do cat << LAUNCH_END > ./nexuiz-${TYPE}_launch #!/bin/bash # Mandriva launch script copyright (C) Eskild Hustvedt 2005, 2006 # Licensed under the GNU General Public License cd %{_gamesdatadir}/nexuiz/ # Check if the user is running a GeForce FX card and doesn't already have a config file if [ ! -e \$HOME/.nexuiz/ ]; then mkdir -p \$HOME/.nexuiz/data if [ "\`lspcidrake|grep -i nvidia|grep -i geforce |grep FX\`" != "" ]; then # Don't use GLSL echo 'r_shadow_glsl 0' > \$HOME/.nexuiz/data/autoexec.cfg fi # Set default video settings cat << EOF > \$HOME/.nexuiz/data/config.cfg vid_fullscreen "1" vid_height "600" vid_width "800" EOF fi exec %{_gamesbindir}/nexuiz-${TYPE}.real "\$@" LAUNCH_END done # Create the server launch script cat << EOF > ./nexuiz-dedicated_launch #!/bin/bash cd %{_gamesdatadir}/nexuiz/ exec %{_gamesbindir}/nexuiz-dedicated.real "\$@" EOF # Building breaks when using multiple jobs, so force one. %(echo %make|perl -pe 's/-j\d+/-j1/g') CPUOPTIMIZATIONS="%(echo %optflags|sed s/-Wp,-D_FORTIFY_SOURCE=2//)" release %install rm -rf $RPM_BUILD_ROOT install -m755 darkplaces-glx -D $RPM_BUILD_ROOT%{_gamesbindir}/nexuiz-glx.real install -m755 darkplaces-sdl -D $RPM_BUILD_ROOT%{_gamesbindir}/nexuiz-sdl.real install -m755 darkplaces-dedicated -D $RPM_BUILD_ROOT%{_gamesbindir}/nexuiz-dedicated.real install -m755 nexuiz-glx_launch -D $RPM_BUILD_ROOT%{_gamesbindir}/nexuiz-glx install -m755 nexuiz-sdl_launch -D $RPM_BUILD_ROOT%{_gamesbindir}/nexuiz-sdl install -m755 nexuiz-dedicated_launch -D $RPM_BUILD_ROOT%{_gamesbindir}/nexuiz-dedicated mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications cat << EOF > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-glx.desktop [Desktop Entry] Name=Nexuiz (glx client) StartupNotify=true Terminal=false Type=Application Icon=%{name} Exec=%{_gamesbindir}/%{name}-glx Categories=X-MandrivaLinux-MoreApplications-Games-Arcade;Game;ArcadeGame; EOF cat << EOF > $RPM_BUILD_ROOT%{_datadir}/applications/%{name}-sdl.desktop [Desktop Entry] Name=Nexuiz (sdl client) StartupNotify=true Terminal=false Type=Application Icon=%{name} Exec=%{_gamesbindir}/%{name}-sdl Categories=X-MandrivaLinux-MoreApplications-Games-Arcade;Game;ArcadeGame; EOF %post glx %{update_menus} %post sdl %{update_menus} %postun glx %{clean_menus} %postun sdl %{clean_menus} %clean rm -rf $RPM_BUILD_ROOT %files glx %defattr(-,root,root) %{_gamesbindir}/nexuiz-glx %{_gamesbindir}/nexuiz-glx.real %{_datadir}/applications/%{name}-glx.desktop %files sdl %defattr(-,root,root) %{_gamesbindir}/nexuiz-sdl %{_gamesbindir}/nexuiz-sdl.real %{_datadir}/applications/%{name}-sdl.desktop %files dedicated %defattr(-,root,root) %{_gamesbindir}/nexuiz-dedicated %{_gamesbindir}/nexuiz-dedicated.real %changelog * Fri Jan 11 2008 Thierry Vignaud <tvignaud@mandriva.com> 2.3-1mdv2008.1 + Revision: 148291 - drop old menu - kill re-definition of %%buildroot on Pixel's request + Olivier Blin <oblin@mandriva.com> - restore BuildRoot * Sat Jun 02 2007 Eskild Hustvedt <eskild@mandriva.org> 2.3-1mdv2008.0 + Revision: 34431 - New version 2.3 - Now uses exec to start the game * Thu Feb 08 2007 Thierry Vignaud <tvignaud@mandriva.com> 2.2.3-2mdv2007.0 + Revision: 118044 - bump release in order to force upload + Eskild Hustvedt <eskild@mandriva.org> - New version 2.2.3 (security fixes) * Thu Dec 14 2006 Eskild Hustvedt <eskild@mandriva.org> 2.2.1-1mdv2007.1 + Revision: 97147 - Added notice about glx client instability - New version 2.2.1 * Sat Dec 02 2006 Olivier Blin <oblin@mandriva.com> 2.1-2mdv2007.1 + Revision: 90094 - buildrequire libxxf86dga-devel - buildrequire GL-devel - fix XDG menu - Import nexuiz * Thu Sep 14 2006 Eskild Hustvedt <eskild@mandriva.org> 2.1-1mdv - New version 2.1 - XDG menu * Fri Jun 16 2006 Eskild Hustvedt <eskild@mandriva.org> 2.0-1mdv - New version 2.0 * Thu Feb 16 2006 Eskild Hustvedt <eskild@mandriva.org> 1.5-1mdk - New version 1.5 * Wed Nov 02 2005 Eskild Hustvedt <eskild@mandriva.org> 1.2.1-4mdk - Minor fixes to the menu entries *sigh* * Wed Nov 02 2005 Eskild Hustvedt <eskild@mandriva.org> 1.2.1-3mdk - Really really fixed the launch script (I hope) * Tue Nov 01 2005 Eskild Hustvedt <eskild@mandriva.org> 1.2.1-2mdk - Fixed the launchscript (bah) * Sun Oct 30 2005 Eskild Hustvedt <eskild@mandriva.org> 1.2.1-1mdk - Now defaults to 800x600 instead of 1024x768 - New version 1.2.1 * Wed Aug 31 2005 Couriousous <couriousous@mandriva.org> 1.2-2mdk - Disable fortify ( ie won't build if enabled ) - Fix Geforce FX detection * Wed Aug 31 2005 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 1.2-1mdk - 1.2 * Tue Jul 12 2005 Eskild Hustvedt <eskild@mandriva.org> 1.1-2mdk - Added a hack for GeForce FX cards in the startup script(s) * Wed Jul 06 2005 Per Ãyvind Karlsen <pkarlsen@mandriva.com> 1.1-1mdk - 1.1 - split out data package - compile with optimizations - fix requires & provides - added dedicated server * Fri Jun 10 2005 Eskild Hustvedt <eskild@mandrake.org> 1.0-1mdk - Initial Mandriva Linux package - Patch0: fix compile (thanks Michael Scherer)