File xgalaga.spec of Package xgalaga

#
# spec file for package xgalaga (Version 2.0.34)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           xgalaga
BuildRequires:  xorg-x11 xorg-x11-devel
Url:            http://sourceforge.net/projects/xgalaga/
License:        GPL v2 or later
Group:          Amusements/Games/Action/Arcade
Provides:       xgal 
AutoReqProv:    on
PreReq:         permissions
Version:        2.0.34
Release:        1087
Summary:        A Galaga-clone for X11
Source:         xgalaga-%{version}.tar.bz2
Patch:          xgalaga-%{version}.patch
Patch1:         xgalaga-%{version}-security.patch
Patch2:         xgalaga-%{version}-gcc4.patch
Patch3:         xgalaga-%{version}-strict_alias.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define gamedir /var/games/xgalaga
%if "%(xft-config --prefix)" == "/usr"
%define _xorg7libs %_lib
%define _xorg7libs32 lib
%define _xorg7bin bin
%define _xorg7_mandir %_mandir
%define _xorg7pixmaps include
%define _xorg7libshare share
%define _xorg7_xkb /usr/share/X11/xkb
%define _xorg7_termcap /usr/lib/X11/etc
%define _xorg7_serverincl /usr/include/xorg
%define _xorg7_fonts /usr/share/fonts
#%define _xorg7_config /usr/share/X11/config #use libshare macro
%define _xorg7_prefix /usr
%else
%define _xorg7libs X11R6/%_lib
%define _xorg7libs32 X11R6/lib
%define _xorg7bin X11R6/bin
%define _xorg7_mandir /usr/X11R6/man
%define _xorg7pixmaps X11R6/include
%define _xorg7libshare X11R6/lib/
%define _xorg7_xkb /etc/X11/xkb
%define _xorg7_termcap /usr/X11R6/lib/X11/etc
%define _xorg7_serverincl /usr/X11R6/lib/Server/include
%define _xorg7_fonts /usr/X11R6/lib/X11/fonts
#%define _xorg7_config /usr/X11R6/lib/X11/config #use libshare macro
%define _xorg7_prefix /usr/X11R6
%endif

%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
%patch
%patch1 -p1
%patch2 -p1
%patch3

%build
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
CFLAGS=${RPM_OPT_FLAGS} \
./configure --prefix=%{gamedir} --exec-prefix=/usr/%{_xorg7bin} \
	%{_target_cpu}-suse-linux --with-xpm-lib=/usr/%{_xorg7libs}
make %{?jobs:-j%jobs}

%install
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
make install prefix=$RPM_BUILD_ROOT%{gamedir} \
	exec_prefix=$RPM_BUILD_ROOT/usr/%{_xorg7bin}

%clean
rm -rf $RPM_BUILD_ROOT

%post
%run_permissions
%verifyscript
%verify_permissions -e /usr/%{_xorg7bin}/xgalaga

%files
%defattr(-,root,root)
%doc CHANGES COPYING INSTALL README README.SOUND
%verify(not mode) %attr(0755,games,games) /usr/%{_xorg7bin}/xgalaga
%attr(0664,games,games) %gamedir/scores
%dir %gamedir
%gamedir/levels
%gamedir/sounds
%gamedir/xgal.sndsrv.linux

%changelog
* Fri Jun 19 2009 coolo@novell.com
- disable as-needed for this package as it fails to build with it
* Fri Jul 28 2006 lmichnovic@suse.cz
- builds also with new X.org 7.x, detecting prefix in X.org
- building with icecream
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Sep 27 2005 lmichnovic@suse.cz
- fixed strict aliasing
* Wed Apr 27 2005 ltinkl@suse.cz
- fix build with gcc4
* Mon Jan 12 2004 adrian@suse.de
- and fix the build again ...
* Sat Jan 10 2004 adrian@suse.de
- add %%defattr
* Mon Nov 03 2003 ltinkl@suse.cz
- package according to permissions.secure and call run_permissions
* Fri Jul 11 2003 ltinkl@suse.cz
- fix possible buffer overflow [#27651]
- repackaged sources as tar.bz2
* Sun Aug 04 2002 ro@suse.de
- group name changed "game" -> "games"
* Tue Mar 12 2002 tcrhak@suse.cz
- fixed permisions of xgalaga binary (bug #14716)
* Tue May 22 2001 pblaha@suse.cz
- fix cast warning on ia64
* Mon Apr 02 2001 uli@suse.de
- small fix for gcc >2.96
* Thu Nov 23 2000 pblaha@suse.cz
- solved probles with playing sound by  open(dspdev, O_WRONLY);
* Thu Nov 23 2000 pblaha@suse.cz
-  with option -nosound is not started sound server
* Wed May 24 2000 bubnikv@suse.cz
- filled Group: tag
- moved /var/lib/games to /var/games
* Sat Mar 04 2000 kasal@suse.de
- renamed and updated package from xgal to xgalaga, now GPL'd
* Mon Sep 13 1999 bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Sep 11 1998 ro@suse.de
- catch strdup for glibc
* Fri Oct 10 1997 rj@suse.de
- works with (a)build
* Sun Jun 08 1997 rj@suse.de
- new package version 1.6c (Shareware)
openSUSE Build Service is sponsored by