File qtrvsim.spec of Package qtrvsim

#
# spec file for package qtrvsim
#
# Copyright (c) 2017-2019 Karel Koci <cynerd@email.cz>
# Copyright (c) 2019-2024 Pavel Pisa <pisa@cmp.felk.cvut.cz>
# Copyright (c) 2020-2024 Jakub Dupak <dev@jakubdupak.com>
# Copyright (c) 2020-2021 Max Hollmann <hollmmax@fel.cvut.cz>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.

# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>
#
# Please submit bugfixes or comments via
#   
# issues tracker.
#


Name:           qtrvsim
Version:        0.9.8
Release:        0
Summary:        RISC-V CPU simulator for education purposes
License:        GPL-3.0-or-later
Group:          System/Emulators/Other
URL:            https://github.com/cvut/qtrvsim
Source:         qtrvsim_0.9.8.orig.tar.xz
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Widgets)
%if ! 0%{?suse_version}
BuildRequires:  desktop-file-utils
BuildRequires:  pkgconfig(libelf)
%endif
%if 0%{?suse_version}
BuildRequires:  libelf-devel
BuildRequires:  update-desktop-files
%endif

%description
RISC-V CPU simulator for education purposes with pipeline and cache visualization.

%prep
%setup -q

%build
%if 0%{?suse_version}
%cmake -DCMAKE_CXX_FLAGS="-Wno-error" -DCMAKE_C_FLAGS="-Wno-error"
%else
%cmake
%endif
%cmake_build

%install
%cmake_install

#desktop icon
%if 0%{?suse_version}
%suse_update_desktop_file -r -i qtrvsim 'System Emulator'
%endif

%if 0%{?fedora} || 0%{?rhel} || 0%{?centos}
desktop-file-validate %{buildroot}%{_datadir}/applications/qtrvsim.desktop
%endif

# TODO: this should be generated from CMake
%files
%{_bindir}/qtrvsim_gui
%{_bindir}/qtrvsim_cli
%{_datadir}/icons/hicolor/scalable/apps/qtrvsim_gui.svg
%{_datadir}/icons/hicolor/48x48/apps/qtrvsim_gui.png
%{_datadir}/applications/qtrvsim.desktop
%{_datadir}/metainfo/cz.cvut.edu.comparch.qtrvsim.metainfo.xml

%license LICENSE
%doc README.md

%changelog
openSUSE Build Service is sponsored by