File previous.spec of Package Previous

#
# spec file for package previous
#
# 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:           previous
# upstream does not tag releases
# look at readme.previous.txt for version information
%define snapshot r1667
Version:        3.9_%{snapshot}
Release:        0
Summary:        A NeXT computer emulator based on hatari emulator source code
License:        GPL-2.0+
Group:          System/Emulators/Other
Url:            http://previous.alternative-system.com
# created via "download snapshot" on sourceforge
Source0:        %{name}-code-%{snapshot}-trunk.zip
Source1:        date_and_time_filelist.txt
Source2:        %{name}.desktop

BuildRequires:  ImageMagick
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  libpng-devel
BuildRequires:  libpcap-devel
%if 0%{?suse_version} < 1599
BuildRequires:  libSDL2-devel
%else
BuildRequires:  sdl2-compat-devel
%endif
BuildRequires:  unzip
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Previous is an emulator for the NeXT computer "black" hardware based on the hatari source code

%prep
%setup -q -n %{name}-code-%{snapshot}-trunk


# fix builddate info
# Remove build time references so build-compare can do its work
cp %{SOURCE1} .
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
sed -e "s/__TIME__/\"$FAKE_BUILDTIME\"/" -i $(cat date_and_time_filelist.txt)
sed -e "s/__DATE__/\"$FAKE_BUILDDATE\"/" -i $(cat date_and_time_filelist.txt)

%build
LDFLAGS="$(sdl2-config --libs)" \
CFLAGS="-O3 -fomit-frame-pointer" \
 ./configure --prefix=%{_prefix}
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} %{?_smp_mflags} install
mkdir -p %{buildroot}%{_datadir}/applications  %{buildroot}%{_datadir}/pixmaps
convert -resize 128x128 src/Previous-icon.bmp %{name}.png
install -m0644 %{name}.png -t %{buildroot}%{_datadir}/pixmaps
install -m0644 %{SOURCE2} -t %{buildroot}%{_datadir}/applications
# drop ROM files
rm -rf %{buildroot}%{_datadir}/%{name}/*.BIN

%files
%defattr(-,root,root)
%doc readme.previous.txt networking.howto.txt filesharing.howto.txt netboot.howto.txt
%license gpl.txt
%dir %{_datadir}/%{name}
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/previous/Previous-icon.bmp

%changelog

openSUSE Build Service is sponsored by