%define desktop_file 1
%define desktop_file_utils_version 0.2.90

Summary: Chromium B.S.U. is a fast paced, arcade-style space shooter.
Name: chromium
Version: 0.9.12
Release: 21
License: Artistic
Group: Amusements/Games
URL: http://www.reptilelabour.com/software/chromium/

Source0: http://www.reptilelabour.com/software/files/chromium/chromium-src-%{version}.tar.gz
Source1: http://www.reptilelabour.com/software/files/chromium/chromium-data-%{version}.tar.gz
Source2: Chromium.desktop
Source3: Chromium-Setup.desktop
Source4: chromium.xpm

patch: chromium-0.9-config.patch
Patch1: chromium-src-0.9.12-libtool.patch
Patch2: chromium-src-0.9.12-arg.patch
Patch3: chromium-src-0.9.12-qt3.patch
Patch4: Chromium-0.9-zlib.patch
Patch5: chromium-0.9-libdir.patch

BuildPrereq: SDL-devel >= 1.2.3
BuildPrereq: XFree86-devel >= 4.2.0

%if %{desktop_file}
BuildPrereq: desktop-file-utils >= %{desktop_file_utils_version}
%endif

Requires: zlib >= 1.1.3-24

Buildroot: %{_tmppath}/%{name}-root

%description
You are captain of the cargo ship Chromium B.S.U., responsible for
delivering supplies to our troops on the front line. Your ship
has a small fleet of robotic fighters which you control from the
relative safety of the Chromium vessel.
- Do not let ANY enemy ships get past your fighters! Each enemy
ship that makes it past the bottom of the screen will attack
the Chromium, and you lose a fighter.
- Use your fighters as weapons! Crash into enemies to destroy them
before they can get past you.
- Strategic suicide is a powerful tactic! When the Chromium
launches a new fighter, it releases a high energy burst which
destroys all enemies in range.
- Self-destruct to preserve your ammunition! A double-right-click
will cause your current fighter to self-destruct. Before the
ship blows up, it ejects its ammunition so that the next fighter
can pick it up.

%prep
%setup -q -n Chromium-0.9 -a 1
%patch -p1 -b .config
%patch1 -p1 -b .libtool
%patch2 -p1 -b args
%patch3 -p1 -b .qt3
%patch4 -p1 -b .zlib
%ifarch x86_64 s390x
%patch5 -p1 -b .libdir
%endif

find . -type d -name .xvpics -exec rm -rf {} \; ||:

%build
QTDIR= && source /etc/profile.d/qt.sh

CFLAGS="$RPM_OPT_FLAGS -DGLX_GLXEXT_LEGACY" \
./configure --disable-smpeg
make

%install
rm -rf $RPM_BUILD_ROOT

make install prefix=%{_prefix} bindir=%{_bindir}

%if %{desktop_file}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications/
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/applications/x-Chromium.desktop
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/applications/x-Chromium-Setup.desktop
%else
mkdir -p $RPM_BUILD_ROOT/etc/X11/applnk/Games
install %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT/etc/X11/applnk/Games
%endif

mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps
install %{SOURCE4} $RPM_BUILD_ROOT/usr/share/pixmaps

%files
%defattr(-,root,root)
%{_bindir}/*
%{_datadir}/pixmaps/chromium.xpm
%if %{desktop_file}
%attr(644,root,root) %{_datadir}/applications/*
%else
%attr(644,root,root) /etc/X11/applnk/Games/*
%endif
/usr/games/chromium

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Wed Jan 28 2003 han Ngo <than@redhat.com> 0.9.12-21
- libdir64

* Thu Jan 23 2003 Tim Powers <timp@redhat.com> 0.9.12-20.3
- rebuild

* Sat Nov  9 2002 Than Ngo <than@redhat.com> 0.9.12-20.2
- fix some build problem

* Wed Aug 28 2002 Tim Powers <timp@redhat.com>
- rebuilt

* Sat Aug 10 2002 Elliot Lee <sopwith@redhat.com>
- rebuilt with gcc-3.2 (we hope)

* Wed Jul 24 2002 Than Ngo <than@redhat.com> 0.9.12-18
- desktop file issue (bug #69370)

* Tue Jul 23 2002 Tim Powers <timp@redhat.com> 0.9.12-17
- build using gcc-3.2-0.1

* Fri Jun 21 2002 Tim Powers <timp@redhat.com> 0.9.12-16
- automated rebuild

* Tue Jun 18 2002 Than Ngo <than@redhat.com> 0.9.12-15
- don't forcibly strip binaries

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Tue Apr 16 2002 Than Ngo <than@redhat.com> 0.9.12-13
- rebuild against new qt 3

* Thu Apr 11 2002 Bernhard Rosenkraenzer <bero@redhat.com> 0.9.12-12
- Link against correct (threaded) qt (fixes crash on closing setup)

* Wed Mar 13 2002 Than Ngo <than@redhat.com> 0.9.12-11
- zlib vulnerability (bug #61068)

* Fri Mar  8 2002 Bernhard Rosenkraenzer <bero@redhat.com> 0.9.12-10
- Rebuild in current environment
- Remove bogus build requirements on arts-devel and esound-devel, the
  current SDL does away with that.

* Fri Jan 25 2002 Than Ngo <than@redhat.com> 0.9.12-9
- fix buildrequires
- fix to build with g++ 3
- fix to build qt 3

* Wed Sep 12 2001 Tim Powers <timp@redhat.com>
- rebuild with new gcc and binutils

* Wed Jul 18 2001 Karsten Hopp <karsten@redhat.de>
- add buildprereq esound-devel (#49372)

* Tue Jul 10 2001 Elliot Lee <sopwith@redhat.com>
- Rebuild to remove libXv/libXxf86dga deps

* Fri Jun 22 2001 Preston Brown <pbrown@redhat.com>
- add buildprereqs
- build for dist

* Mon May 28 2001 Karsten Hopp <karsten@redhat.de>
- remove .xvpics from png directory

* Thu May 24 2001 Than Ngo <than@redhat.com>
- update to 0.9.12

* Wed Apr 04 2001 Karsten Hopp <karsten@redhat.de>
- add icon to desktop entries

* Tue Apr 03 2001 Karsten Hopp <karsten@redhat.de>
- Fix name of chromium-setup in kde menu

* Sat Mar 31 2001 Karsten Hopp <karsten@redhat.de>
- update to version 0.9.11
- added chromium-setup
- patched paths to get rid of shell-wrappers

* Thu Jan 11 2001 Karsten Hopp <karsten@redhat.de>
- Rebuild on IA64

* Thu Jan  4 2001 Tim Powers <timp@redhat.com>
- fixed ownership of files in file list so that it isn't owned by
  prospector

* Tue Nov 28 2000 Karsten Hopp <karsten@redhat.de>
- initial RPM