%define name sdlhana
%define version 0.34
%define release 2%{?_dist_release}

Summary: An SDL-based hanafuda game.
Summary(ja): 花札ゲーム
Name: %{name}
Version: %{version}
Release: %{release}
#Source0: http://sdlhana.nongnu.org/files/%{name}-%{version}.tar.bz2
Source0: http://ftp.twaren.net/Unix/NonGNU/sdlhana/%{name}-%{version}.tar.bz2
License:  GNU GENERAL PUBLIC LICENSE
Group: Applications/Games
URL: http://sdlhana.nongnu.org/

Requires: SDL, SDL_mixer, SDL_image
BuildRequires: SDL-devel, SDL_mixer-devel, SDL_image-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Vendor: Project Vine
Distribution: Vine Linux

%description
SDLHana is an SDL-based Hanafuda game. Hanafuda is a Japanese-oriented card game which is popular in Japan and Korea.


%prep
rm -rf ${RPM_BUILD_ROOT}

%setup
./configure --prefix=%{_prefix}

%build
make

%install
make DESTDIR=${RPM_BUILD_ROOT} install

#rm ${RPM_BUILD_ROOT}/usr/games/sdlhana
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/pixmaps
install src/%{name}.xpm ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
install src/%{name} ${RPM_BUILD_ROOT}%{_bindir}/

mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/applications
cat >  ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop <<EOF
[Desktop Entry]
Name=SDL Hana
Comment=An SDL-based hanafuda game.
TryExec=sdlhana
Exec=/usr/bin/sdlhana
Icon=sdlhana.xpm
Terminal=0
Type=Application
Categories=GNOME;Application;Game
EOF


%clean
rm -rf ${RPM_BUILD_ROOT}


%files
%defattr(-,root,root)
%{_datadir}/sdlhana
%{_datadir}/pixmaps/sdlhana.xpm
%{_datadir}/applications/%{name}.desktop
%attr(755,root,root) %{_bindir}/sdlhana


%changelog
* Fri Sep 02 2016 Toshiaki Ara <ara_t@384.jp> 0.34-2
- rebuild with gcc-5.4.0

* Sat Oct 17 2009 Shu KONNO <owa@bg.wakwak.com> 0.34-1
- updated sdlhana to 0.34
- changed source url

* Sat Oct 11 2008 Shu KONNO <owa@bg.wakwak.com> 0.32-1vl5
- applied new versioning policy, spec in utf-8

* Sun Jun 3 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 0.32-0vl2
- rebuild for VineSeed

* Tue Mar 9 2007 Munehiro Yamamoto <myamamoto@g.math.s.chiba-u.ac.jp> 0.32-0vl1
- initial build for Vine Linux

# * Sun Mar 5 2006 0.32-0vlmp1
# - Update

# * Sun Feb 5 2006 0.1-0vlmp1
# - initial build for Vine Linux

# end of file
