5 Star 0 Fork 3

OpenCloudOS Stream/rust-toolset

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
macros.rust-srpm 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
gordonwwang 提交于 2024-06-27 20:38 . provides rust-srpm-macros
# rust_arches: list of architectures where building Rust is supported
#
# Since RPM itself now depends on Rust code (via its GPG backend, rpm-sequoia),
# this list will probably always be a superset of all architectures that are
# supported by Fedora, which is why it is no longer required to set
# "ExclusiveArch: rust_arches" for Rust packages in Fedora.
%rust_arches x86_64 %{ix86} armv7hl aarch64 ppc64 ppc64le riscv64 s390x
# version_no_tilde: lua macro for reconstructing the original crate version
# from the RPM version (i.e. replace any "~" characters with "-")
%version_no_tilde() %{lua:
local sep = rpm.expand('%1')
local ver = rpm.expand('%2')
\
if sep == '%1' then
sep = '-'
end
\
if ver == '%2' then
ver = rpm.expand('%version')
end
ver = ver:gsub('~', sep)
\
print(ver)
}
# __crates_url: default API endpoint for downloading .crate files from crates.io
%__crates_url https://crates.io/api/v1/crates/
# crates_source: lua macro for constructing the Source URL for a crate
%crates_source() %{lua:
local crate = rpm.expand('%1')
local version = rpm.expand('%2')
local url = rpm.expand('%__crates_url')
\
-- first argument missing: fall back to %crate
if crate == '%1' then
crate = rpm.expand('%crate')
end
-- %crate macro not defined: fall back to %name
if crate == '%crate' then
crate = rpm.expand('%name')
end
\
-- second argument missing: fall back to %crate_version
if version == '%2' then
version = rpm.expand('%crate_version')
end
-- %crate_version macro not defined: fall back to %version
if version == '%crate_version' then
version = rpm.expand('%version')
end
-- replace '~' with '-' for backwards compatibility
-- can be removed in the future
version = version:gsub('~', '-')
\
print(url .. crate .. '/' .. version .. '/download#/' .. crate .. '-' .. version .. '.crate')
}
# __cargo_skip_build: unused macro, set to 0 for backwards compatibility
%__cargo_skip_build 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/rust-toolset.git
git@gitee.com:opencloudos-stream/rust-toolset.git
opencloudos-stream
rust-toolset
rust-toolset
master

搜索帮助