File airstrike.spec of Package airstrike

#
# spec file for package airstrike
#
# Copyright (c) 2022 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           airstrike
Version:        pre6a
Release:        0
Summary:        2D dogfight game
License:        GPL-2.0
Group:          Amusements/Games/Action/Shoot
URL:            https://icculus.org/airstrike/
Source:         http://icculus.org/%{name}/%{name}-%{version}-src.tar.gz
# PATCH-FIX-MAGEIA
Patch0:         airstrike-pre6a-config.patch
Patch1:         airstrike-pre6a-optflags.patch
Patch3:         airstrike-pre6a-fix-build.patch
Patch4:         airstrike-pre6a-fix-link-flags.patch
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(SDL_image)
BuildRequires:  pkgconfig(SDL_mixer)
BuildRequires:  SDL-devel
BuildRequires:  fdupes

%description
Airstrike is a 0-2 players 2d dogfight game in the tradition of the
Intellivision and Amiga games 'Biplanes' and 'BIP'. It features a robust
physics engine and several other extensions of the original games,
such as povray made graphics and incredible gameplay.

%prep
%autosetup -n airstrike-%{version}-src -p1

%build
%make_build OPTFLAGS="%{optflags}" airstrike-sound

%install
install -m755 airstrike -D %{buildroot}%{_bindir}/airstrike.bin

# Launch script
cat <<EOF > %{buildroot}%{_bindir}/%{name}
#!/bin/sh
if [ ! -e \$HOME/.airstrikerc ]; then
	cp %{_datadir}/%{name}/airstrikerc \$HOME/.airstrikerc
fi
cd %{_datadir}/%{name}
airstrike.bin \$@
EOF
chmod 755 %{buildroot}%{_bindir}/%{name}

install -m644 airstrikerc -D %{buildroot}%{_datadir}/%{name}/airstrikerc
cp -r data  %{buildroot}%{_datadir}/%{name}

install -m644 doc/%{name}.6 -D %{buildroot}%{_mandir}/man6/%{name}.6

%fdupes %{buildroot}%{_datadir}/%{name}

%files
%doc ChangeLog README doc
%{_bindir}/%{name}*
%{_datadir}/%{name}/
%{_mandir}/man6/%{name}.6%{?ext_man}

%changelog
openSUSE Build Service is sponsored by