Name:		trackballs
Version:	1.1.4
Release:	3%{?_dist_release}
Summary:	Steer a marble ball through a labyrinth
Summary(ja):	ボールを転がして迷路を抜けるゲーム

Group:          Applications/Games
License:        GPLv2+
URL:            http://trackballs.sourceforge.net/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Patch0:         trackballs-1.1.4-destdir.patch
Patch1:         trackballs-1.1.4-black-vertices-fix.patch
Patch2:         trackballs-1.1.4-rh555877.patch
Patch3:			trackballs-1.1.4-guile20.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  guile-devel libGLU-devel zlib-devel desktop-file-utils
BuildRequires:  SDL_ttf-devel SDL_mixer-devel SDL_image-devel
Requires:	hicolor-icon-theme
Requires:	trackballs-music

%description
Trackballs is a game in which you steer a marble ball through tracks of varying
difficulty. The game features 3D graphics, an integerated level editor and high
quality soundeffects and background music.

%description -l ja
Trackballs は色々な難易度の迷路を、ボールを転がして迷路を抜ける
ゲームです。このゲームには、3D グラフィック表示や内蔵のレベル
(コース)エディタ、高品質の効果音や BGM が含まれています。


%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
iconv -f ISO-8859-1 -t UTF8 share/%{name}.6 > share/%{name}.6.tmp
mv share/%{name}.6.tmp share/%{name}.6
# the install script does a chgrp to 'games', this doesn't work while
# building as a user. Is group=games required?
sed -i "s/chgrp/#chgrp/g;" share/Makefile*


%build
%configure --with-highscores="~"
sed -i 's|^mkinstalldirs.*|mkinstalldirs=$(MKINSTALLDIRS)|g' po/Makefile
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%find_lang %{name}

# remove the broken upstream provided desktop file and use our own.
rm $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop
desktop-file-install --vendor vine \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE1}


%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 -f %{name}.lang
%doc AUTHORS COPYING ChangeLog FAQ README TODO
%defattr(-,root,root,-)
%{_bindir}/%{name}*
%{_datadir}/%{name}
%{_mandir}/man6/%{name}.6.gz
%{_datadir}/applications/vine-%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png


%changelog
* Sat Jul 09 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.4-3
- rebuild with gcc-5.4.0

* Sun Jan 25 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.1.4-2
- rebuild with guile-2.0.11
- add Patch3 (trackballs-1.1.4-guile20.patch) from fedora

* Mon Jan 03 2011 Kazutaka HARADA <kazutaka@vinelinux.org> 1.1.4-1
- initial build for Vine Linux based on fedora development

* Mon Feb 22 2010 Hans de Goede <hdegoede@redhat.com> 1.1.4-12
- Fix FTBFS (automake rerunning due to patches, #564762)

* Mon Jan 18 2010 Hans de Goede <hdegoede@redhat.com> 1.1.4-11
- Fix a crash when trying to change to an unsupported resolution (#555877)
- Add widescreen monitor resolutions to the monitor resolution list

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Jan 20 2009 Hans de Goede <hdegoede@redhat.com> 1.1.4-8
- Adjust font requires for font rename (rh 480476)

* Sat Dec 27 2008 Hans de Goede <hdegoede@redhat.com> 1.1.4-7
- Replace included gnu freefont copy with a symlink to dejavu (rh 477470)

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.1.4-6
- Autorebuild for GCC 4.3

* Sun Jan 13 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.4-5
- Fix building with gcc 4.3

* Thu Jan  3 2008 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.4-4
- Fix black vertices on ATI cards with OSS drivers

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

* Wed Aug 15 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.4-2
- Update License tag for new Licensing Guidelines compliance

* Tue Jun  5 2007 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.4-1
- New upstream release 1.1.4

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

* Tue Aug 29 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.2-3
- FE6 Rebuild

* Tue Aug 15 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.2-2
- Remove some redundant BR's

* Mon Aug 14 2006 Hans de Goede <j.w.r.degoede@hhs.nl> 1.1.2-1
- Initial Fedora Extras version
