Blob Blame History Raw
Summary: The Open Racing Car Simulator
Name: torcs
Version: 1.3.0
Release: 4%{?dist}
License: GPLv2+
Group: Amusements/Games
URL: http://torcs.org/
Source: http://downloads.sf.net/torcs/TORCS-%{version}-src.tgz
Source1: http://downloads.sf.net/torcs/TORCS-%{version}-src-robots-base.tgz
Source2: http://downloads.sf.net/torcs/TORCS-%{version}-src-robots-berniw.tgz
Source3: http://downloads.sf.net/torcs/TORCS-%{version}-src-robots-bt.tgz
Source4: http://downloads.sf.net/torcs/TORCS-%{version}-src-robots-olethros.tgz
Patch0: torcs-1.2.4-freealutfix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires: torcs-data, torcs-data-tracks-road, torcs-data-cars-extra
Requires: opengl-games-utils
BuildRequires: libGL-devel, freeglut-devel, freealut-devel, plib-devel >= 1.8.3
BuildRequires: libpng-devel, libjpeg-devel, zlib-devel, openal-devel
BuildRequires: desktop-file-utils
BuildRequires: libXext-devel, libXt-devel, libXi-devel, libXmu-devel
BuildRequires: libXxf86vm-devel, libXrandr-devel, libXrender-devel

%description
TORCS is a 3D racing cars simulator using OpenGL.  The goal is to have
programmed robots drivers racing against each others.  You can also drive
yourself with either a wheel, keyboard or mouse.


%package robots
Summary: The Open Racing Car Simulator robots
Group: Amusements/Games
Requires: %{name} = %{version}-%{release}

%description robots
TORCS is a 3D racing cars simulator using OpenGL.  The goal is to have
programmed robots drivers racing against each others.  You can also drive
yourself with either a wheel, keyboard or mouse.

This package contains the robots who can race on their own.


%prep
%setup -q -a 1 -a 2 -a 3 -a 4
%patch0 -p1 -b .freealutfix
# Put the drivers back where they belong
%{__mv} %{name}-%{version}/src/drivers/* src/drivers/


%build
# Force locations with modular X
# Required (1.2.4, still in 1.3.0)
%configure \
    --x-includes=%{_includedir} \
    --x-libraries=%{_libdir}
# Having %{?_smp_mflags} makes the build fail since 1.2.3, still in 1.3.0
%{__make}


%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}

# Icon for the desktop file
%{__install} -D -p -m 0644 Ticon.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

# Wrapper for the desktop file
%{__ln_s} opengl-game-wrapper.sh %{buildroot}%{_bindir}/%{name}-wrapper

%{__cat} > %{name}.desktop << EOF
[Desktop Entry]
Name=TORCS
Comment=The Open Racing Car Simulator
Exec=%{name}-wrapper
Icon=%{name}.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Game;
EOF

%{__mkdir_p} %{buildroot}%{_datadir}/applications
desktop-file-install \
    --vendor "" \
    --dir %{buildroot}%{_datadir}/applications \
    %{name}.desktop

# We need this for proper automatic stripping to take place (still in 1.3.0)
find %{buildroot}%{_libdir}/%{name}/ -name '*.so' | xargs %{__chmod} +x


%clean
%{__rm} -rf %{buildroot}


%files
# Directory default mode of 0755 is MANDATORY, since installed dirs are 0777
%defattr(-,root,root,0755)
%doc COPYING README README.linux
%{_bindir}/*
%dir %{_libdir}/%{name}/
%dir %{_libdir}/%{name}/drivers/
# From main
%{_libdir}/%{name}/drivers/human/
# From robots-base
%{_libdir}/%{name}/drivers/cylos1/
%{_libdir}/%{name}/drivers/damned/
%{_libdir}/%{name}/drivers/inferno/
%{_libdir}/%{name}/drivers/inferno2/
%{_libdir}/%{name}/drivers/lliaw/
%{_libdir}/%{name}/drivers/tanhoj/
%{_libdir}/%{name}/drivers/tita/
%{_libdir}/%{name}/lib/
%{_libdir}/%{name}/modules/
%{_libdir}/%{name}/setup_linux.sh
%{_libdir}/%{name}/*-bin
%{_datadir}/applications/%{name}.desktop
%dir %{_datadir}/games/%{name}/
%{_datadir}/games/%{name}/config/
%dir %{_datadir}/games/%{name}/drivers/
# From main
%{_datadir}/games/%{name}/drivers/human/
# From robots-base
%{_datadir}/games/%{name}/drivers/cylos1/
%{_datadir}/games/%{name}/drivers/damned/
%{_datadir}/games/%{name}/drivers/inferno/
%{_datadir}/games/%{name}/drivers/inferno2/
%{_datadir}/games/%{name}/drivers/lliaw/
%{_datadir}/games/%{name}/drivers/tanhoj/
%{_datadir}/games/%{name}/drivers/tita/
%{_datadir}/games/%{name}/results/
%{_datadir}/games/%{name}/telemetry/
%{_datadir}/pixmaps/%{name}.png

%files robots
# Directory default mode of 0755 is MANDATORY, since installed dirs are 0777
%defattr(-,root,root,0755)
%dir %{_libdir}/%{name}/
%dir %{_libdir}/%{name}/drivers/
# From robots-berniw
%{_libdir}/%{name}/drivers/berniw/
%{_libdir}/%{name}/drivers/berniw2/
%{_libdir}/%{name}/drivers/berniw3/
%{_libdir}/%{name}/drivers/sparkle/
# From robots-bt
%{_libdir}/%{name}/drivers/bt/
# From robots-olethros
%{_libdir}/%{name}/drivers/olethros/
%dir %{_datadir}/games/%{name}/
%dir %{_datadir}/games/%{name}/drivers/
# From robots-berniw
%{_datadir}/games/%{name}/drivers/berniw/
%{_datadir}/games/%{name}/drivers/berniw2/
%{_datadir}/games/%{name}/drivers/berniw3/
%{_datadir}/games/%{name}/drivers/sparkle/
# From robots-bt
%{_datadir}/games/%{name}/drivers/bt/
# From robots-olethros
%{_datadir}/games/%{name}/drivers/olethros/


%changelog
* Mon Oct 22 2007 Matthias Saou <http://freshrpms.net/> 1.3.0-4
- Use opengl-games-utils provided wrapper in the desktop file (#304831).

* Thu Aug 23 2007 Matthias Saou <http://freshrpms.net/> 1.3.0-3
- Rebuild for new BuildID feature.
- Update Source URLs s/dl.sf.net/downloads.sf.net/.

* Mon Aug  6 2007 Matthias Saou <http://freshrpms.net/> 1.3.0-2
- Update License field.
- Minor spec file cleanups.
- Minor desktop file cleanups.

* Fri Nov 10 2006 Matthias Saou <http://freshrpms.net/> 1.3.0-1
- Update to 1.3.0.
- Remove no longer needed track.cpp patch1.
- Remove no longer needed extraqualif patch2.

* Mon Aug 28 2006 Matthias Saou <http://freshrpms.net/> 1.2.4-4
- FC6 rebuild.

* Fri Mar 10 2006 Matthias Saou <http://freshrpms.net/> 1.2.4-3
- Remove patch that disabled checking for openal, since it also disabled
  linking against it, and caused nasty things to happen.
- Include track.cpp patch from Debian.
- Explicitly set X includes and libraries with modular X, since otherwise
  configure checks fail badly (first libm, then all X libs...).
- Add missing modular X build requirements.
- Include patch to fix one extra qualifification error with gcc 4.1.

* Wed Mar  1 2006 Matthias Saou <http://freshrpms.net/> 1.2.4-2
- Add support for modular X on FC >= 5.
- Include patches to rebuild against new openal and freealut (#179614).

* Wed Oct 12 2005 Matthias Saou <http://freshrpms.net/> 1.2.4-1
- Update to 1.2.4.
- Add torcs-data-tracks-road requirement directly to main torcs.
- Drop no longer needed TORCS-1.2.3-64bit.patch.
- Add openal-devel build dependency.

* Wed Aug  3 2005 Matthias Saou <http://freshrpms.net/> 1.2.3-5
- Move base robots from the sub-package to the main one to have the default
  quick race work. Hopefully this will change in later versions if the game
  checks which drivers are available before starting the default quick race.
- Add torcs-data-cars-extra requirement for the same reason as above : Without,
  none of the drivers of the default quick race have a car and the game exits.
- Add olethros robots.
- Change %%files section to explicitly list all robots since the above change
  moved many of them to the main package, not just "human".
- Renamed 64bit patch to TORCS-1.2.3-64bit.patch.

* Thu May 26 2005 Jeremy Katz <katzj@redhat.com> - 1.2.3-4
- fix build on 64bit arches

* Sun May 22 2005 Jeremy Katz <katzj@redhat.com> - 1.2.3-3
- rebuild on all arches

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net> 1.2.3-2
- rebuilt

* Mon Feb  7 2005 Matthias Saou <http://freshrpms.net/> 1.2.3-1
- Update to 1.2.3.
- Remove billy and K1999 robot packages (no longer upstream).
- Update plib requirement from plib16 to plib (1.8.x).
- Remove %%{?_smp_mflags} as the build fails with -jN.

* Fri Nov  5 2004 Matthias Saou <http://freshrpms.net/> 1.2.2-4
- Add +x chmod'ing to .so files in order to get them stripped properly.

* Mon Oct 25 2004 Matthias Saou <http://freshrpms.net/> 1.2.2-3
- Remove un-needed /sbin/ldconfig calls.

* Fri Jul 23 2004 Matthias Saou <http://freshrpms.net/> 1.2.2-3
- Change build dependency of plib to compat package plib16-devel as
  rebuilding against 1.8 is not currently possible.
- Add patch for -fPIC to fix x86_64 build (hmm, doesn't work).

* Thu May 20 2004 Matthias Saou <http://freshrpms.net/> 1.2.2-2
- Rebuild for Fedora Core 2.
- Change XFree86 deps to xorg-x11 and glut to freeglut.

* Thu Feb 26 2004 Matthias Saou <http://freshrpms.net/> 1.2.2-1
- Update to 1.2.2.
- No longer require compat-libstdc++-devel for building.
- This version broke %%makeinstall, so switch to DESTDIR method.
- Re-enabled K1999 build, it works again.
- Added new robots : billy and bt.

* Tue Jan 13 2004 Matthias Saou <http://freshrpms.net/> 1.2.1-4
- Work around the XFree86 dependency problem by adding XFree86-Mesa-libGLU.

* Tue Dec  2 2003 Matthias Saou <http://freshrpms.net/> 1.2.1-3
- Rebuild for Fedora Core 1.
- Disabled build of the K1999 driver (strstream.h seems obsolete).

* Tue May 27 2003 Matthias Saou <http://freshrpms.net/>
- Added a torcs requirement to the robots package.

* Wed Apr 23 2003 Matthias Saou <http://freshrpms.net/>
- Initial RPM release.