File alienarena.spec of Package alienarena

#
# spec file for package alienarena
#
# Copyright (c) 2016 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:           alienarena
Version:        7.65
Release:        0
Summary:        3D Deathmatch game
License:        GPL-2.0+
Group:          Amusements/Games/3D/Shoot
Url:            http://icculus.org/alienarena/rpa/
# use alienarena-create-tarball.sh to create tarball
Source0:        %{name}-%{version}.tar.bz2
Source1:        %{name}.desktop
Source2:        GPL.acebot.txt
Source5:        %{name}-create-tarball.sh
Source99:       %{name}.changes
BuildRequires:  fdupes
BuildRequires:  Mesa-devel
BuildRequires:  SDL-devel
BuildRequires:  automake
BuildRequires:  curl-devel
BuildRequires:  gcc-c++
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libvorbis-devel
BuildRequires:  openal-soft-devel
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
BuildRequires:  xorg-x11-libXext-devel
Requires:       %{name}-data = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Alien Arena 2011 is an online deathmatch game with over 30 levels, seven modes
of play, loads of mutators, built-in bots, 11 player characters, and 9 weapons
(with alt-fire modes).

%package server
Summary:        Dedicated server for alienarena, the FPS game
Group:          Amusements/Games/3D/Shoot
Requires:       %{name}-data = %{version}

%description server
Alien Arena 2011 is an online deathmatch game with over 30 levels, seven modes
of play, loads of mutators, built-in bots, 11 player characters, and 9 weapons
(with alt-fire modes).

This is the dedicated server.

%prep
%setup -q

# Copy license clarification for acebot
cp -p %{SOURCE2} .

# clean up end-line encoding
sed -i 's/\r//' docs/*.txt

# comment game data line
sed -i '/include game_data.am/s/^/# /' Makefile.am

modified="$(sed -n '/^----/n;s/ - .*$//;p;q' "%{SOURCE99}")"
DATE="\"$(date -d "${modified}" "+%%b %%e %%Y")\""
find .  -name '*.[ch]' -o -name '*.cpp' | xargs sed -i "s/__DATE__/${DATE}/g"

%build
autoreconf -fiv
%configure --docdir=%{_defaultdocdir}/%{name} --program-transform-name='s/crx/alienarena/'
make %{?_smp_mflags}

%install
%make_install
install -D %{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png

%suse_update_desktop_file -i %{name} Game ActionGame

%fdupes %{buildroot}%{datadir}

%files
%defattr(-,root,root,-)
%doc GPL.acebot.txt docs/*.txt
%doc %{_defaultdocdir}/%{name}/README
%{_bindir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/icons/%{name}.png
%{_datadir}/pixmaps/%{name}.png

%files server
%defattr(-,root,root,-)
%doc docs/*.txt
%{_bindir}/%{name}-ded

%changelog