File riscv-isa-sim.spec of Package riscv-isa-sim
# spec file for package riscv-isa-sim
#
# Copyright (c) 2024 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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/
#
## lto-no-text-in-archive
%define _lto_cflags %{nil}
Name: riscv-isa-sim
Version: 1.1.0+832
Release: 0
License: BSD-4-Clause
Summary: Spike RISC-V ISA Simulator
URL: https://github.com/riscv-software-src/riscv-isa-sim
Source0: %{name}-%{version}.tar.xz
#PATCH-FIX-OPENSUSE riscv-isa-sim-libdir.patch malcolmlewis@opensuse.org -- Install libraries to into standard /usr/lib64.
Patch0: riscv-isa-sim-libdir.patch
#PATCH-FIX-OPENSUSE riscv-isa-sim-remove-rpath.patch malcolmlewis@opensuse.org -- Remove rpath from pc files as we install into /usr/lib64.
Patch1: riscv-isa-sim-remove-rpath.patch
BuildRequires: boost-devel
BuildRequires: dtc
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: libboost_regex-devel
BuildRequires: libboost_system-devel
%description
Spike, the RISC-V ISA Simulator, implements a functional model of one or more
RISC-V harts. It is named after the golden spike used to celebrate the completion
of the US transcontinental railway.
%package devel
Summary: Development headers for %{name}
Requires: %{name} = %{version}
%description devel
Spike, the RISC-V ISA Simulator, implements a functional model of one or more
RISC-V harts. It is named after the golden spike used to celebrate the completion
of the US transcontinental railway.
%package devel-static
Summary: Static development headers for %{name}
Requires: %{name}-devel = %{version}
%description devel-static
Spike, the RISC-V ISA Simulator, implements a functional model of one or more
RISC-V harts. It is named after the golden spike used to celebrate the completion
of the US transcontinental railway.
%prep
%autosetup -p1
%build
%configure
%make_build
%install
%make_install
#Fix Shared library permissions
chmod 0755 %{buildroot}%{_libdir}/libcustomext.so \
%{buildroot}%{_libdir}/libriscv.so \
%{buildroot}%{_libdir}/libsoftfloat.so
%files
%doc ChangeLog.md
%license LICENSE
%{_bindir}/elf2hex
%{_bindir}/spike
%{_bindir}/spike-dasm
%{_bindir}/spike-log-parser
%{_bindir}/termios-xspike
%{_bindir}/xspike
%files devel
%dir %{_includedir}/fdt
%dir %{_includedir}/fesvr
%dir %{_includedir}/riscv
%dir %{_includedir}/softfloat
%dir %{_libdir}
%dir %{_libdir}/pkgconfig
%{_includedir}/fdt/*.h
%{_includedir}/fesvr/*.h
%{_includedir}/riscv/*.h
%{_includedir}/softfloat/*.h
%{_libdir}/libcustomext.so
%{_libdir}/libriscv.so
%{_libdir}/libsoftfloat.so
%{_libdir}/pkgconfig/riscv-*.pc
%files devel-static
%{_libdir}/libdisasm.a
%{_libdir}/libfesvr.a
%changelog