File virtualjaguar.spec of Package virtualjaguar

#
# spec file for package virtualjaguar
#
# 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:           virtualjaguar
Version:        2.1.3
Release:        0
Summary:        Atari Jaguar Emulator
License:        GPL-3.0
Group:          System/Emulators/Other
Url:            http://icculus.org/virtualjaguar/
Source0:        https://icculus.org/virtualjaguar/tarballs/%{name}-%{version}.tar.bz2
Source1:        %{name}.changes
Patch0:         %{name}-rompaths.patch
Patch1:         %{name}-qmake-qt5.patch
Patch2:         %{name}-dead-code.patch
Patch3:         %{name}-sdl2.patch
Patch4:         %{name}-joystick-identifier.patch
Patch5:         %{name}-missing-header.patch
BuildRequires:  SDL2-devel
BuildRequires:  gcc-c++
BuildRequires:  libcdio-devel
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libQt5OpenGL-devel
BuildRequires:  xorg-x11-Mesa-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Atari Jaguar emulator. Needs BIOS ROM(s) in %{_datadir}/virtualjaguar/BIOS.

%prep
%setup -q -n linux-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
sed -e 's|__ROMPATH__|%{_datadir}/virtualjaguar|' -i src/gui/generaltab.cpp
# fix builddate info
# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{SOURCE1} '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{SOURCE1} '+%%b %%e %%Y')
sed -e "s/__TIME__/\"$FAKE_BUILDTIME\"/" -i src/gui/mainwin.cpp src/m68000/build68k.c src/m68000/gencpu.c src/m68000/readcpu.c 
sed -e "s/__DATE__/\"$FAKE_BUILDDATE\"/" -i src/gui/mainwin.cpp src/m68000/build68k.c src/m68000/gencpu.c src/m68000/readcpu.c 

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
make -f jaguarcore.mak V=1
make -C src/m68000 V=1
make V=1

%install
install -D -m 755 virtualjaguar %{buildroot}%{_bindir}/virtualjaguar
mkdir -p %{buildroot}%{_datadir}/virtualjaguar/ROMs
mkdir -p %{buildroot}%{_datadir}/virtualjaguar/BIOS
mkdir -p %{buildroot}%{_datadir}/virtualjaguar/EEPROMs

%files
%defattr(-,root,root)
%doc docs/*
%{_bindir}/virtualjaguar
%{_datadir}/virtualjaguar

%changelog
openSUSE Build Service is sponsored by