%define ver	0.9

Name:           ufo2000
Summary:        Multiplayer tactical remake of X-COM: UFO Defense (UFO: Enemy Unknown)
Version:        0.9.1142
Release:	%mkrel 1
Source0:        %{name}-%{version}-src.tar.bz2
Source1:	%{name}.desktop
Patch0:		%{name}-%{version}-makefile-fix.patch
URL:            http://ufo2000.sourceforge.net/
Group:          Games/Strategy
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot 
License:        GPLv2

Requires:       allegro >= 4.0.0
Requires:       dumb = 0.9.2
Requires:       expat
Requires:       libfreetype6
Requires:       libhawknl1
Requires:       libpng
Requires:       libvorbis
Requires:       zlib1

BuildRequires:  dumb-devel
BuildRequires:  liballegro-devel
BuildRequires:  libexpat1-devel
BuildRequires:  libfreetype6-devel
BuildRequires:  libhawknl-devel
BuildRequires:  libvorbis-devel
BuildRequires:  zlib1-devel


%description
UFO2000 is free and opensource turn based tactical squad simulation multiplayer
game. It is heavily inspired by the famous X-COM: UFO Defense game. While
UFO2000 engine was specifically designed to be compatible with the graphics
resources and maps from X-COM, you don't need any proprietary data files to
play as a new fan-made set of graphics exists and is included in UFO2000
distribution by default.


%prep 
%setup -q -n %{name}-%{version}
%patch0 -p0

%build 
%make
%make server

%install
rm -rf $RPM_BUILD_ROOT
export DESTDIR=$RPM_BUILD_ROOT
%makeinstall
mkdir -p %{buildroot}%{_datadir}/applications/
install -m 0644 %{_sourcedir}/%{name}.desktop -D %{buildroot}%{_datadir}/applications/
rm -Rf $RPM_BUILD_ROOT/%{_datadir}/%{_gamesdir}/%{name}/{*txt,COPYING,INSTALL,AUTHORS,debian}

%clean 
rm -rf $RPM_BUILD_ROOT

%files 
%defattr(-,root,root) 
/usr/%{_gamesdir}/%{name}
/usr/%{_gamesdir}/%{name}-srv
%{_datadir}/%{_gamesdir}/%{name}/*
%{_datadir}/applications/%{name}.desktop
%doc AUTHORS readme*txt HACKING techinfo.txt

%changelog
* Fri Jul 10 2010 Johnny A. Solbu <johnny@solbu.net>
- makefile patch.
    Removed svn commands. For some reason 'make install' rely on the source is from svn.
    Fixed other 'make install' (makefile) issiues.

* Tue Mar 30 2010 Olav Dahlum <odahlum@gmail.com>
- Edited specfile

* Tue Mar 30 2010 Johnny A. Solbu <johnny@solbu.net>
- Created specfile

