Blob Blame History Raw
%define snapshot 20060225
Name:           duel3
Version:        0.1
Release:        0.4.%{snapshot}%{?dist}
Summary:        One on one spaceship duel in a 2D arena
Group:          Amusements/Games
License:        BSD
URL:            http://ts-games.com/duel3.php
Source0:        http://downloads.sourceforge.net/%{name}/Duel3_%{snapshot}_src.zip
Source1:        http://downloads.sourceforge.net/%{name}/Duel3_%{snapshot}_bin.zip
Source2:        %{name}.desktop
Source3:        %{name}.png
Source4:        music-credits.txt
Patch0:         Duel3_20060225-fixes.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  alleggl-devel dumb-devel libGLU-devel desktop-file-utils
Requires:       hicolor-icon-theme opengl-games-utils

%description
The sudden attack from the Martain Rim miners caught the Earth by suprise,
there was no way the meager Earth Space Fleet could defend themselves. The
miners attacked, and eliminated their enemies, and then returned to the
asteroid belt. However, Earth could not accept such an embarrassing defeat. The
military developed new space fighters, and trained several squadrons of elite
pilots. The task force was then deployed against the miners. These trained
pilots utterly defeated the miners in a matter of weeks, and the first space
war in human history was finished.

The military, however, now had a new problem on their hands. These new elite
pilots were becoming restless, and there was no way for them to test their
skills. The military dare not disband the force, or let their skills dull, so
the Duel Combat League was formed. The newly formed league quickly became the
premier entertainment form on the planet, and the military's largest source of
income.

Take control of a Duel fighter, and test your skills againt your opponents and
the arena itself in fast-paced space combat.


%prep
%setup -q -a 1 -n Duel3_%{snapshot}_src
mv Duel3_%{snapshot}_bin/* Source
cp %{SOURCE4} .
%patch0 -p1 -z .fixes
sed -i 's/\r//' Source/readme.txt license.txt music-credits.txt


%build
pushd Source
make %{?_smp_mflags} PREFIX=%{_prefix} \
  CFLAGS="$RPM_OPT_FLAGS -fsigned-char -Wno-deprecated-declarations -Wno-non-virtual-dtor"
popd


%install
rm -rf $RPM_BUILD_ROOT
pushd Source
make install PREFIX=$RPM_BUILD_ROOT%{_prefix}
popd
ln -s opengl-game-wrapper.sh $RPM_BUILD_ROOT%{_bindir}/%{name}-wrapper

# 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 \
  %{SOURCE2}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps
install -p -m 644 %{SOURCE3} \
  $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 Source/readme.txt license.txt music-credits.txt
%{_bindir}/%{name}*
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/64x64/apps/%{name}.png


%changelog
* Tue Sep 25 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.1-0.4.20060225
- Use opengl-games-utils wrapper to show error dialog when DRI is missing

* Sat Mar 10 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.1-0.3.20060225
- Fixup .desktop file categories for games-menus usage

* Sat Feb  3 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.1-0.2.20060225
- Add missing "Requires: hicolor-icon-theme" (bz 226729)
- Add music-credits.txt, properly giving credits for the used music (bz 226729)

* Thu Jan 25 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 0.1-0.1.20060225
- Initial Fedora Extras package, many thanks to my students Albert-Jan Visser
  and Bas Meel for doing the Linux port of this!