%define pkgrel 2

%define with_my_japo 0

Summary:	The Legend of Edgar - 2D Platform Game
Name:		edgar
Version:	1.02
Release:	1%{?_dist_release}
Source:		%{name}-%{version}-%{pkgrel}.tar.gz

## vine
%if %{with_my_japo}
Source100:      edgar-0.46-ja.po
%endif

Patch:		edgar-0.93-build-failure.patch

URL:		http://www.parallelrealities.co.uk/projects/edgar.php
Group:		Applications/Games
License:	GPLv2

BuildRequires:	SDL-devel
BuildRequires:	SDL_image-devel
BuildRequires:	SDL_mixer-devel
BuildRequires:	SDL_ttf-devel
BuildRequires:	zlib-devel

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root
Packager:	munepi

%description
The Legend of Edgar. When his father fails to return home after venturing
out one stormy night, Edgar sets off on a quest to rescue him.

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

%setup -q
#%patch -p1 -b .vine

%if %{with_my_japo}
## vine
%__install -m644 %{SOURCE100} locale/ja.po
%endif


%build
%__make BIN_DIR=%{_bindir}

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

%__make install \
    DESTDIR=%{buildroot} \
    BIN_DIR=%{buildroot}%{_bindir}/

## remove unpackaged files
%__rm -rf %{buildroot}%{_datadir}/doc

%find_lang %{name}

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


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc doc/*
%dir %{_datadir}/games/edgar
%{_bindir}/edgar
%{_datadir}/applications/edgar.desktop
%{_datadir}/games/edgar/edgar.pak
%{_datadir}/icons/hicolor/*/apps/edgar.png

%changelog
* Sun Jun 24 2012 Munehiro Yamamoto <munepi@vinelinux.org> 1.02-1
- new upstream release

* Sun Apr 15 2012 Munehiro Yamamoto <munepi@vinelinux.org> 0.99-1
- new upstream release

* Thu Mar 22 2012 Munehiro Yamamoto <munepi@vinelinux.org> 0.98-1
- new upstream release

* Sat Mar  3 2012 Munehiro Yamamoto <munepi@vinelinux.org> 0.97-1
- new upstream release

* Sat Jan 21 2012 Munehiro Yamamoto <munepi@vinelinux.org> 0.96-1
- new upstream release
- dropped BuildRequires: SDL_net-devel

* Wed Nov 23 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.93-1
- new upstream release
- applied edgar-0.93-build-failure.patch

* Thu Jul 21 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.92-1
- new upstream release

* Fri Jun 24 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.87-1
- new upstream release

* Tue Mar 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.80-1
- new upstream release

* Mon Jan 03 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.73-1
- new upstream release

* Sat Oct 02 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.71-1
- new upstream release

* Sat Feb 20 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.46-1
- initial build
