File starfighter.spec of Package starfighter

# Now for the meat of the spec file
%define _icondir %{_datadir}/icons/hicolor
%define _gamesbindir %{_prefix}/games/
%define _gamesdatadir %{_datadir}/games/
%define _docdir %{_datadir}/doc/packages

Name:			starfighter
Version:		1.1
Summary:		Starfighter
License:		GPLv2
Source0:		%{name}-%{version}.tar.gz
Source1:		%{name}-icons.tar
Source2:		%{name}.desktop
Group:			Amusements/Games/Action/Arcade
Release:		1
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires:		desktop-file-utils
Patch0:			starfighter-1.1_makefile.diff
Requires:		hicolor-icon-theme
BuildRequires:		hicolor-icon-theme
BuildRequires:		gcc-c++
BuildRequires:		pkg-config
BuildRequires:		update-desktop-files
BuildRequires:		SDL-devel
BuildRequires:		SDL_image-devel
BuildRequires:		SDL_mixer-devel

After decades of war one company, who had gained powerful supplying both sides
with weaponary, steps forwards and crushes both warring factions in one swift
movement. Using far superior weaponary and AI craft, the company was completely
unstoppable and now no one can stand in their way. Thousands began to perish
under the iron fist of the company. The people cried out for a saviour, for
someone to light this dark hour... and someone did.

%setup -q
%setup -q -a 1
%patch0 -p1

export CFLAGS="`sdl-config --cflags` -Wall -DLINUX %{optflags}"
%{__make} %{?jobs:-j%jobs} VERSION=%{version} PACKLOCATION=%{_gamesdatadir}/parallelrealities/ DOCDIR=%{_docdir}/%{name}/ ICONDIR=%{_icondir}/

mkdir -p %{buildroot}%{_gamesdatadir}/parallelrealities
mkdir -p %{buildroot}%{_gamesbindir}
mkdir -p %{buildroot}/%{_datadir}/applications
strip %{name}
install -m 755 %{name} %{buildroot}/%{_gamesbindir}/%{name}
install -m 644 %{name}.pak %{buildroot}/%{_gamesdatadir}/parallelrealities/%{name}.pak

install -m 644 %{SOURCE2} %{buildroot}/%{_datadir}/applications/%{name}.desktop
%suse_update_desktop_file -i %{name}

for i in 16 32 64 128
	mkdir -p %{buildroot}/%{_icondir}/${i}x${i}/apps
	install -m 644 icons/%{name}-${i}.png %{buildroot}/%{_icondir}/${i}x${i}/apps/%{name}.png

%{__rm} -rf %{buildroot}
%{__rm} -rf %{_builddir}/%{name}-%{version}-%{release}-buildroot

%doc docs/*
%dir %{_gamesdatadir}/parallelrealities
openSUSE Build Service is sponsored by