From 91174a0dc951c668b296a297e5dbd297fee80ed8 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 20 Sep 2021 10:04:57 +0100 Subject: [PATCH] Add opensbi 0.9 https://bugzilla.redhat.com/show_bug.cgi?id=1739133 To build: $ rpmbuild --define "_sourcedir $PWD" -ba opensbi.spec --- opensbi/.gitignore | 1 + opensbi/opensbi.spec | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 opensbi/.gitignore create mode 100644 opensbi/opensbi.spec diff --git a/opensbi/.gitignore b/opensbi/.gitignore new file mode 100644 index 0000000..8e9fff5 --- /dev/null +++ b/opensbi/.gitignore @@ -0,0 +1 @@ +/v0.9.tar.gz diff --git a/opensbi/opensbi.spec b/opensbi/opensbi.spec new file mode 100644 index 0000000..cda873a --- /dev/null +++ b/opensbi/opensbi.spec @@ -0,0 +1,82 @@ +# Debuginfo and stripping makes no sense for this package. +%global debug_package %{nil} +%global __strip /bin/true +%global _binaries_in_noarch_packages_terminate_build 0 + +Name: opensbi +Version: 0.9 +Release: 1%{?dist} +Summary: RISC-V Open Source Supervisor Binary Interface (OpenSBI) + +License: BSD +URL: https://github.com/riscv-software-src/opensbi + +Source0: https://github.com/riscv-software-src/%{name}/archive/refs/tags/v%{version}.tar.gz + +BuildRequires: gcc-riscv64-linux-gnu +BuildRequires: binutils-riscv64-linux-gnu + +# The -devel subpackage contains riscv64 code so you'll get: +# > Arch dependent binaries in noarch package +Buildarch: noarch + + +%description +The RISC-V Supervisor Binary Interface (SBI) is the firmware +used to boot RISC-V virtual machines in qemu. + + +%package devel +Summary: Development files for %{name} +# NB: Doesn't require the base package because it doesn't need it. + + +%description devel +This package contains development files (headers, libraries, etc) +for %{name}. + + +%prep +%setup -q -n opensbi-%{version} + + +%build +%global platforms generic +for platform in %{platforms}; do + make CROSS_COMPILE=riscv64-linux-gnu- PLATFORM=$platform %{?_smp_mflags} +done + + +%install +# This installs into the install/ subdirectory ... +for platform in %{platforms}; do + make CROSS_COMPILE=riscv64-linux-gnu- PLATFORM=$platform %{?_smp_mflags} \ + install +done +# ... and we copy the files we want to the desired locations. + +mkdir -p %{buildroot}%{_libdir} +cp -a install/usr/lib64/* %{buildroot}%{_libdir} + +mkdir -p %{buildroot}%{_includedir} +cp -a install/usr/include/* %{buildroot}%{_includedir} + +mkdir -p %{buildroot}%{_datadir} +cp -a install/usr/share/opensbi %{buildroot}%{_datadir}/%{name} + + +%files +%{_datadir}/%{name} + + +%files devel +%dir %{_libdir}/lp64 +%{_libdir}/lp64/libsbi*.a +%{_libdir}/lp64/opensbi/generic/lib/libplatsbi.a +%{_includedir}/sbi/ +%{_includedir}/sbi_utils/ + + +%changelog +* Mon Sep 20 2021 Richard W.M. Jones - 0.9-1 +- Initial release. -- 1.8.3.1