File nogravity.spec of Package nogravity

#
# spec file for package nogravity
#
# Copyright (c) 2015 SUSE LINUX 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/
#


Name:           nogravity
Version:        2.00
Release:        0
Summary:        Space shooter in 3D
License:        GPL-2.0+
Group:          Amusements/Games/Action/Shoot
Url:            http://sourceforge.net/projects/nogravity/
Source0:        http://downloads.sourceforge.net/%{name}/rt-%{name}-src.zip
Source2:        %{name}.desktop
Source3:        %{name}.png
Source4:        %{name}-Makefile.am
Source5:        %{name}-bootstrap
Source6:        %{name}-configure.in
Source7:        %{name}.sh
# PATCH-FIX-UPSTREAM
Patch0:         %{name}-snd_sdlmixer_c-powerpc-fix.patch
# PATCH-FIX-UPSTREAM
Patch1:         %{name}-fullscreen_as_option.patch
# PATCH-FIX-UPSTREAM
Patch2:         %{name}-fixed_path_to_game_data.patch
# PATCH-FIX-UPSTREAM
Patch3:         %{name}-64-bit.patch
# PATCH-FIX-UPSTREAM
Patch4:         %{name}-cvs.patch
# PATCH-FIX-UPSTREAM
Patch5:         %{name}-openal.patch
# PATCH-FIX-UPSTREAM See: https://www.redhat.com/archives/fedora-games-list/2007-June/msg00000.html
Patch6:         %{name}-README.patch
# PATCH-FIX-UPSTREAM
Patch7:         %{name}-bufer-overflows.patch
# PATCH-FIX-UPSTREAM
Patch8:         %{name}-png15.patch
# PATCH-FIX-UPSTREAM nogravity-fix-stdint.patch -- fix missing stdint.h include
Patch9:         nogravity-fix-stdint.patch
BuildRequires:  Mesa-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel
BuildRequires:  libvorbis-devel
BuildRequires:  openal-soft-devel
BuildRequires:  unzip
BuildRequires:  update-desktop-files
BuildRequires:  zlib-devel
Requires:       %{name}-data = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} <= 1220
BuildRequires:  libopenal1
%endif

%description
No Gravity is a fantastic and futuristic universe made of five
intergalactic worlds. An arcade type game with great playability,
where it is easy to plunge into space battles against spacefighters,
space stations and more!

%prep
%setup -q -c
cp %{SOURCE4} ./src/Linux/Makefile.am
cp %{SOURCE5} ./src/Linux/bootstrap
cp %{SOURCE6} ./src/Linux/configure.in
%patch0 -b .snd_sdlmixer_c-powerpc-fix
%patch1 -b .fullscreen_as_option
%patch2 -b .fixed_path_to_game_data
%patch3 -p1 -b .64-bit
%patch4 -p1 -b .cvs
%patch5 -p1 -b .openal
%patch6 -p1 -b .license
%patch7 -p1 -b .buf-oflow
%patch8
%patch9 -p1
sed -i 's/\r//g' GNU.TXT README.TXT

%build
pushd src/Linux
	sh bootstrap
	%configure \
		--enable-sound=sdl_mixer \
		--disable-opengl
	make %{?_smp_mflags}
	mv %{name} %{name}-software
	make distclean
	%configure \
		--enable-sound=openal \
		--enable-opengl
	make %{?_smp_mflags}
	mv %{name} %{name}-opengl
popd

%install
install -D -m 755 src/Linux/%{name}-software %{buildroot}%{_bindir}/%{name}-software
install -D -m 755 src/Linux/%{name}-opengl %{buildroot}%{_bindir}/%{name}-opengl
install -D -m 755 %{SOURCE7} %{buildroot}%{_bindir}/%{name}
install -D -m 644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -D -m 644 %{SOURCE2} %{buildroot}%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -i %{name} Game ActionGame

%files
%defattr(-,root,root,-)
%doc GNU.TXT README.TXT
%{_bindir}/%{name}*
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/*.png

%changelog
openSUSE Build Service is sponsored by