File d1x-rebirth.spec of Package d1x-rebirth

#
# spec file for package d1x-rebirth
#
# Copyright (c) 2020 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:           d1x-rebirth
Version:        0.61.git.1595387478.519c14a40
Release:        0
Summary:        Port of the 1995 classic game Descent 1: First Strike
License:        SUSE-Freeware
Group:          Amusements/Games/Action/Shoot
URL:            https://www.dxx-rebirth.com/
Source:         %{name}-%{version}.tar.xz
Source2:        https://www.dxx-rebirth.com/download/dxx/content/descent-pc-shareware.zip
Source3:        https://www.dxx-rebirth.com/download/dxx/res/d1xr-hires.dxa
Source4:        https://www.dxx-rebirth.com/download/dxx/res/d1xr-briefings-ger.dxa
BuildRequires:  Mesa-devel
BuildRequires:  SDL-devel
BuildRequires:  SDL_image-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  dos2unix
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel
BuildRequires:  nasm
BuildRequires:  physfs-devel
BuildRequires:  scons
BuildRequires:  unzip
BuildRequires:  update-desktop-files
Recommends:     %{name}-data

%description
D1X-Rebirth is a Source Port of the Descent Engine and provides
classical Gameplay combined with OpenGL graphics and effects,
a bunch of improvements and new features.

%package data
Summary:        Descent - PC Shareware game content
Group:          Amusements/Games/Action/Shoot
Requires:       %{name} = %{version}
BuildArch:      noarch

%description data
D1X-Rebirth is a Source Port of the Descent Engine and provides
classical Gameplay combined with OpenGL graphics and effects,
a bunch of improvements and new features.

This package contains the game data from the shareware version.

%prep
%setup -q -a2
dos2unix -c ascii d1x-rebirth/d1x.ini d1x-rebirth/*.txt
chmod 644 d1x-rebirth/d1x.ini d1x-rebirth/*.txt

%build
scons %{?_smp_mflags} \
	sharepath=%{_datadir}/games/descent \
	opengl=1 \
	sdlmixer=1 \
	d1x=1

%install
# binaries
install -dm 755 %{buildroot}%{_bindir}
install -m 755 d1x-rebirth/d1x-rebirth %{buildroot}%{_bindir}

# game data
install -dm 755 %{buildroot}%{_datadir}/games/descent
install -m 644 descent.pig %{buildroot}%{_datadir}/games/descent
install -m 644 descent.hog %{buildroot}%{_datadir}/games/descent
install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/games/descent
install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/games/descent

# icon
install -dm 755 %{buildroot}%{_datadir}/pixmaps/
install -m 644 d1x-rebirth/d1x-rebirth.xpm %{buildroot}%{_datadir}/pixmaps/

# menu
install -dm 755 %{buildroot}%{_datadir}/applications
install -m 644 d1x-rebirth/%{name}.desktop %{buildroot}%{_datadir}/applications

%files
%license COPYING.txt GPL-3.txt
%doc README.md d1x-rebirth/*.txt
%{_bindir}/d1x-rebirth
%{_datadir}/pixmaps/%{name}.xpm
%{_datadir}/applications/%{name}.desktop

%files data
%{_datadir}/games/descent/

%changelog
openSUSE Build Service is sponsored by