Blob Blame History Raw
%define prever rc4

Name:           quake3
Version:        1.34
Release:        0.3.%{prever}%{?dist}
Summary:        Quake 3 Arena tournament 3D shooter game
Group:          Amusements/Games
License:        GPLv2+
URL:            http://ioquake3.org/
# to regenerate (note included systemlib copies are removed for size, lcc
# is removed as it is not Free software):
# svn co svn://svn.icculus.org/quake3/tags/%{version}-%{prever} %{name}-%{version}-%{prever}
# pushd %{name}-%{version}-%{prever}
# rm -fr `find -name .svn` code/AL code/SDL12 code/libcurl code/libs
# mv code/jpeg-6/jmemnobs.c .; rm code/jpeg-6/*; mv jmemnobs.c code/jpeg-6
# rm -fr code/tools/lcc
# popd
# tar cvfj %{name}-%{version}-%{prever}.tar.bz2 %{name}-%{version}-%{prever}
Source0:        %{name}-%{version}-%{prever}.tar.bz2
Source1:        %{name}-demo.sh
Source2:        %{name}.autodlrc
Source3:        %{name}.desktop
Source4:        %{name}.png
Patch0:         %{name}-1.34-syslibs.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  SDL-devel libXt-devel openal-devel libjpeg-devel
BuildRequires:  libvorbis-devel curl-devel desktop-file-utils
%ifarch %{ix86} x86_64
BuildRequires:  nasm
%endif
Requires:       hicolor-icon-theme autodownloader opengl-games-utils unzip

%description
This package contains the Quake 3 Arena engine. It comes with an applications
menu entry, which will offer to download and install the Quake 3 demo datafiles
for you. If you own a copy of quake 3, you will need to copy the pak?.pk3 files
from the original 1.32 Quake 3 Arena point release as well as pak0.pk3 from the
original CD-ROM to /usr/share/quake3/baseq3 or ~/.q3a/baseq3.


%prep
%setup -q -n %{name}-%{version}-%{prever}
%patch0 -p1 -b .syslibs


%build
# the CROSS_COMPILING=1 is a hack to not build q3cc and qvm files
# since we've stripped out q3cc as this is not Free Software.
make %{?_smp_mflags} \
    OPTIMIZE="$RPM_OPT_FLAGS -fno-strict-aliasing -ffast-math" \
    DEFAULT_BASEDIR=%{_datadir}/%{name} USE_CODEC_VORBIS=1 \
    USE_LOCAL_HEADERS=0 BUILD_GAME_SO=0 GENERATE_DEPENDENCIES=0 \
    CROSS_COMPILING=1


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}

install -m 755 build/release-linux-*/ioquake3.* \
  $RPM_BUILD_ROOT%{_bindir}/quake3
install -m 755 build/release-linux-*/ioquake3-smp.* \
  $RPM_BUILD_ROOT%{_bindir}/quake3-smp
install -m 755 build/release-linux-*/ioq3ded.* \
  $RPM_BUILD_ROOT%{_bindir}/q3ded
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/quake3-demo
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}

# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE3}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
install -p -m 644 %{SOURCE4} \
  $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps


%clean
rm -rf $RPM_BUILD_ROOT


%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
   %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi


%files
%defattr(-,root,root,-)
%doc BUGS ChangeLog COPYING.txt id-readme.txt md4-readme.txt NOTTODO README
%doc TODO code/jpeg-6/README
%{_bindir}/%{name}*
%{_bindir}/q3ded
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png


%changelog
* Thu Sep 27 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.34-0.3.rc4
- Update autodlrc file to use fast mirrors instead of the slow and unreliable
  official ID software site

* Tue Sep 25 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.34-0.2.rc4
- Use autodownloader to download demo files, thus making the game playable
  without the original CD
- Submit for Fedora inclusion now that the game is playable without the CD
- Update to 1.34-rc4
- Use system libjpeg, system SDL, OpenAL and curl headers

* Mon Sep 18 2006 Matthias Saou <http://freshrpms.net/> 1.34-0.1.rc2.svn908
- Update to today's svn code (rev. 908), rc2 from the 1.34 branch.

* Mon May 29 2006 Matthias Saou <http://freshrpms.net/> 1.34-0.1.rc1.svn792
- Update to today's svn code (rev. 792).
- Update the nostrip patch.
- Fix wrapper script since the binary has been renamed from quake3 to
  ioquake3.<arch>, which we rename to plain ioquake3 (in the patch).
- Include new documentation.

* Fri Mar 17 2006 Matthias Saou <http://freshrpms.net/> 1.34-0.1.rc1.svn649
- Update to today's svn code (rev. 649).
- Update nostrip patch, now pass OPTFLAGS to the build too.
- Build requires subversion (required for make dist).

* Fri Jan 13 2006 Matthias Saou <http://freshrpms.net/> 1.33-0.2.svn470
- Update to today's svn sode (rev. 470).
- Add modular xorg build conditional.
- Revisit nostrip patch for the new code.
- Add (new?) openal-devel build requirement.
- Update %%doc files.

* Sun Nov 13 2005 Matthias Saou <http://freshrpms.net/> 1.33-0.1.svn338
- Update to GPL'ed 1.33 and spec file cleanup.

* Sun Oct 15 2000 Matthias Saou <http://freshrpms.net/> 1.17-1
- Initial RPM based on Loki's 1.17 point release