Blob Blame History Raw
Name: tecnoballz
Version: 0.91
Release: 6%{?dist}
Summary: A Brick Busting game

Group: Amusements/Games
License: GPLv2+
URL: http://linux.tlk.fr/games/TecnoballZ/
Source0: http://linux.tlk.fr/games/TecnoballZ/download/%{name}-%{version}.tgz
Source1: %{name}.xpm
Source2: %{name}.desktop
# Vine Linux
Patch0: tecnoballz-0.91-datadir.patch
Patch1: tecnoballz-0.91-owner.patch
# Debian
Patch2: tecnoballz-0.91-hiscorepath.patch 
# BoredByPolitics
Patch3: tecnoballz-0.91-build.patch
# Martin Michlmayr
Patch4: tecnoballz-0.91-gcc41.patch
# Upstream CVS
Patch5: tecnoballz-0.91-configfile.patch
# Hans de Goede
Patch6: tecnoballz-0.91-64-bit.patch
Patch7: tecnoballz-0.91-no-smpeg.patch
Patch8: tecnoballz-0.91-dropsgid.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: SDL_mixer-devel 
BuildRequires: libvorbis-devel 
BuildRequires: mikmod-devel 
BuildRequires: desktop-file-utils
Requires: hicolor-icon-theme


%description
TecnoballZ is a "breaking blocks" game that was first written for the
Amiga platfrom.
You'll need to break all the blocks in each level. The game is divided
into Areas which are divided into Levels. Between some levels, you
have to defeat a guardian to pass to the next level. When passing an
Area, a new edge is open. You can buy weapons and bonus between levels
with the money earned during the game.


%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p2
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1

#fix man encodig
iconv -f ASCII -t UTF-8 man/tecnoballz.1 > man/tecnoballz.1.conv && mv -f man/tecnoballz.1.conv man/tecnoballz.1
iconv -f ISO8859-1 -t UTF-8 man/tecnoballz.fr.1 > man/tecnoballz.fr.1.conv && mv -f man/tecnoballz.fr.1.conv man/tecnoballz.fr.1


%build
%configure
make %{?_smp_mflags} CXXFLAGS="$RPM_OPT_FLAGS"


%install
rm -rf %{buildroot}
%makeinstall datadir=%{buildroot}%{_datadir}/%{name} VARDIR=%{buildroot}%{_localstatedir}/games/%{name}

# install man6
mkdir -p %{buildroot}%{_mandir}/man6/
mkdir -p %{buildroot}%{_mandir}/fr/man6/
sed s/TH\ TecnoballZ/TH\ TecnoballZ\ 6/ < man/%{name}.1 > man/%{name}.6
sed s/TH\ TecnoballZ/TH\ TecnoballZ\ 6/ < man/%{name}.fr.1 > man/%{name}.fr.6
install -p -m0644 man/%{name}.6 %{buildroot}%{_mandir}/man6/%{name}.6
install -p -m0644 man/%{name}.fr.6 %{buildroot}%{_mandir}/fr/man6/%{name}.6

# install desktop file
mkdir -p %{buildroot}%{_datadir}/applications
desktop-file-install --vendor fedora         \
  --dir %{buildroot}%{_datadir}/applications \
  %{SOURCE2}

# install icon
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
install -p -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm


%clean
rm -rf %{buildroot}


%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)
%attr(2755,root,games) %{_bindir}/tecnoballz
%{_datadir}/tecnoballz
%{_mandir}/man6/tecnoballz.6*
%{_mandir}/fr/man6/tecnoballz.6*
%{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm
%{_datadir}/applications/fedora-%{name}.desktop
%doc AUTHORS CHANGES COPYING README
%attr(-,root,games) %config(noreplace) %{_localstatedir}/games/tecnoballz/tecnoballz.hi


%changelog
* Sat Aug 25 2007 Andrea Musuruane <musuruan@gmail.com> 0.91-6
- changed license due to new guidelines
- removed %%{?dist} tag from changelog
- updated icon cache scriptlets to be compliant to new guidelines
- changed desktop categories from Game;ArcadeGame; to
  Game;ArcadeGame;BlocksGame; (resolves bugzilla #250940)

* Tue Apr 03 2007 Andrea Musuruane <musuruan@gmail.com> 0.91-5
- changed summary to avoid naming trademarks.

* Sun Apr 01 2007 Andrea Musuruane <musuruan@gmail.com> 0.91-4
- corrected silly error in the %%postun script

* Sat Mar 31 2007 Andrea Musuruane <musuruan@gmail.com> 0.91-3
- added a patch by Hans de Goede to drop setgid privileges when not needed
- changed icon cache scriptles to be compliant with updated guidelines
- changed vendor to fedora in desktop-file-install

* Wed Mar 25 2007 Andrea Musuruane <musuruan@gmail.com> 0.91-2
- moved from Livna to Fedora
- added a patch by Hans de Goede to fix compiling on 64 bits (Livna #1367)
- added a patch by Hans de Goede not to require smpeg (Livna #1367)
- changed desktop category to Game;ArcadeGame
- binary setgid 'games' in order to allow a shared scoreboard file
- cosmetic changes

* Sun Dec 17 2006 Andrea Musuruane <musuruan@gmail.com> 0.91-1
- initial build for Livna based on Vine Linux package
- used icon file from Debian package
- used patches from Debian and Vine Linux packages
- used a patch by BoredByPolitics via happypenguin.org to fix building
- used a patch by Martin Michlmayr to fix compiling with gcc 4.1 (Debian
  #355841)
- used a patch from upstream to fix segfault into configfile.cc file