Summary:        A Galaga-clone for X11
Name:           xgalaga
Version:        2.1.1.0
Release:        1%{?_dist_release}
Source:         xgalaga-%{version}.tar.gz
Source1:       http://ftp.de.debian.org/debian/pool/main/x/xgalaga/xgalaga_2.1.1.0-3.diff.gz
# SOURCE10:       xgalaga.desktop
# SOURCE11:       xgalaga-hyperspace.desktop
# SOURCE12:       xgalaga-icon.xpm
Url:            http://sourceforge.net/projects/xgalaga/
License:        GPLv2+
Group:          Applications/Games

BuildRequires:  libtool
BuildRequires:  libX11-devel libXpm-devel libXt-devel libXmu-devel
BuildRequires:  desktop-file-utils

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A clone of the old space arcade game 'Galaga'.	(It's Galaga, you know
how to play Galaga!  Ship follows the mouse, button fires.  Autofire by
holding it down, so no one accuses us of breaking their mouse!)



%prep
%setup -q
zcat %{SOURCE1} | patch

## checking host system type... Invalid configuration 
## 'X86_64-unknown-linux-gnu': machiene 'X86_64-unknown' not recognized
%__ln_s -f %{_datadir}/libtool/config/config.guess || exit 1
%__ln_s -f %{_datadir}/libtool/config/config.sub || exit 1

%build
CFLAGS=${RPM_OPT_FLAGS} \
    %configure \
        --prefix=%{_datadir}/games/xgalaga \
        --exec-prefix=%{_bindir} \
	--with-sound \
	;
%__make %{?_smp_mflags};
#SOUNDDEFS=-DSOUNDSERVER=\"%{_libdir}/games/xgalaga/$(SOUNDSRV)\" \

%install
%__mkdir_p ${RPM_BUILD_ROOT}%{_mandir}/man6
%__make install \
    DESTDIR=${RPM_BUILD_ROOT} \
    ;

## install desktop menus
%__mkdir_p ${RPM_BUILD_ROOT}%{_datadir}/applications
%__mkdir_p ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/
desktop-file-install --dir %{buildroot}%{_datadir}/applications xgalaga.desktop || exit 1
desktop-file-install --dir %{buildroot}%{_datadir}/applications xgalaga-hyperspace.desktop || exit 1
%__cp -a xgalaga-icon.xpm %{buildroot}%{_datadir}/pixmaps/ || exit 1

%clean
%__rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc CHANGES INSTALL README README.SOUND
%{_bindir}/xgalaga
%{_bindir}/xgalaga-hyperspace
%dir %{_datadir}/games/xgalaga
%{_datadir}/games/xgalaga/CREDITS
%{_datadir}/games/xgalaga/levels
%{_datadir}/games/xgalaga/sounds
#%{_datadir}/games/xgalaga/xgal.sndsrv.linux
%{_datadir}/games/xgalaga/xgal.sndsrv.oss
%{_mandir}/man*/*
%{_datadir}/applications/xgalaga.desktop
%{_datadir}/applications/xgalaga-hyperspace.desktop
%{_datadir}/pixmaps/xgalaga-icon.xpm

%changelog
* Mon Aug 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2.1.1-1
- initial build
