Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > media > contrib-src > by-pkgid > d052b33145467f70ea48be2e8fe088c2 > files > 3

4stAttack-2.1.2-1mdk.src.rpm

%define name 4stAttack
%define version 2.1.2
%define release 1mdk

Summary:	Connect-four for pygame.
Name:		%{name}
Version:	%{version}
Release:	%{release}
Group:		Games/Boards
License:	GPL
URL: 		http://forcedattack.sourceforge.net
Source:		http://belnet.dl.sourceforge.net/sourceforge/forcedattack/%{name}-%{version}.tar.bz2
Source2:	%{name}-icons.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-buildroot
Prefix:		%{_prefix}
Requires:	pygame
BuildArch:	noarch

%description

4stAttack is a game in which you have to try to out-smart your opponent.
The goal of the game is to connect four of stones in  a  straight  line.
This can be horizontaly, vertically or diagonally.

This rpm works with the portable pygame game-engine.
 

%prep
rm -rf $RPM_BUILD_ROOT
%setup -q
%setup -q -T -D -a2

%build
# icon
install -D -m 644 %{name}48.png $RPM_BUILD_ROOT%{_liconsdir}/%{name}.png
install -D -m 644 %{name}32.png $RPM_BUILD_ROOT%{_iconsdir}/%{name}.png
install -D -m 644 %{name}16.png $RPM_BUILD_ROOT%{_miconsdir}/%{name}.png

%install
mkdir -p $RPM_BUILD_ROOT%{_prefix}/games/%{name}
cp -R * $RPM_BUILD_ROOT%{_prefix}/games/%{name}

# Lets make a wrapper.
mkdir -p %{buildroot}%{_bindir}
cat << EOF > %{buildroot}%{_bindir}/%{name}
#!/bin/sh
cd %{_prefix}/games/%{name}

if [ ! -f ~/.%{name} ]; then
    cp settings.ini ~/.%{name} || exit 1
fi

python 4stattack.py -ini ~/.%{name}
EOF

# Menu entry
install -m 755 -d $RPM_BUILD_ROOT%{_menudir}
cat << EOF > $RPM_BUILD_ROOT%{_menudir}/%{name}
?package(%{name}):\
needs="x11"\
section="Amusement/Boards"\
title="%{name}"\
longtitle="Connect-four for pygame"\
command="%{name}"\
icon="%{name}.png"
EOF


%post
%{update_menus}
%{make_session}

%postun
%{clean_menus}
%{update_menus}
%{make_session}

%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(644,root,root,755)
%doc changelog.txt README.txt
%{_prefix}/games/%{name}/*

%{_menudir}/%{name}

%{_liconsdir}/%{name}.png
%{_iconsdir}/%{name}.png
%{_miconsdir}/%{name}.png
#
%defattr(755,root,root)
%{_bindir}/%{name}


%changelog
* Mon Sep 23 2002 Han Boetes <han@linux-mandrake.com> 2.1.2-1mdk
- While I was making the rpm I found a bug and the author fixed  it  so:
  Bump to next release
- Silly mistakes
- Icons and menu-entry

* Fri Sep 20 2002 Han Boetes <han@linux-mandrake.com> 2.1.1-1mdk
- Bump

* Wed May 29 2002 Han Boetes <han@mijncomputer.nl> 2-0.20020529.1mdk
- test release

* Fri May 24 2002 Han Boetes <han@mijncomputer.nl> 2-0.alpha.1mdk
- Initial MDK built