%define srcname vacuum
%define major_ver 0.13
%define minor_ver a

Name:		vacuum-magic
Version:	%{major_ver}%{minor_ver}
Release:	1%{?_dist_release}
Summary:	Vacuum Magic is a fast-paced action game
Summary(ja):	テンポの速いアクションゲーム
License:	GPL
URL:		http://apocalypse.rulez.org/vacuum
Group:		Applications/Games
Source0:	%{srcname}-%{version}.tar.gz
Source1:	%{name}.png

BuildRequires:	perl-Compress-Zlib
BuildRequires:	SDL_perl
BuildRequires:	desktop-file-utils
Requires:	perl
Requires:	SDL_perl
Requires:	perl-Compress-Zlib

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch:	noarch

%description
Vacuum Magic is a fast-paced action game.

The point of the game is using your magical vacuum field to
collect food and defend against monsters. Food and certain
monsters can also be spat out and used as a projectile
against other monsters. Vacuum Magic can be played by up to
six players, either cooperatively or against each other.

%description -l ja
Vacuum Magic はテンポの速いアクションゲームです。

魔法の吸い込み砲を使って、食料を集めたり、怪物に反撃をする。
また、飲み込んだ食料やある怪物は吐き出せて、
ほかの怪物に対して弾として使える。
Vacuum Magic は最大で 6 人同時プレイが可能で、
協力プレイまたは反撃プレイのどちらかで遊べます。


%prep
%setup -q -n %{srcname}-%{major_ver}

%build
%configure
%__make

%install
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"

%makeinstall

## rename
%__sed -i -e "s@/share/%{srcname}@/share/%{name}@g" \
    %{buildroot}/%{_bindir}/%{srcname}
%__mv %{buildroot}/%{_bindir}/%{srcname} %{buildroot}/%{_bindir}/%{name}

%__mv %{buildroot}/%{_datadir}/%{srcname} %{buildroot}/%{_datadir}/%{name}

%__mv %{buildroot}/%{_datadir}/man/man6/%{srcname}.6 \
    %{buildroot}/%{_datadir}/man/man6/%{name}.6

## NO use perl(Win32), which is required by perl(L2hos::Win32)
%__sed -i -e 's/use Win32;/## RPM requires perl(Win32)\n# use Win32;/' \
    $RPM_BUILD_ROOT%{_bindir}/%{name}


## menu
%__install -dm 755 %{buildroot}%{_datadir}/pixmaps
%__install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps
%__cat > %{name}.desktop << EOF
[Desktop Entry]
Comment=Vacuum Magic is a fast-paced action game
Name=Vacuum Magic
GenericName=Vacuum Magic
Type=Application
Exec=%{name}
Icon=%{name}
Terminal=false
Categories=GNOME;Application;Game
EOF

desktop-file-install --vendor Vine			\
	--dir $RPM_BUILD_ROOT%{_datadir}/applications	\
	--mode 644					\
	%{name}.desktop


%post
%{_bindir}/update-desktop-database %{_datadir}/applications || :


%postun
%{_bindir}/update-desktop-database %{_datadir}/applications || :


%clean
[ -d "%{buildroot}" -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"


%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog README NEWS TODO
%doc %{_mandir}/man6/%{name}.6.gz
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*.png

%changelog
* Sat Feb 20 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.13a-2
- rebuild for vl6

* Sat Aug 02 2009 Munehiro Yamamoto <munepi@vinelinux.org> 0.13a-1
- initial build

