Blob Blame History Raw
Name:           ballz
Version:        1.0
Release:        3%{?dist}
Summary:        Platform game with some puzzle elements
Group:          Amusements/Games
License:        BSD
# Was http://darkbits.org/ but that site is down
URL:            http://www.allegro.cc/forums/thread/590831
# http://darkbits.org/%{name}-%{version}.tar.gz but site is down
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Patch0:         ballz-1.0-syslibs.patch
Patch1:         ballz-1.0-fullscreen.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  dumb-devel guichan-devel desktop-file-utils automake
BuildRequires:  ImageMagick
Requires:       hicolor-icon-theme

%description
Ballz is a platformer with some puzzle elements. You take control of a ball
which is genetically modified by the British secret service. Your mission is
to rescue captured British soldiers from a prison in Iran.

The game was written in 72 hours for the TINS competition, a competition
similar to Speedhack. The name TINS is an recursive acronym for ‘TINS is
not Speedhack’.


%prep
%setup -q
%patch0 -p1 -z .syslibs
%patch1 -p1 -z .fullscreen
# we use the system version of these libs
rm -fr src/guichan* src/dumb
# remove hardcoded optflags from configure
sed -i 's/-O2 -ffast-math -fomit-frame-pointer/ -ffast-math/g' configure.ac
autoreconf -f


%build
%configure
make %{?_smp_mflags}
convert -transparent black data/%{name}.bmp %{name}.png


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# 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 \
  %{SOURCE1}
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps
install -m 644 %{name}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/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 AUTHORS README BSD-license
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop
%{_datadir}/icons/hicolor/48x48/apps/%{name}.png


%changelog
* Sat Apr  5 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.0-3
- Rebuild for new guichan

* Fri Feb 15 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.0-2
- Fix Source0 and URL for upstream's site disappearing
- Rebuild for gcc 4.3

* Tue Apr 17 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.0-1
- Initial Fedora Extras package