1 Star 0 Fork 3

jake/src-isula-rust-extensions

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
isula-rust-extensions.spec 1.88 KB
一键复制 编辑 原始数据 按行查看 历史
jake 提交于 2024-08-09 07:21 . Initial RPM release
#needsrootforbuild
%global __cargo_skip_build 0
%global _debugsource_packages 1
%global _debuginfo_subpackages 1
%define _unpackaged_files_terminate_build 0
%define debug_package %{nil}
Name: isula-rust-extensions
Version: 0.0.1
Release: 1
URL: https://gitee.com/openeuler/isula-rust-extensions
Source: %{name}-%{version}.tar.gz
Summary: isula-rust-extensions is a rust-extension library for iSulad.
Group: Application/System
License: Mulan PSL v2
ExclusiveArch: x86_64 aarch64
Patch0001: 0001-add-some-missing-c-rust-struct-transfer.patch
BuildRequires: rust
BuildRequires: cargo
BuildRequires: rust-packaging
BuildRequires: gcc
%description
Based on Rust programming language, rust-extension library for iSulad.
%package devel
Summary: Rust extensions for iSulad
Group: Libraries
ExclusiveArch: x86_64 aarch64
Requires: %{name} = %{version}-%{release}
%description devel
the %{name}-libs package contains rust-extension library for iSulad
%prep
%autosetup -p1
pushd nri
%cargo_prep
%cargo_generate_buildrequires
popd
%build
cd nri
sed -i '/\[source.crates-io\]/{n;d}' ./.cargo/config
sed -i '/\[source.local-registry\]/{n;d}' ./.cargo/config
sed -i '/\[source.local-registry\]/a directory = "vendor"' ./.cargo/config
%ifarch aarch64
sed -i 's/rustflags = \[/rustflags = \["-Clink-arg=-lgcc", "-Clink-arg=-lfdt", /g' ./.cargo/config
%endif
%cargo_build -a
%install
mkdir -p ${RPM_BUILD_ROOT}/{%{_libdir},%{_includedir}}
install -m 0644 nri/nri_plugin.h ${RPM_BUILD_ROOT}/%{_includedir}/nri_plugin.h
strip nri/target/release/libisula_nri.so
install -m 0755 nri/target/release/libisula_nri.so ${RPM_BUILD_ROOT}/%{_libdir}/libisula_nri.so
%files
%defattr(-,root, root,-)
%{_libdir}/*
%files devel
%defattr(-,root, root,-)
%{_includedir}/nri_plugin.h
%changelog
* Fri Aug 09 2024 jikai <jikai11@huawei.com> - 0.0.1-1
- Initial RPM release
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jikai11/src-isula-rust-extensions.git
git@gitee.com:jikai11/src-isula-rust-extensions.git
jikai11
src-isula-rust-extensions
src-isula-rust-extensions
master

搜索帮助