Name:         black-box
License:      GPL
Group:        Applications/Games
Summary:      Find the crystals
Summary(ja):  隠された水晶の位置を推測するパズルゲーム
Version:      1.4.8
Release:      1%{?_dist_release}
URL:          http://www.linux-games.com/black-box/
Source:       %{name}-%{version}.tar.gz
Source1:      %{name}.xpm
Source2:      %{name}.desktop
Source3:      %{name}.6
Patch1:       black-box-1.4.3-maxpath.dif
Patch3:       black-box-1.4.3-config.patch
BuildRoot:    %{_tmppath}/%{name}-%{version}-build

BuildRequires: automake
BuildRequires: autoconf
BuildRequires: SDL-devel
BuildRequires: SDL_mixer-devel
BuildRequires: SDL_image-devel
BuildRequires: libpng-devel
Requires: SDL
Requires: SDL_mixer
Requires: SDL_image
Requires: libpng

Vendor: Project Vine
Distribution: Vine Linux
Packager: OOI Keita <ooik.ovwqlsjxcqwg4dc@privango.jp>

%description
There's a black box. You can shoot in and watch, where the shot leaves
the box. In the box, crystals are reflecting the shots. You have to
guess where the crystals are hidden, by watching your shots.

%description -l ja
ブラックボックスに光線をあてると、光の跡が残ります。
箱の中にある水晶が、光を反射しているのです。
光の跡を手がかりにに、水晶が隠されている場所を推測しなければなりません。

%prep
%setup
%patch1
%patch3 -p0 -b .config

%build
aclocal
automake -a
autoconf
#CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" ./configure --prefix=%{_prefix}
%configure --prefix=%{_prefix}
make

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

# add desktop icon
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/pixmaps
install -p -m0644 %{SOURCE1} $RPM_BUILD_ROOT/%{_datadir}/pixmaps/%{name}.xpm

# add desktop
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
install -p -m0644 %{SOURCE2} $RPM_BUILD_ROOT/%{_datadir}/applications/%{name}.desktop

# add man
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man6
install -p -D -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}/%{_mandir}/man6/%{name}.6


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog README NEWS
%{_bindir}/%{name}
%{_datadir}/black-box
%{_datadir}/pixmaps
%{_datadir}/applications
%{_mandir}/man6

%changelog -n black-box
* Tue Feb 14 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.4.8-1
- update to 1.4.8
- remove Patch0,2
- add BuildRequires: SDL_image-devel

* Sat Sep 06 2008 Shu KONNO <owa@bg.wakwak.com> 1.4.3-2vl5
- applied new versioning policy, spec in utf-8
- added black-box-1.4.3-config.patch

* Tue Oct 3 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 1.4.3-1vl2
- rebuilt for Vine Linux 4.0
- changed Group to Applications/Games

* Sun Feb 6 2005 OOI Keita <ooik.ovwqlsjxcqwg4dc@privango.jp> - 1.4.3-1vl1
- initial build
- patchs (and source) from suse
- man from deb
- add desktop and icon